From 8b40e4343221bbc9075b66f794c4eace8c34fb6d Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 2 Nov 2008 18:19:14 +0000 Subject: [PATCH] should speed up startup --- src/FinishedTorrents.cpp | 1 - src/FinishedTorrents.h | 2 +- src/GUI.cpp | 2 ++ src/downloadingTorrents.cpp | 3 --- src/downloadingTorrents.h | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/FinishedTorrents.cpp b/src/FinishedTorrents.cpp index 2db896a58..5e6ae46b4 100644 --- a/src/FinishedTorrents.cpp +++ b/src/FinishedTorrents.cpp @@ -124,7 +124,6 @@ void FinishedTorrents::addTorrent(QString hash){ // Update the number of finished torrents ++nbFinished; emit finishedTorrentsNumberChanged(nbFinished); - sortFinishedList(); } void FinishedTorrents::torrentAdded(QTorrentHandle& h) { diff --git a/src/FinishedTorrents.h b/src/FinishedTorrents.h index ccf2afb37..45e1dc304 100644 --- a/src/FinishedTorrents.h +++ b/src/FinishedTorrents.h @@ -60,7 +60,6 @@ class FinishedTorrents : public QWidget, public Ui::seeding { void displayFinishedHoSMenu(const QPoint&); void setRowColor(int row, QString color); void saveColWidthFinishedList() const; - void loadLastSortedColumn(); void toggleFinishedListSortOrder(int index); void sortFinishedList(int index=-1, Qt::SortOrder sortOrder=Qt::AscendingOrder); void sortFinishedListFloat(int index, Qt::SortOrder sortOrder); @@ -84,6 +83,7 @@ class FinishedTorrents : public QWidget, public Ui::seeding { void propertiesSelection(); void deleteTorrent(QString hash); void showPropertiesFromHash(QString hash); + void loadLastSortedColumn(); signals: void torrentMovedFromFinishedList(QString); diff --git a/src/GUI.cpp b/src/GUI.cpp index f129c1c2b..39b074dea 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -166,6 +166,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis configureSession(true); // Resume unfinished torrents BTSession->resumeUnfinishedTorrents(); + downloadingTorrentTab->loadLastSortedColumn(); + finishedTorrentTab->loadLastSortedColumn(); // Add torrent given on command line processParams(torrentCmdLine); // Initialize Web UI diff --git a/src/downloadingTorrents.cpp b/src/downloadingTorrents.cpp index 336ee8345..2ff5840bc 100644 --- a/src/downloadingTorrents.cpp +++ b/src/downloadingTorrents.cpp @@ -617,7 +617,6 @@ void DownloadingTorrents::addTorrent(QString hash) { } ++nbTorrents; emit unfinishedTorrentsNumberChanged(nbTorrents); - sortDownloadList(); } void DownloadingTorrents::sortDownloadListFloat(int index, Qt::SortOrder sortOrder) { @@ -773,7 +772,6 @@ bool DownloadingTorrents::loadColWidthDLList() { for(unsigned int i=0; iheader()->resizeSection(i, width_list.at(i).toInt()); } - loadLastSortedColumn(); qDebug("Download list columns width loaded"); return true; } @@ -823,7 +821,6 @@ void DownloadingTorrents::torrentAdded(QTorrentHandle& h) { } ++nbTorrents; emit unfinishedTorrentsNumberChanged(nbTorrents); - sortDownloadList(); } void DownloadingTorrents::updateFileSizeAndProgress(QString hash) { diff --git a/src/downloadingTorrents.h b/src/downloadingTorrents.h index e1511df45..01f4190f2 100644 --- a/src/downloadingTorrents.h +++ b/src/downloadingTorrents.h @@ -84,7 +84,6 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{ void hideOrShowColumnRatio(); void hideOrShowColumnEta(); void hideOrShowColumnPriority(); - void loadLastSortedColumn(); void forceRecheck(); public slots: @@ -97,6 +96,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{ void showPropertiesFromHash(QString hash); void hidePriorityColumn(bool hide); void sortProgressColumn(QString hash); + void loadLastSortedColumn(); };