[Pkg-owncloud-commits] [owncloud-client] 143/164: Install the crash handler earlier during startup

Sandro Knauß hefee-guest at moszumanska.debian.org
Sun Mar 22 11:57:06 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit e93c1ccb73f787c6e7e13f39ef965f2b5bc3ba22
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date:   Thu Mar 12 16:49:47 2015 +0100

    Install the crash handler earlier during startup
    
    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
---
 src/gui/application.cpp |  9 +++++++++
 src/gui/application.h   |  7 +++++++
 src/gui/main.cpp        | 13 -------------
 3 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/src/gui/application.cpp b/src/gui/application.cpp
index 734f7f1..eb2fac6 100644
--- a/src/gui/application.cpp
+++ b/src/gui/application.cpp
@@ -42,6 +42,10 @@
 #include <windows.h>
 #endif
 
+#if defined(WITH_CRASHREPORTER)
+#include <libcrashreporter-handler/Handler.h>
+#endif
+
 #include <QTranslator>
 #include <QMenu>
 #include <QMessageBox>
@@ -106,6 +110,11 @@ Application::Application(int &argc, char **argv) :
     if (isRunning())
         return;
 
+#if defined(WITH_CRASHREPORTER)
+    if (ConfigFile().crashReporter())
+        _crashHandler.reset(new CrashReporter::Handler( QDir::tempPath(), true, CRASHREPORTER_EXECUTABLE ));
+#endif
+
     setupLogging();
     setupTranslations();
 
diff --git a/src/gui/application.h b/src/gui/application.h
index 411eb9a..90fee10 100644
--- a/src/gui/application.h
+++ b/src/gui/application.h
@@ -34,6 +34,10 @@ class QMessageBox;
 class QSystemTrayIcon;
 class QSocket;
 
+namespace CrashReporter {
+class Handler;
+}
+
 namespace OCC {
 class Theme;
 class Folder;
@@ -109,6 +113,9 @@ private:
 
     QTimer _checkConnectionTimer;
 
+#if defined(WITH_CRASHREPORTER)
+    QScopedPointer<CrashReporter::Handler> _crashHandler;
+#endif
     QScopedPointer<FolderMan> _folderManager;
 
     friend class ownCloudGui; // for _startupNetworkError
diff --git a/src/gui/main.cpp b/src/gui/main.cpp
index 812b659..b505fb0 100644
--- a/src/gui/main.cpp
+++ b/src/gui/main.cpp
@@ -28,13 +28,6 @@
 
 #include "updater/updater.h"
 
-
-#include "config.h"
-#ifdef WITH_CRASHREPORTER
-    #include "configfile.h"
-    #include <libcrashreporter-handler/Handler.h>
-#endif
-
 #include <QTimer>
 #include <QMessageBox>
 
@@ -59,12 +52,6 @@ int main(int argc, char **argv)
 #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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list