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

This commit is contained in:
Christophe Dumez 2007-06-28 22:13:01 +00:00
parent 568b2ddf75
commit ee4a4c81bf
3 changed files with 11 additions and 1 deletions

View file

@ -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);
}