2018-08-29 22:45:19 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2017-present, Status Research and Development GmbH.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlContext>
|
|
|
|
#include <QQuickView>
|
|
|
|
|
|
|
|
#include "reportpublisher.h"
|
|
|
|
|
|
|
|
const int MAIN_WINDOW_WIDTH = 1024;
|
|
|
|
const int MAIN_WINDOW_HEIGHT = 768;
|
2018-09-06 16:51:49 +00:00
|
|
|
const int INPUT_ARGUMENTS_COUNT = 6;
|
|
|
|
|
|
|
|
const int MINIDUMP_FILE_PATH_ARG_INDEX = 1;
|
|
|
|
const int CRASHED_EXECUTABLE_PATH_ARG_INDEX = 2;
|
|
|
|
const int LOGS_PATH_INDEX = 5;
|
2018-08-29 22:45:19 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
|
|
|
|
if (argc != INPUT_ARGUMENTS_COUNT) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
app.setApplicationName("Crash Report");
|
|
|
|
|
2018-09-06 16:51:49 +00:00
|
|
|
ReportPublisher reportPublisher(argv[MINIDUMP_FILE_PATH_ARG_INDEX],
|
|
|
|
argv[CRASHED_EXECUTABLE_PATH_ARG_INDEX],
|
|
|
|
argv[LOGS_PATH_INDEX]);
|
2018-08-29 22:45:19 +00:00
|
|
|
|
|
|
|
QQuickView view;
|
|
|
|
view.rootContext()->setContextProperty("reportPublisher", &reportPublisher);
|
|
|
|
view.setSource(QUrl("qrc:///main.qml"));
|
|
|
|
view.setResizeMode(QQuickView::SizeRootObjectToView);
|
|
|
|
view.resize(MAIN_WINDOW_WIDTH, MAIN_WINDOW_HEIGHT);
|
|
|
|
view.show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|