Fixed #150.
This commit is contained in:
parent
30b8e7d176
commit
42b44043df
|
@ -14,6 +14,7 @@ Changed:
|
||||||
|
|
||||||
Fixed:
|
Fixed:
|
||||||
|
|
||||||
|
▪ Feeds are now (re)sorted when batch update finishes. (bug #150)
|
||||||
▪ Expand status if items in feed list are now persistent when performing sync-in of TT-RSS accounts. (bug #149)
|
▪ Expand status if items in feed list are now persistent when performing sync-in of TT-RSS accounts. (bug #149)
|
||||||
▪ Fixed problem with importing invalid OPML 2.0 files. (bug #145)
|
▪ Fixed problem with importing invalid OPML 2.0 files. (bug #145)
|
||||||
▪ Fixed error in SQL initialization script which led to problems with in-memory SQLite DBs. (bug #140)
|
▪ Fixed error in SQL initialization script which led to problems with in-memory SQLite DBs. (bug #140)
|
||||||
|
|
|
@ -145,7 +145,7 @@ void FeedsModel::updateFeeds(const QList<Feed *> &feeds) {
|
||||||
connect(m_feedDownloaderThread, SIGNAL(finished()), m_feedDownloaderThread, SLOT(deleteLater()));
|
connect(m_feedDownloaderThread, SIGNAL(finished()), m_feedDownloaderThread, SLOT(deleteLater()));
|
||||||
connect(m_feedDownloader, SIGNAL(finished(FeedDownloadResults)), this, SLOT(onFeedUpdatesFinished(FeedDownloadResults)));
|
connect(m_feedDownloader, SIGNAL(finished(FeedDownloadResults)), this, SLOT(onFeedUpdatesFinished(FeedDownloadResults)));
|
||||||
connect(m_feedDownloader, SIGNAL(started()), this, SLOT(onFeedUpdatesStarted()));
|
connect(m_feedDownloader, SIGNAL(started()), this, SLOT(onFeedUpdatesStarted()));
|
||||||
connect(m_feedDownloader, SIGNAL(progress(Feed*,int,int)), this, SLOT(onFeedUpdatesProgress(Feed*,int,int)));
|
connect(m_feedDownloader, SIGNAL(progress(const Feed*,int,int)), this, SLOT(onFeedUpdatesProgress(const Feed*,int,int)));
|
||||||
|
|
||||||
// Connections are made, start the feed downloader thread.
|
// Connections are made, start the feed downloader thread.
|
||||||
m_feedDownloaderThread->start();
|
m_feedDownloaderThread->start();
|
||||||
|
@ -177,6 +177,7 @@ void FeedsModel::onFeedUpdatesFinished(const FeedDownloadResults &results) {
|
||||||
}
|
}
|
||||||
|
|
||||||
emit feedsUpdateFinished();
|
emit feedsUpdateFinished();
|
||||||
|
emit sortingRequired();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsModel::updateAllFeeds() {
|
void FeedsModel::updateAllFeeds() {
|
||||||
|
|
|
@ -221,6 +221,9 @@ class FeedsModel : public QAbstractItemModel {
|
||||||
// NOTE: View will probably expand dropped index.
|
// NOTE: View will probably expand dropped index.
|
||||||
void requireItemValidationAfterDragDrop(const QModelIndex &source_index);
|
void requireItemValidationAfterDragDrop(const QModelIndex &source_index);
|
||||||
|
|
||||||
|
// When emitted, view (re)sorts items.
|
||||||
|
void sortingRequired();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RootItem *m_rootItem;
|
RootItem *m_rootItem;
|
||||||
QList<QString> m_headerData;
|
QList<QString> m_headerData;
|
||||||
|
|
|
@ -59,7 +59,7 @@ void DiscoverFeedsButton::setFeedAddresses(const QStringList &addresses) {
|
||||||
m_addresses = addresses;
|
m_addresses = addresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiscoverFeedsButton::linkTriggered(const QAction *action) {
|
void DiscoverFeedsButton::linkTriggered(QAction *action) {
|
||||||
const QString url = action->property("url").toString();
|
const QString url = action->property("url").toString();
|
||||||
ServiceRoot *root = static_cast<ServiceRoot*>(action->property("root").value<void*>());
|
ServiceRoot *root = static_cast<ServiceRoot*>(action->property("root").value<void*>());
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class DiscoverFeedsButton : public QToolButton {
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
// User chose any of addresses.
|
// User chose any of addresses.
|
||||||
void linkTriggered(const QAction *action);
|
void linkTriggered(QAction *action);
|
||||||
void fillMenu();
|
void fillMenu();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -58,6 +58,7 @@ FeedsView::FeedsView(QWidget *parent)
|
||||||
connect(m_sourceModel, SIGNAL(requireItemValidationAfterDragDrop(QModelIndex)), this, SLOT(validateItemAfterDragDrop(QModelIndex)));
|
connect(m_sourceModel, SIGNAL(requireItemValidationAfterDragDrop(QModelIndex)), this, SLOT(validateItemAfterDragDrop(QModelIndex)));
|
||||||
connect(m_sourceModel, SIGNAL(itemExpandRequested(QList<RootItem*>,bool)), this, SLOT(onItemExpandRequested(QList<RootItem*>,bool)));
|
connect(m_sourceModel, SIGNAL(itemExpandRequested(QList<RootItem*>,bool)), this, SLOT(onItemExpandRequested(QList<RootItem*>,bool)));
|
||||||
connect(m_sourceModel, SIGNAL(itemExpandStateSaveRequested(RootItem*)), this, SLOT(onItemExpandStateSaveRequested(RootItem*)));
|
connect(m_sourceModel, SIGNAL(itemExpandStateSaveRequested(RootItem*)), this, SLOT(onItemExpandStateSaveRequested(RootItem*)));
|
||||||
|
connect(m_sourceModel, SIGNAL(sortingRequired()), this, SLOT(reSort()));
|
||||||
connect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(saveSortState(int,Qt::SortOrder)));
|
connect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(saveSortState(int,Qt::SortOrder)));
|
||||||
|
|
||||||
setModel(m_proxyModel);
|
setModel(m_proxyModel);
|
||||||
|
@ -133,8 +134,27 @@ void FeedsView::loadAllExpandStates() {
|
||||||
settings->value(GROUP(CategoriesExpandStates), setting_name, item->childCount() > 0).toBool());
|
settings->value(GROUP(CategoriesExpandStates), setting_name, item->childCount() > 0).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
sortByColumn(qApp->settings()->value(GROUP(GUI), SETTING(GUI::DefaultSortColumnFeeds)).toInt(),
|
sort(true);
|
||||||
static_cast<Qt::SortOrder>(qApp->settings()->value(GROUP(GUI), SETTING(GUI::DefaultSortOrderFeeds)).toInt()));
|
}
|
||||||
|
|
||||||
|
void FeedsView::sort(bool from_settings) {
|
||||||
|
int column;
|
||||||
|
Qt::SortOrder order;
|
||||||
|
|
||||||
|
if (from_settings) {
|
||||||
|
column = qApp->settings()->value(GROUP(GUI), SETTING(GUI::DefaultSortColumnFeeds)).toInt();
|
||||||
|
order = static_cast<Qt::SortOrder>(qApp->settings()->value(GROUP(GUI), SETTING(GUI::DefaultSortOrderFeeds)).toInt());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
column = header()->sortIndicatorSection();
|
||||||
|
order = header()->sortIndicatorOrder();
|
||||||
|
}
|
||||||
|
|
||||||
|
sortByColumn(column, order);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FeedsView::reSort() {
|
||||||
|
m_proxyModel->sort(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::addFeedIntoSelectedAccount() {
|
void FeedsView::addFeedIntoSelectedAccount() {
|
||||||
|
|
|
@ -61,6 +61,10 @@ class FeedsView : public QTreeView {
|
||||||
void loadAllExpandStates();
|
void loadAllExpandStates();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
// Sorts according to column/order taken from settings.
|
||||||
|
void sort(bool from_settings);
|
||||||
|
void reSort();
|
||||||
|
|
||||||
void addFeedIntoSelectedAccount();
|
void addFeedIntoSelectedAccount();
|
||||||
void addCategoryIntoSelectedAccount();
|
void addCategoryIntoSelectedAccount();
|
||||||
void expandCollapseCurrentItem();
|
void expandCollapseCurrentItem();
|
||||||
|
|
Loading…
Reference in New Issue