aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
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 /mobile-widgets
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 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 4a15f26e0..33376656b 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -32,6 +32,8 @@
#include "qt-models/tankinfomodel.h"
#include "core/downloadfromdcthread.h"
+#include "core/ssrf.h"
+
QMLManager *QMLManager::m_instance = NULL;
#define RED_FONT QLatin1Literal("<font color=\"red\">")
@@ -138,6 +140,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
alreadySaving(false),
m_device_data(new DCDeviceData(this))
{
+ LOG_STP("qmlmgr starting");
m_instance = this;
m_lastDevicePixelRatio = qApp->devicePixelRatio();
timer.start();
@@ -164,6 +167,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
+ " at " + QDateTime::currentDateTime().toString());
}
#endif
+ LOG_STP("qmlmgr log started");
set_error_cb(&showErrorFromC);
appendTextToLog("Starting " + getUserAgent());
appendTextToLog(QStringLiteral("built with libdivecomputer v%1").arg(dc_version(NULL)));
@@ -172,11 +176,13 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
git_libgit2_version(&git_maj, &git_min, &git_rev);
appendTextToLog(QStringLiteral("built with libgit2 %1.%2.%3").arg(git_maj).arg(git_min).arg(git_rev));
setStartPageText(tr("Starting..."));
+ LOG_STP("qmlmgr start page");
// ensure that we start the BTDiscovery - this should be triggered by the export of the class
// to QML, but that doesn't seem to always work
BTDiscovery *btDiscovery = BTDiscovery::instance();
m_btEnabled = btDiscovery->btAvailable();
+ LOG_STP("qmlmgr bt available");
connect(&btDiscovery->localBtDevice, &QBluetoothLocalDevice::hostModeStateChanged,
this, &QMLManager::btHostModeChange);
setShowPin(false);
@@ -185,10 +191,13 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
progress_callback = &progressCallback;
connect(locationProvider, SIGNAL(haveSourceChanged()), this, SLOT(hasLocationSourceChanged()));
setLocationServiceAvailable(locationProvider->hasLocationsSource());
+ LOG_STP("qmlmgr gps started");
set_git_update_cb(&gitProgressCB);
+ LOG_STP("qmlmgr git update");
// make sure we know if the current cloud repo has been successfully synced
syncLoadFromCloud();
+ LOG_STP("qmlmgr sync load cloud");
}
void QMLManager::applicationStateChanged(Qt::ApplicationState state)
@@ -352,6 +361,7 @@ void QMLManager::copyAppLogToClipboard()
QTextStream in(&f);
copyString += in.readAll();
}
+ LOG_STP_CLIPBOARD(&copyString);
copyString += "---------- finish ----------\n";
// and copy to clipboard