diff --git a/Changelog b/Changelog index efbe15991..2ac90a82c 100644 --- a/Changelog +++ b/Changelog @@ -19,6 +19,7 @@ - FEATURE: Filtered files are not allocated on the hard-drive anymore (if FS is compatible) - FEATURE: Added a way to link against static libtorrent (useful for deb packages) - BUGFIX: Progress of paused torrents is now correct on restart + - BUGFIX: Progress column gets sorted on restart it is was during last execution - COSMETIC: Redesigned torrent properties a little - COSMETIC: Redesigned options a little - COSMETIC: Display more logs messages concerning features diff --git a/src/GUI.cpp b/src/GUI.cpp index 94589ab9a..9bfe7d82f 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -65,6 +65,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){ systrayIntegration = false; qDebug("Info: System tray unavailable\n"); } + delayedSorting = false; // Finished torrents tab finishedTorrentTab = new FinishedTorrents(this, &BTSession); tabs->addTab(finishedTorrentTab, tr("Finished")); @@ -486,6 +487,8 @@ void GUI::updateDlList(bool force){ qDebug("Paused torrent finished checking with state: %d", torrentStatus.state); DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress)); BTSession.pauseTorrent(fileHash); + if(delayedSorting) + sortDownloadListFloat(PROGRESS, delayedSortingOrder); continue; } } @@ -661,9 +664,13 @@ void GUI::sortDownloadList(int index, Qt::SortOrder startSortOrder, bool fromLoa case ETA: case UPSPEED: case DLSPEED: - case PROGRESS: sortDownloadListFloat(index, sortOrder); break; + case PROGRESS: + // Progress sorting must be delayed until files are checked + delayedSorting = true; + delayedSortingOrder = sortOrder; + break; default: sortDownloadListString(index, sortOrder); } diff --git a/src/GUI.h b/src/GUI.h index ad8c990f3..b3534c03f 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -82,6 +82,8 @@ class GUI : public QMainWindow, private Ui::MainWindow{ QLabel *connecStatusLblIcon; bool systrayIntegration; bool force_exit; + bool delayedSorting; + Qt::SortOrder delayedSortingOrder; // Preview previewSelect *previewSelection; QProcess *previewProcess;