Browse Source

should speed up startup

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
8b40e43432
  1. 1
      src/FinishedTorrents.cpp
  2. 2
      src/FinishedTorrents.h
  3. 2
      src/GUI.cpp
  4. 3
      src/downloadingTorrents.cpp
  5. 2
      src/downloadingTorrents.h

1
src/FinishedTorrents.cpp

@ -124,7 +124,6 @@ void FinishedTorrents::addTorrent(QString hash){
// Update the number of finished torrents // Update the number of finished torrents
++nbFinished; ++nbFinished;
emit finishedTorrentsNumberChanged(nbFinished); emit finishedTorrentsNumberChanged(nbFinished);
sortFinishedList();
} }
void FinishedTorrents::torrentAdded(QTorrentHandle& h) { void FinishedTorrents::torrentAdded(QTorrentHandle& h) {

2
src/FinishedTorrents.h

@ -60,7 +60,6 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
void displayFinishedHoSMenu(const QPoint&); void displayFinishedHoSMenu(const QPoint&);
void setRowColor(int row, QString color); void setRowColor(int row, QString color);
void saveColWidthFinishedList() const; void saveColWidthFinishedList() const;
void loadLastSortedColumn();
void toggleFinishedListSortOrder(int index); void toggleFinishedListSortOrder(int index);
void sortFinishedList(int index=-1, Qt::SortOrder sortOrder=Qt::AscendingOrder); void sortFinishedList(int index=-1, Qt::SortOrder sortOrder=Qt::AscendingOrder);
void sortFinishedListFloat(int index, Qt::SortOrder sortOrder); void sortFinishedListFloat(int index, Qt::SortOrder sortOrder);
@ -84,6 +83,7 @@ class FinishedTorrents : public QWidget, public Ui::seeding {
void propertiesSelection(); void propertiesSelection();
void deleteTorrent(QString hash); void deleteTorrent(QString hash);
void showPropertiesFromHash(QString hash); void showPropertiesFromHash(QString hash);
void loadLastSortedColumn();
signals: signals:
void torrentMovedFromFinishedList(QString); void torrentMovedFromFinishedList(QString);

2
src/GUI.cpp

@ -166,6 +166,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
configureSession(true); configureSession(true);
// Resume unfinished torrents // Resume unfinished torrents
BTSession->resumeUnfinishedTorrents(); BTSession->resumeUnfinishedTorrents();
downloadingTorrentTab->loadLastSortedColumn();
finishedTorrentTab->loadLastSortedColumn();
// Add torrent given on command line // Add torrent given on command line
processParams(torrentCmdLine); processParams(torrentCmdLine);
// Initialize Web UI // Initialize Web UI

3
src/downloadingTorrents.cpp

@ -617,7 +617,6 @@ void DownloadingTorrents::addTorrent(QString hash) {
} }
++nbTorrents; ++nbTorrents;
emit unfinishedTorrentsNumberChanged(nbTorrents); emit unfinishedTorrentsNumberChanged(nbTorrents);
sortDownloadList();
} }
void DownloadingTorrents::sortDownloadListFloat(int index, Qt::SortOrder sortOrder) { void DownloadingTorrents::sortDownloadListFloat(int index, Qt::SortOrder sortOrder) {
@ -773,7 +772,6 @@ bool DownloadingTorrents::loadColWidthDLList() {
for(unsigned int i=0; i<listSize; ++i) { for(unsigned int i=0; i<listSize; ++i) {
downloadList->header()->resizeSection(i, width_list.at(i).toInt()); downloadList->header()->resizeSection(i, width_list.at(i).toInt());
} }
loadLastSortedColumn();
qDebug("Download list columns width loaded"); qDebug("Download list columns width loaded");
return true; return true;
} }
@ -823,7 +821,6 @@ void DownloadingTorrents::torrentAdded(QTorrentHandle& h) {
} }
++nbTorrents; ++nbTorrents;
emit unfinishedTorrentsNumberChanged(nbTorrents); emit unfinishedTorrentsNumberChanged(nbTorrents);
sortDownloadList();
} }
void DownloadingTorrents::updateFileSizeAndProgress(QString hash) { void DownloadingTorrents::updateFileSizeAndProgress(QString hash) {

2
src/downloadingTorrents.h

@ -84,7 +84,6 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
void hideOrShowColumnRatio(); void hideOrShowColumnRatio();
void hideOrShowColumnEta(); void hideOrShowColumnEta();
void hideOrShowColumnPriority(); void hideOrShowColumnPriority();
void loadLastSortedColumn();
void forceRecheck(); void forceRecheck();
public slots: public slots:
@ -97,6 +96,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
void showPropertiesFromHash(QString hash); void showPropertiesFromHash(QString hash);
void hidePriorityColumn(bool hide); void hidePriorityColumn(bool hide);
void sortProgressColumn(QString hash); void sortProgressColumn(QString hash);
void loadLastSortedColumn();
}; };

Loading…
Cancel
Save