Browse Source

Attempt to fix data loss during session end

adaptive-webui-19844
Nick Tiskov 12 years ago
parent
commit
28df59b9e6
  1. 4
      src/mainwindow.cpp
  2. 1
      src/sessionapplication.cpp

4
src/mainwindow.cpp

@ -103,7 +103,7 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa @@ -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)));
displaySpeedInTitle = pref.speedInTitleBar();
// 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
#if defined(Q_WS_X11)
if (Preferences().useSystemIconTheme())
@ -334,8 +334,6 @@ void MainWindow::deleteBTSession() { @@ -334,8 +334,6 @@ void MainWindow::deleteBTSession() {
m_pwr->setActivityState(false);
// Save window size, columns size
writeSettings();
// Accept exit
qApp->exit();
}
// Destructor

1
src/sessionapplication.cpp

@ -42,6 +42,7 @@ QtSingleApplication(id, argc, argv) @@ -42,6 +42,7 @@ QtSingleApplication(id, argc, argv)
void SessionApplication::commitData(QSessionManager & manager) {
Q_UNUSED(manager);
emit sessionIsShuttingDown();
manager.release();
}
bool SessionApplication::notify(QObject* receiver, QEvent* event) {

Loading…
Cancel
Save