Windows execution fixes (it runs now!)

This commit is contained in:
Christophe Dumez
2010-05-30 11:36:56 +00:00
parent ec15e8247d
commit 11f79432b5
3 changed files with 32 additions and 27 deletions

View File

@@ -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;
}