Speedup persistent data

Conflicts:
	src/mainwindow.cpp
	src/mainwindow.h
This commit is contained in:
Ivan Sorokin 2014-11-01 20:41:30 +03:00
parent f2c6981711
commit 70a114eb13
4 changed files with 48 additions and 64 deletions

View file

@ -243,6 +243,11 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine): QMai
preventTimer = new QTimer(this);
connect(preventTimer, SIGNAL(timeout()), SLOT(checkForActiveTorrents()));
// Initialization of persistent data
TorrentPersistentData::load();
connect(&persistentDataSaver, SIGNAL(timeout()), SLOT(savePersistentData()));
persistentDataSaver.start(10000);
// Configure BT session according to options
loadPreferences(false);
@ -459,6 +464,7 @@ void MainWindow::shutdownCleanUp()
QBtSession::drop();
// Save window size, columns size
writeSettings();
TorrentPersistentData::save();
#ifdef Q_OS_MAC
// Workaround to avoid bug http://bugreports.qt.nokia.com/browse/QTBUG-7305
setUnifiedTitleAndToolBarOnMac(false);
@ -1586,6 +1592,11 @@ void MainWindow::handleUpdateCheckFinished(bool update_available, QString new_ve
}
#endif
void MainWindow::savePersistentData()
{
TorrentPersistentData::save();
}
void MainWindow::on_actionDonate_money_triggered()
{
QDesktopServices::openUrl(QUrl("http://sourceforge.net/donate/index.php?group_id=163414"));