This moves the crash handler installation during the OCC::Application
contruction. This still leaves a window where crashes wouldn't be
caught, leaving the QtSingleApplication and theme initialization
code unreported, but isn't requiring any refactoring for now.
Issue #2952
#include <windows.h>
#endif
+#if defined(WITH_CRASHREPORTER)
+#include <libcrashreporter-handler/Handler.h>
+#endif
+
#include <QTranslator>
#include <QMenu>
#include <QMessageBox>
if (isRunning())
return;
+#if defined(WITH_CRASHREPORTER)
+ if (ConfigFile().crashReporter())
+ _crashHandler.reset(new CrashReporter::Handler( QDir::tempPath(), true, CRASHREPORTER_EXECUTABLE ));
+#endif
+
setupLogging();
setupTranslations();
class QSystemTrayIcon;
class QSocket;
+namespace CrashReporter {
+class Handler;
+}
+
namespace OCC {
class Theme;
class Folder;
QTimer _checkConnectionTimer;
+#if defined(WITH_CRASHREPORTER)
+ QScopedPointer<CrashReporter::Handler> _crashHandler;
+#endif
QScopedPointer<FolderMan> _folderManager;
friend class ownCloudGui; // for _startupNetworkError
#include "updater/updater.h"
-
-#include "config.h"
-#ifdef WITH_CRASHREPORTER
- #include "configfile.h"
- #include <libcrashreporter-handler/Handler.h>
-#endif
-
#include <QTimer>
#include <QMessageBox>
#endif
OCC::Application app(argc, argv);
-
-#ifdef WITH_CRASHREPORTER
- if (ConfigFile().crashReporter())
- new CrashReporter::Handler( QDir::tempPath(), true, CRASHREPORTER_EXECUTABLE );
-#endif
-
#ifndef Q_OS_WIN
signal(SIGPIPE, SIG_IGN);
#endif