No sort indicators.

This commit is contained in:
Martin Rotter 2014-10-02 20:34:21 +02:00
parent 7836756579
commit fbb4d0cd3d
6 changed files with 10 additions and 25 deletions

View File

@ -38,9 +38,7 @@ void FeedDownloader::updateFeeds(const QList<FeedsModelFeed*> &feeds) {
for (int i = 0, total = feeds.size(); i < total; i++) {
feeds.at(i)->update();
qDebug("Made progress in feed updates: %d/%d (id of feed is %d).", i + 1, total, feeds.at(i)->id());
emit progress(feeds.at(i), i + 1, total);
}

View File

@ -19,7 +19,6 @@
#define FEEDDOWNLOADER_H
#include <QObject>
#include <QPointer>
class FeedsModelFeed;
@ -53,7 +52,7 @@ class FeedDownloader : public QObject {
// Emitted if any item is processed.
// "Current" number indicates count of processed feeds
// and "total" number indicates total number of feeds
// which are in the initial queue.
// which were in the initial queue.
void progress(FeedsModelFeed *feed, int current, int total);
};

View File

@ -32,7 +32,7 @@ FeedsProxyModel::FeedsProxyModel(QObject *parent)
setSortRole(Qt::EditRole);
setSortCaseSensitivity(Qt::CaseInsensitive);
setFilterCaseSensitivity(Qt::CaseInsensitive);
setFilterKeyColumn(0);
setFilterKeyColumn(-1);
setFilterRole(Qt::EditRole);
setDynamicSortFilter(true);
setSourceModel(m_sourceModel);
@ -42,8 +42,7 @@ FeedsProxyModel::~FeedsProxyModel() {
qDebug("Destroying FeedsProxyModel instance");
}
bool FeedsProxyModel::lessThan(const QModelIndex &left,
const QModelIndex &right) const {
bool FeedsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const {
if (left.isValid() && right.isValid()) {
// Make necessary castings.
FeedsModelRootItem *left_item = m_sourceModel->itemForIndex(left);
@ -63,8 +62,7 @@ bool FeedsProxyModel::lessThan(const QModelIndex &left,
}
else {
// In other cases, sort by title.
return QString::localeAwareCompare(left_item->title(),
right_item->title()) < 0;
return QString::localeAwareCompare(left_item->title(), right_item->title()) < 0;
}
}
else if (left_item->kind() == FeedsModelRootItem::RecycleBin) {
@ -92,16 +90,6 @@ bool FeedsProxyModel::lessThan(const QModelIndex &left,
}
}
QModelIndexList FeedsProxyModel::mapListFromSource(const QModelIndexList &indexes) {
QModelIndexList mapped_indexes;
foreach (const QModelIndex &index, indexes) {
mapped_indexes << mapFromSource(index);
}
return mapped_indexes;
}
QModelIndexList FeedsProxyModel::mapListToSource(const QModelIndexList &indexes) {
QModelIndexList source_indexes;

View File

@ -38,7 +38,6 @@ class FeedsProxyModel : public QSortFilterProxyModel {
// Maps list of indexes.
QModelIndexList mapListToSource(const QModelIndexList &indexes);
QModelIndexList mapListFromSource(const QModelIndexList &indexes);
protected:
// Compares two rows of data.

View File

@ -578,8 +578,6 @@ void FeedsView::setupAppearance() {
header()->setResizeMode(FDS_MODEL_COUNTS_INDEX, QHeaderView::ResizeToContents);
#endif
header()->setStretchLastSection(false);
header()->setSortIndicatorShown(false);
setUniformRowHeights(true);
setAnimated(true);
setSortingEnabled(true);
@ -595,6 +593,8 @@ void FeedsView::setupAppearance() {
setRootIsDecorated(false);
setSelectionMode(QAbstractItemView::SingleSelection);
setItemDelegate(new StyledItemDelegateWithoutFocus(this));
header()->setStretchLastSection(false);
header()->setSortIndicatorShown(false);
// Sort in ascending order, that is categories are
// "bigger" than feeds.

View File

@ -43,7 +43,6 @@ MessagesView::MessagesView(QWidget *parent)
createConnections();
setModel(m_proxyModel);
setupAppearance();
setItemDelegate(new StyledItemDelegateWithoutFocus(this));
}
MessagesView::~MessagesView() {
@ -106,8 +105,6 @@ void MessagesView::reloadSelections(int mark_current_index_read) {
}
void MessagesView::setupAppearance() {
header()->setDefaultSectionSize(MESSAGES_VIEW_DEFAULT_COL);
header()->setStretchLastSection(false);
setUniformRowHeights(true);
setAcceptDrops(false);
setDragEnabled(false);
@ -119,6 +116,10 @@ void MessagesView::setupAppearance() {
setSortingEnabled(true);
setAllColumnsShowFocus(false);
setSelectionMode(QAbstractItemView::ExtendedSelection);
setItemDelegate(new StyledItemDelegateWithoutFocus(this));
header()->setDefaultSectionSize(MESSAGES_VIEW_DEFAULT_COL);
header()->setStretchLastSection(false);
header()->setSortIndicatorShown(false);
}
void MessagesView::keyPressEvent(QKeyEvent *event) {