mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Force write settings to disk before exiting.
This commit is contained in:
parent
423d60cced
commit
f898443e78
3 changed files with 7 additions and 5 deletions
|
@ -41,7 +41,7 @@ class HeadlessLoader: public QObject {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HeadlessLoader(const QStringList &torrentCmdLine) {
|
HeadlessLoader(const QStringList &torrentCmdLine) {
|
||||||
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(deleteBTSession()), Qt::DirectConnection);
|
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(shutdownCleanUp()), Qt::DirectConnection);
|
||||||
Preferences pref;
|
Preferences pref;
|
||||||
// Enable Web UI
|
// Enable Web UI
|
||||||
pref.setWebUiEnabled(true);
|
pref.setWebUiEnabled(true);
|
||||||
|
@ -63,7 +63,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void deleteBTSession() {
|
void shutdownCleanUp() {
|
||||||
|
Preferences().sync();
|
||||||
QBtSession::drop();
|
QBtSession::drop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
|
||||||
setWindowTitle(QString("qBittorrent %1").arg(QString::fromUtf8(VERSION)));
|
setWindowTitle(QString("qBittorrent %1").arg(QString::fromUtf8(VERSION)));
|
||||||
displaySpeedInTitle = pref.speedInTitleBar();
|
displaySpeedInTitle = pref.speedInTitleBar();
|
||||||
// Clean exit on log out
|
// Clean exit on log out
|
||||||
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(deleteBTSession()), Qt::DirectConnection);
|
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(shutdownCleanUp()), Qt::DirectConnection);
|
||||||
// Setting icons
|
// Setting icons
|
||||||
#if defined(Q_WS_X11)
|
#if defined(Q_WS_X11)
|
||||||
if (Preferences().useSystemIconTheme())
|
if (Preferences().useSystemIconTheme())
|
||||||
|
@ -336,7 +336,7 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::deleteBTSession() {
|
void MainWindow::shutdownCleanUp() {
|
||||||
qDebug("GUI destruction");
|
qDebug("GUI destruction");
|
||||||
hide();
|
hide();
|
||||||
guiUpdater->stop();
|
guiUpdater->stop();
|
||||||
|
@ -390,6 +390,7 @@ void MainWindow::deleteBTSession() {
|
||||||
delete switchTransferShortcut;
|
delete switchTransferShortcut;
|
||||||
delete switchRSSShortcut;
|
delete switchRSSShortcut;
|
||||||
IconProvider::drop();
|
IconProvider::drop();
|
||||||
|
Preferences().sync();
|
||||||
qDebug("Finished GUI destruction");
|
qDebug("Finished GUI destruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ public slots:
|
||||||
void downloadFromURLList(const QStringList& urls);
|
void downloadFromURLList(const QStringList& urls);
|
||||||
void updateAltSpeedsBtn(bool alternative);
|
void updateAltSpeedsBtn(bool alternative);
|
||||||
void updateNbTorrents();
|
void updateNbTorrents();
|
||||||
void deleteBTSession();
|
void shutdownCleanUp();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
// GUI related slots
|
// GUI related slots
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue