summaryrefslogtreecommitdiff
path: root/src/app/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/main.cpp')
-rw-r--r--src/app/main.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 1e22fe2212..6257e5e367 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -28,6 +28,7 @@
****************************************************************************/
#include "qtsingleapplication.h"
+#include "../tools/qtcreatorcrashhandler/crashhandlersetup.h"
#include <app/app_version.h>
#include <extensionsystem/iplugin.h>
@@ -295,7 +296,7 @@ int main(int argc, char **argv)
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
// QML is unusable with the xlib backend
- QApplication::setGraphicsSystem("raster");
+ QApplication::setGraphicsSystem(QLatin1String("raster"));
#endif
SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, argv);
@@ -303,6 +304,8 @@ int main(int argc, char **argv)
const int threadCount = QThreadPool::globalInstance()->maxThreadCount();
QThreadPool::globalInstance()->setMaxThreadCount(qMax(4, 2 * threadCount));
+ setupCrashHandler(); // Display a backtrace once a serious signal is delivered.
+
#ifdef ENABLE_QT_BREAKPAD
QtSystemExceptionHandler systemExceptionHandler;
#endif
@@ -350,7 +353,7 @@ int main(int argc, char **argv)
#else
uiLanguages << QLocale::system().name();
#endif
- QString overrideLanguage = settings->value("General/OverrideLanguage").toString();
+ QString overrideLanguage = settings->value(QLatin1String("General/OverrideLanguage")).toString();
if (!overrideLanguage.isEmpty())
uiLanguages.prepend(overrideLanguage);
const QString &creatorTrPath = QCoreApplication::applicationDirPath()
@@ -470,7 +473,7 @@ int main(int argc, char **argv)
if (app.isRunning(pid)) {
// Nah app is still running, ask the user
int button = askMsgSendFailed();
- while(button == QMessageBox::Retry) {
+ while (button == QMessageBox::Retry) {
if (app.sendMessage(PluginManager::serializedArguments(), 5000 /*timeout*/, pid))
return 0;
if (!app.isRunning(pid)) // App quit while we were trying so start a new creator
@@ -510,5 +513,7 @@ int main(int argc, char **argv)
QTimer::singleShot(100, &pluginManager, SLOT(startTests()));
#endif
- return app.exec();
+ const int r = app.exec();
+ cleanupCrashHandler();
+ return r;
}