diff options
author | Dominik Schmidt <domme@tomahawk-player.org> | 2014-08-26 20:07:42 +0400 |
---|---|---|
committer | Dominik Schmidt <domme@tomahawk-player.org> | 2014-08-26 20:15:13 +0400 |
commit | 2b4849a2fae0a38ee646eda53511de38604bb9c8 (patch) | |
tree | a0931472c8d5c0398ade89b48489ada12e959360 /src/crashreporter/main.cpp | |
parent | 17e16f5e79ea3aec6d9161aa591afcba48a34133 (diff) |
Add crash reporter using libcrashreporter-qt
Diffstat (limited to 'src/crashreporter/main.cpp')
-rw-r--r-- | src/crashreporter/main.cpp | 84 |
1 files changed, 84 insertions, 0 deletions
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(); +} |