mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Merge pull request #434 from Gelmir/session_end
Attempt to fix data loss during session end v2
This commit is contained in:
commit
14bfc4f4ed
@ -103,7 +103,7 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
|
|||||||
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
|
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
|
||||||
displaySpeedInTitle = pref.speedInTitleBar();
|
displaySpeedInTitle = pref.speedInTitleBar();
|
||||||
// Clean exit on log out
|
// Clean exit on log out
|
||||||
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
|
connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()), Qt::DirectConnection);
|
||||||
// Setting icons
|
// Setting icons
|
||||||
#if defined(Q_WS_X11)
|
#if defined(Q_WS_X11)
|
||||||
if (Preferences().useSystemIconTheme())
|
if (Preferences().useSystemIconTheme())
|
||||||
@ -334,8 +334,6 @@ void MainWindow::deleteBTSession() {
|
|||||||
m_pwr->setActivityState(false);
|
m_pwr->setActivityState(false);
|
||||||
// Save window size, columns size
|
// Save window size, columns size
|
||||||
writeSettings();
|
writeSettings();
|
||||||
// Accept exit
|
|
||||||
qApp->exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
@ -42,6 +42,7 @@ QtSingleApplication(id, argc, argv)
|
|||||||
void SessionApplication::commitData(QSessionManager & manager) {
|
void SessionApplication::commitData(QSessionManager & manager) {
|
||||||
Q_UNUSED(manager);
|
Q_UNUSED(manager);
|
||||||
emit sessionIsShuttingDown();
|
emit sessionIsShuttingDown();
|
||||||
|
manager.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SessionApplication::notify(QObject* receiver, QEvent* event) {
|
bool SessionApplication::notify(QObject* receiver, QEvent* event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user