mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Clean program exit on system shutdown/logout
This commit is contained in:
parent
129bfac549
commit
1e86ea8c0a
7 changed files with 70 additions and 16 deletions
18
src/main.cpp
18
src/main.cpp
|
@ -38,11 +38,7 @@
|
|||
#include <QStyle>
|
||||
#include <QSplashScreen>
|
||||
#include <QPushButton>
|
||||
#ifdef Q_WS_MAC
|
||||
#include "qmacapplication.h"
|
||||
#else
|
||||
#include "qtsingleapplication.h"
|
||||
#endif
|
||||
#include "sessionapplication.h"
|
||||
#include "GUI.h"
|
||||
#include "ico.h"
|
||||
#else
|
||||
|
@ -160,15 +156,11 @@ void useStyle(QString style){
|
|||
int main(int argc, char *argv[]){
|
||||
// Create Application
|
||||
QString uid = misc::getUserIDString();
|
||||
#ifdef DISABLE_GUI
|
||||
#ifdef DISABLE_GUI
|
||||
QtSingleCoreApplication app("qBittorrent-"+uid, argc, argv);
|
||||
#else
|
||||
#ifndef Q_WS_MAC
|
||||
QtSingleApplication app("qBittorrent-"+uid, argc, argv);
|
||||
#else
|
||||
QMacApplication app("qBittorrent-"+uid, argc, argv);
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
SessionApplication app("qBittorrent-"+uid, argc, argv);
|
||||
#endif
|
||||
|
||||
// Check if qBittorrent is already running for this user
|
||||
if(app.isRunning()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue