mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 16:07:23 -06:00
Windows execution fixes (it runs now!)
This commit is contained in:
18
src/main.cpp
18
src/main.cpp
@@ -168,6 +168,13 @@ void useStyle(QApplication *app, QString style){
|
||||
|
||||
// Main
|
||||
int main(int argc, char *argv[]){
|
||||
// Create Application
|
||||
#ifdef DISABLE_GUI
|
||||
app = new QCoreApplication(argc, argv);
|
||||
#else
|
||||
app = new QApplication(argc, argv);
|
||||
#endif
|
||||
|
||||
QString locale;
|
||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||
#ifndef DISABLE_GUI
|
||||
@@ -208,16 +215,10 @@ int main(int argc, char *argv[]){
|
||||
std::cout << "disconnected\n";
|
||||
}
|
||||
localSocket.close();
|
||||
delete app;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Create Application
|
||||
#ifdef DISABLE_GUI
|
||||
app = new QCoreApplication(argc, argv);
|
||||
#else
|
||||
app = new QApplication(argc, argv);
|
||||
#endif
|
||||
|
||||
// Load translation
|
||||
locale = settings.value(QString::fromUtf8("Preferences/General/Locale"), QString()).toString();
|
||||
QTranslator translator;
|
||||
@@ -341,7 +342,10 @@ int main(int argc, char *argv[]){
|
||||
delete loader;
|
||||
#endif
|
||||
qDebug("Deleting app...");
|
||||
#ifndef Q_WS_WIN
|
||||
// XXX: Why does it crash on Windows!?
|
||||
delete app;
|
||||
#endif
|
||||
qDebug("App was deleted! All good.");
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user