Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--CMakeLists.txt6
-rw-r--r--config.h.in1
m---------src/3rdparty/libcrashreporter-qt0
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/crashreporter/CMakeLists.txt45
-rw-r--r--src/crashreporter/CrashReporterConfig.h.in12
-rw-r--r--src/crashreporter/main.cpp84
-rw-r--r--src/crashreporter/resources.qrc5
-rw-r--r--src/gui/CMakeLists.txt9
-rw-r--r--src/gui/main.cpp10
11 files changed, 180 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
index ffec18175..ba3b7388b 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -7,3 +7,6 @@
[submodule "binary"]
path = binary
url = git://github.com/owncloud/owncloud-client-binary.git
+[submodule "src/3rdparty/libcrashreporter-qt"]
+ path = src/3rdparty/libcrashreporter-qt
+ url = git://github.com/dschmidt/libcrashreporter-qt.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 00a5afce3..56c749a7e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,6 +94,12 @@ if(OWNCLOUD_5XX_NO_BLACKLIST)
add_definitions(-DOWNCLOUD_5XX_NO_BLACKLIST=1)
endif()
+option(WITH_CRASHREPORTER "Build the crash reporter" ON)
+IF( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/libcrashreporter-qt/CMakeLists.txt")
+ message(STATUS "Build of crashreporter disabled.")
+ SET(WITH_CRASHREPORTER OFF)
+ENDIF()
+
#### find libs
#find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtTest QtWebkit REQUIRED )
#if( UNIX AND NOT APPLE ) # Fdo notifications
diff --git a/config.h.in b/config.h.in
index d739a212a..56c776800 100644
--- a/config.h.in
+++ b/config.h.in
@@ -3,6 +3,7 @@
#cmakedefine USE_INOTIFY 1
#cmakedefine WITH_QTKEYCHAIN 1
+#cmakedefine WITH_CRASHREPORTER
#cmakedefine GIT_SHA1 "@GIT_SHA1@"
#cmakedefine APPLICATION_DOMAIN @APPLICATION_DOMAIN@
diff --git a/src/3rdparty/libcrashreporter-qt b/src/3rdparty/libcrashreporter-qt
new file mode 160000
+Subproject 9bac9c15b474ab03d0ba80d89ff126ce20a9dff
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 094d08372..ff039b1a7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,6 +7,11 @@ add_subdirectory(libsync)
if (NOT BUILD_LIBRARIES_ONLY)
add_subdirectory(gui)
add_subdirectory(cmd)
+
+ if (WITH_CRASHREPORTER)
+ add_subdirectory(3rdparty/libcrashreporter-qt)
+ add_subdirectory(crashreporter)
+ endif()
endif(NOT BUILD_LIBRARIES_ONLY)
find_program(KRAZY2_EXECUTABLE krazy2)
diff --git a/src/crashreporter/CMakeLists.txt b/src/crashreporter/CMakeLists.txt
new file mode 100644
index 000000000..c96fcb507
--- /dev/null
+++ b/src/crashreporter/CMakeLists.txt
@@ -0,0 +1,45 @@
+PROJECT( CrashReporter )
+cmake_policy(SET CMP0017 NEW)
+
+list(APPEND crashreporter_SOURCES main.cpp)
+list(APPEND crashreporter_RC resources.qrc)
+
+qt_wrap_ui( crashreporter_UI_HEADERS ${crashreporter_UI} )
+qt_add_resources( crashreporter_RC_RCC ${crashreporter_RC} )
+
+
+# TODO: differentiate release channel
+# if(BUILD_RELEASE)
+# set(CRASHREPORTER_RELEASE_CHANNEL "release")
+# else()
+ set(CRASHREPORTER_RELEASE_CHANNEL "nightly")
+# endif()
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CrashReporterConfig.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/CrashReporterConfig.h)
+
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+# ../../libtomahawk
+# ../../thirdparty/libcrashreporter-qt/src
+#)
+
+add_executable( owncloud_crash_reporter WIN32
+ ${crashreporter_SOURCES}
+ ${crashreporter_HEADERS_MOC}
+ ${crashreporter_UI_HEADERS}
+ ${crashreporter_RC_RCC}
+)
+
+
+target_link_libraries(owncloud_crash_reporter
+ crashreporter-gui
+ ${QT_LIBRARIES}
+)
+
+#TODO: don't use automoc :-(
+set_target_properties(owncloud_crash_reporter PROPERTIES AUTOMOC ON)
+set_target_properties(owncloud_crash_reporter PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
+install(TARGETS owncloud_crash_reporter RUNTIME DESTINATION ${LIBEXEC_INSTALL_DIR})
+
+qt5_use_modules(owncloud_crash_reporter Widgets Network)
diff --git a/src/crashreporter/CrashReporterConfig.h.in b/src/crashreporter/CrashReporterConfig.h.in
new file mode 100644
index 000000000..a20095172
--- /dev/null
+++ b/src/crashreporter/CrashReporterConfig.h.in
@@ -0,0 +1,12 @@
+#ifndef CRASHREPORTERCONFIG_H
+#define CRASHREPORTERCONFIG_H
+
+#define CRASHREPORTER_BUILD_ID "@CMAKE_DATESTAMP_YEAR@@CMAKE_DATESTAMP_MONTH@@CMAKE_DATESTAMP_DAY@000000"
+
+#define CRASHREPORTER_RELEASE_CHANNEL "@CRASHREPORTER_RELEASE_CHANNEL@"
+
+#define CRASHREPORTER_PRODUCT_NAME "ownCloud Client"
+
+#define CRASHREPORTER_VERSION_STRING "@MIRALL_VERSION_STRING@"
+
+#endif // CRASHREPORTERCONFIG_H
diff --git a/src/crashreporter/main.cpp b/src/crashreporter/main.cpp
new file mode 100644
index 000000000..84a4cde3e
--- /dev/null
+++ b/src/crashreporter/main.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) by Dominik Schmidt <domme@tomahawk-player.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#include "../3rdparty/libcrashreporter-qt/src/libcrashreporter-gui/CrashReporter.h"
+
+#include "CrashReporterConfig.h"
+
+#include <QApplication>
+#include <QDebug>
+
+int main( int argc, char* argv[] )
+{
+ QApplication app( argc, argv );
+
+ if ( app.arguments().size() != 2 )
+ {
+ qDebug() << "You need to pass the .dmp file path as only argument";
+ return 1;
+ }
+
+ // TODO: install socorro ....
+ CrashReporter reporter( QUrl( "http://crash-reports.tomahawk-player.org/submit" ), app.arguments() );
+
+ reporter.setLogo(QPixmap(":/owncloud-icon.png"));
+ reporter.setWindowTitle(CRASHREPORTER_PRODUCT_NAME);
+ reporter.setText("<html><head/><body><p><span style=\" font-weight:600;\">Sorry!</span> " CRASHREPORTER_PRODUCT_NAME " crashed. Please tell us about it! " CRASHREPORTER_PRODUCT_NAME " has created an error report for you that can help improve the stability in the future. You can now send this report directly to the " CRASHREPORTER_PRODUCT_NAME " developers.</p></body></html>");
+
+ reporter.setReportData( "BuildID", CRASHREPORTER_BUILD_ID );
+ reporter.setReportData( "ProductName", CRASHREPORTER_PRODUCT_NAME );
+ reporter.setReportData( "Version", CRASHREPORTER_VERSION_STRING );
+ reporter.setReportData( "ReleaseChannel", CRASHREPORTER_RELEASE_CHANNEL);
+
+ //reporter.setReportData( "timestamp", QByteArray::number( QDateTime::currentDateTime().toTime_t() ) );
+
+
+ // add parameters
+
+ // << Pair("InstallTime", "1357622062")
+ // << Pair("Theme", "classic/1.0")
+ // << Pair("Version", "30")
+ // << Pair("id", "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}")
+ // << Pair("Vendor", "Mozilla")
+ // << Pair("EMCheckCompatibility", "true")
+ // << Pair("Throttleable", "0")
+ // << Pair("URL", "http://code.google.com/p/crashme/")
+ // << Pair("version", "20.0a1")
+ // << Pair("CrashTime", "1357770042")
+ // << Pair("submitted_timestamp", "2013-01-09T22:21:18.646733+00:00")
+ // << Pair("buildid", "20130107030932")
+ // << Pair("timestamp", "1357770078.646789")
+ // << Pair("Notes", "OpenGL: NVIDIA Corporation -- GeForce 8600M GT/PCIe/SSE2 -- 3.3.0 NVIDIA 313.09 -- texture_from_pixmap\r\n")
+ // << Pair("StartupTime", "1357769913")
+ // << Pair("FramePoisonSize", "4096")
+ // << Pair("FramePoisonBase", "7ffffffff0dea000")
+ // << Pair("Add-ons", "%7B972ce4c6-7e08-4474-a285-3208198ce6fd%7D:20.0a1,crashme%40ted.mielczarek.org:0.4")
+ // << Pair("SecondsSinceLastCrash", "1831736")
+ // << Pair("ProductName", "WaterWolf")
+ // << Pair("legacy_processing", "0")
+ // << Pair("ProductID", "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}")
+
+ ;
+
+ // TODO:
+ // send log
+// QFile logFile( INSERT_FILE_PATH_HERE );
+// logFile.open( QFile::ReadOnly );
+// reporter.setReportData( "upload_file_miralllog", qCompress( logFile.readAll() ), "application/x-gzip", QFileInfo( INSERT_FILE_PATH_HERE ).fileName().toUtf8());
+// logFile.close();
+
+ reporter.show();
+
+ return app.exec();
+}
diff --git a/src/crashreporter/resources.qrc b/src/crashreporter/resources.qrc
new file mode 100644
index 000000000..830281e77
--- /dev/null
+++ b/src/crashreporter/resources.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file alias="owncloud-icon.png">../../theme/colored/owncloud-icon-128.png</file>
+ </qresource>
+</RCC>
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 08022a073..9923af809 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -227,6 +227,15 @@ target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} )
target_link_libraries( ${APPLICATION_EXECUTABLE} updater )
target_link_libraries( ${APPLICATION_EXECUTABLE} ${OS_SPECIFIC_LINK_LIBRARIES} )
+if(WITH_CRASHREPORTER)
+ target_link_libraries( ${APPLICATION_EXECUTABLE} crashreporter-handler)
+
+ if(UNIX AND NOT MAC)
+ find_package(Threads REQUIRED)
+ target_link_libraries( ${APPLICATION_EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT})
+ endif()
+endif()
+
install(TARGETS ${APPLICATION_EXECUTABLE}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
diff --git a/src/gui/main.cpp b/src/gui/main.cpp
index 8b7921859..1df5f2a37 100644
--- a/src/gui/main.cpp
+++ b/src/gui/main.cpp
@@ -28,6 +28,10 @@
#include "updater/updater.h"
+#ifdef WITH_CRASHREPORTER
+ #include "../3rdparty/libcrashreporter-qt/src/libcrashreporter-handler/Handler.h"
+#endif
+
#include <QTimer>
#include <QMessageBox>
@@ -51,6 +55,12 @@ int main(int argc, char **argv)
Mac::CocoaInitializer cocoaInit; // RIIA
#endif
Mirall::Application app(argc, argv);
+
+
+#ifdef WITH_CRASHREPORTER
+ new CrashReporter::Handler( QDir::tempPath(), true, "owncloud_crash_reporter" );
+#endif
+
#ifndef Q_OS_WIN
signal(SIGPIPE, SIG_IGN);
#endif