mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 22:14:32 +00:00
- Use QCoreApplication instead of QApplication when GUI is disabled
This commit is contained in:
parent
af166f53d3
commit
c7ccf39abf
13
src/main.cpp
13
src/main.cpp
@ -28,12 +28,12 @@
|
|||||||
* Contact : chris@qbittorrent.org
|
* Contact : chris@qbittorrent.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
|
#include <QApplication>
|
||||||
#include <QSplashScreen>
|
#include <QSplashScreen>
|
||||||
#include <QPlastiqueStyle>
|
#include <QPlastiqueStyle>
|
||||||
#include "qgnomelook.h"
|
#include "qgnomelook.h"
|
||||||
@ -48,6 +48,7 @@
|
|||||||
#include "GUI.h"
|
#include "GUI.h"
|
||||||
#include "ico.h"
|
#include "ico.h"
|
||||||
#else
|
#else
|
||||||
|
#include <QCoreApplication>
|
||||||
#include "headlessloader.h"
|
#include "headlessloader.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -64,7 +65,11 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
QApplication *app;
|
#ifdef DISABLE_GUI
|
||||||
|
QCoreApplication *app;
|
||||||
|
#else
|
||||||
|
QApplication *app;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef Q_WS_WIN
|
#ifndef Q_WS_WIN
|
||||||
void sigtermHandler(int) {
|
void sigtermHandler(int) {
|
||||||
@ -188,7 +193,11 @@ int main(int argc, char *argv[]){
|
|||||||
localSocket.close();
|
localSocket.close();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#ifdef DISABLE_GUI
|
||||||
|
app = new QCoreApplication(argc, argv);
|
||||||
|
#else
|
||||||
app = new QApplication(argc, argv);
|
app = new QApplication(argc, argv);
|
||||||
|
#endif
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
useStyle(app, settings.value("Preferences/General/Style", 0).toInt());
|
useStyle(app, settings.value("Preferences/General/Style", 0).toInt());
|
||||||
app->setStyleSheet("QStatusBar::item { border-width: 0; }");
|
app->setStyleSheet("QStatusBar::item { border-width: 0; }");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user