Browse Source

Attempt to fix the sorting of the progress column on restart (anyone can confirm? my Qt4.3 is buggy and columns won't sort)

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
ee4a4c81bf
  1. 1
      Changelog
  2. 9
      src/GUI.cpp
  3. 2
      src/GUI.h

1
Changelog

@ -19,6 +19,7 @@
- FEATURE: Filtered files are not allocated on the hard-drive anymore (if FS is compatible) - 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) - 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 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 torrent properties a little
- COSMETIC: Redesigned options a little - COSMETIC: Redesigned options a little
- COSMETIC: Display more logs messages concerning features - COSMETIC: Display more logs messages concerning features

9
src/GUI.cpp

@ -65,6 +65,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
systrayIntegration = false; systrayIntegration = false;
qDebug("Info: System tray unavailable\n"); qDebug("Info: System tray unavailable\n");
} }
delayedSorting = false;
// Finished torrents tab // Finished torrents tab
finishedTorrentTab = new FinishedTorrents(this, &BTSession); finishedTorrentTab = new FinishedTorrents(this, &BTSession);
tabs->addTab(finishedTorrentTab, tr("Finished")); tabs->addTab(finishedTorrentTab, tr("Finished"));
@ -486,6 +487,8 @@ void GUI::updateDlList(bool force){
qDebug("Paused torrent finished checking with state: %d", torrentStatus.state); qDebug("Paused torrent finished checking with state: %d", torrentStatus.state);
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress)); DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)torrentStatus.progress));
BTSession.pauseTorrent(fileHash); BTSession.pauseTorrent(fileHash);
if(delayedSorting)
sortDownloadListFloat(PROGRESS, delayedSortingOrder);
continue; continue;
} }
} }
@ -661,9 +664,13 @@ void GUI::sortDownloadList(int index, Qt::SortOrder startSortOrder, bool fromLoa
case ETA: case ETA:
case UPSPEED: case UPSPEED:
case DLSPEED: case DLSPEED:
case PROGRESS:
sortDownloadListFloat(index, sortOrder); sortDownloadListFloat(index, sortOrder);
break; break;
case PROGRESS:
// Progress sorting must be delayed until files are checked
delayedSorting = true;
delayedSortingOrder = sortOrder;
break;
default: default:
sortDownloadListString(index, sortOrder); sortDownloadListString(index, sortOrder);
} }

2
src/GUI.h

@ -82,6 +82,8 @@ class GUI : public QMainWindow, private Ui::MainWindow{
QLabel *connecStatusLblIcon; QLabel *connecStatusLblIcon;
bool systrayIntegration; bool systrayIntegration;
bool force_exit; bool force_exit;
bool delayedSorting;
Qt::SortOrder delayedSortingOrder;
// Preview // Preview
previewSelect *previewSelection; previewSelect *previewSelection;
QProcess *previewProcess; QProcess *previewProcess;

Loading…
Cancel
Save