mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Windows execution fixes
This commit is contained in:
parent
58a36f7cfd
commit
338d4fd31e
11 changed files with 164 additions and 53 deletions
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue