aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-mobile-helper.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@libreoffice.org>2018-05-28 16:25:39 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-05-30 21:47:07 -0700
commit76f61468e69020bb42f8b726e78635ec4d4b8a57 (patch)
treec45bc57c3c031ec80e86a6edb5db753cb141a4ae /subsurface-mobile-helper.cpp
parent3963e44404738d3d01d4051094b05f81f0a181e0 (diff)
downloadsubsurface-76f61468e69020bb42f8b726e78635ec4d4b8a57.tar.gz
mobile: add timer to measure startup.
Subsurface-mobile has a long startup time; in order to isolate the problem(s) a timer is added to see where time is "lost". The collected startup times are added to the clipboard together with the other logs, allowing test users to report back. All this is only enabled when compiling with -DENABLE_STARTUP_TIMING Closes #1340 [Dirk Hohndel: collapsed multiple commits and minor white space cleanups, added missing QMutex variable] Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-mobile-helper.cpp')
-rw-r--r--subsurface-mobile-helper.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp
index 38b6be9f4..5fe83acd9 100644
--- a/subsurface-mobile-helper.cpp
+++ b/subsurface-mobile-helper.cpp
@@ -29,6 +29,8 @@
#include "mobile-widgets/qml/kirigami/src/kirigamiplugin.h"
+#include "core/ssrf.h"
+
QObject *qqWindowObject = NULL;
void set_non_bt_addresses() {
@@ -51,6 +53,7 @@ void init_ui()
void run_ui()
{
+ LOG_STP("run_ui starting");
qmlRegisterType<QMLManager>("org.subsurfacedivelog.mobile", 1, 0, "QMLManager");
qmlRegisterType<QMLProfile>("org.subsurfacedivelog.mobile", 1, 0, "QMLProfile");
@@ -63,6 +66,7 @@ void run_ui()
qmlRegisterType<MapLocation>("org.subsurfacedivelog.mobile", 1, 0, "MapLocation");
QQmlApplicationEngine engine;
+ LOG_STP("run_ui qml engine started");
KirigamiPlugin::getInstance().registerTypes();
#if defined(__APPLE__) && !defined(Q_OS_IOS)
// when running the QML UI on a Mac the deployment of the QML Components seems
@@ -79,11 +83,13 @@ void run_ui()
#endif
engine.addImportPath("qrc://imports");
DiveListModel diveListModel;
+ LOG_STP("run_ui diveListModel started");
DiveListSortModel *sortModel = new DiveListSortModel(0);
sortModel->setSourceModel(&diveListModel);
sortModel->setDynamicSortFilter(true);
sortModel->setSortRole(DiveListModel::DiveDateRole);
sortModel->sort(0, Qt::DescendingOrder);
+ LOG_STP("run_ui diveListModel sorted");
GpsListModel gpsListModel;
QSortFilterProxyModel *gpsSortModel = new QSortFilterProxyModel(0);
gpsSortModel->setSourceModel(&gpsListModel);
@@ -95,11 +101,13 @@ void run_ui()
ctxt->setContextProperty("gpsModel", gpsSortModel);
ctxt->setContextProperty("vendorList", vendorList);
set_non_bt_addresses();
+ LOG_STP("run_ui set_non_bt_adresses");
ctxt->setContextProperty("connectionListModel", &connectionListModel);
ctxt->setContextProperty("logModel", MessageHandlerModel::self());
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
+ LOG_STP("run_ui qml loaded");
qqWindowObject = engine.rootObjects().value(0);
if (!qqWindowObject) {
fprintf(stderr, "can't create window object\n");
@@ -112,8 +120,10 @@ void run_ui()
QScreen *screen = qml_window->screen();
QObject::connect(qml_window, &QQuickWindow::screenChanged, QMLManager::instance(), &QMLManager::screenChanged);
QMLManager *manager = QMLManager::instance();
+ LOG_STP("run_ui qmlmanager instance started");
// now that the log file is initialized...
show_computer_list();
+ LOG_STP("run_ui show_computer_list");
manager->setDevicePixelRatio(qml_window->devicePixelRatio(), qml_window->screen());
manager->dlSortModel = sortModel;
@@ -124,6 +134,7 @@ void run_ui()
qml_window->setWidth(800);
#endif
qml_window->show();
+ LOG_STP("run_ui running exec");
qApp->exec();
}