From fbb4d0cd3d9e8e6b577f30181bc86b95e8441789 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 2 Oct 2014 20:34:21 +0200 Subject: [PATCH] No sort indicators. --- src/core/feeddownloader.cpp | 2 -- src/core/feeddownloader.h | 3 +-- src/core/feedsproxymodel.cpp | 18 +++--------------- src/core/feedsproxymodel.h | 1 - src/gui/feedsview.cpp | 4 ++-- src/gui/messagesview.cpp | 7 ++++--- 6 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/core/feeddownloader.cpp b/src/core/feeddownloader.cpp index c9077bbb4..1bd2f8afb 100644 --- a/src/core/feeddownloader.cpp +++ b/src/core/feeddownloader.cpp @@ -38,9 +38,7 @@ void FeedDownloader::updateFeeds(const QList &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); } diff --git a/src/core/feeddownloader.h b/src/core/feeddownloader.h index ea74fccd1..96ca221cf 100644 --- a/src/core/feeddownloader.h +++ b/src/core/feeddownloader.h @@ -19,7 +19,6 @@ #define FEEDDOWNLOADER_H #include -#include 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); }; diff --git a/src/core/feedsproxymodel.cpp b/src/core/feedsproxymodel.cpp index 21942bdd0..3d066f419 100755 --- a/src/core/feedsproxymodel.cpp +++ b/src/core/feedsproxymodel.cpp @@ -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; diff --git a/src/core/feedsproxymodel.h b/src/core/feedsproxymodel.h index 1313f674b..5bc54dd6d 100755 --- a/src/core/feedsproxymodel.h +++ b/src/core/feedsproxymodel.h @@ -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. diff --git a/src/gui/feedsview.cpp b/src/gui/feedsview.cpp index 3b864478b..32f4d1ca4 100755 --- a/src/gui/feedsview.cpp +++ b/src/gui/feedsview.cpp @@ -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. diff --git a/src/gui/messagesview.cpp b/src/gui/messagesview.cpp index 59df34338..b0ce6397c 100755 --- a/src/gui/messagesview.cpp +++ b/src/gui/messagesview.cpp @@ -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) {