diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-04-19 06:37:13 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-04-27 11:52:48 -0700 |
commit | ea7a7c6b24c749491ee56f99cad118cd4bc7aac7 (patch) | |
tree | 0bc0d0da32c70d3d3b028e89043241d1d3d62f80 | |
parent | 36749b28d90e3200614175afe87dddf2dc81ae75 (diff) | |
download | subsurface-ea7a7c6b24c749491ee56f99cad118cd4bc7aac7.tar.gz |
QML UI: add supported dive computers to log file
In a more compact format than before.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | core/downloadfromdcthread.cpp | 13 | ||||
-rw-r--r-- | core/downloadfromdcthread.h | 1 | ||||
-rw-r--r-- | subsurface-mobile-helper.cpp | 7 |
3 files changed, 16 insertions, 5 deletions
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index 93ed1dd8b..da2140b11 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -148,7 +148,6 @@ void fill_computer_list() productList[vendor].append(product); descriptorLookup[QString(vendor) + QString(product)] = descriptor; - qDebug() << "added supported DC: " << vendor << " " << product; } dc_iterator_free(iterator); Q_FOREACH (QString vendor, vendorList) @@ -181,6 +180,18 @@ void fill_computer_list() qSort(vendorList); } +void show_computer_list() +{ + qDebug() << "Supported dive computers:"; + Q_FOREACH (QString vendor, vendorList) { + QString msg = vendor + ": "; + Q_FOREACH (QString product, productList[vendor]) { + msg += product + ", "; + } + msg.chop(2); + qDebug() << msg; + } +} DCDeviceData *DCDeviceData::m_instance = NULL; DCDeviceData::DCDeviceData(QObject *parent) : QObject(parent) diff --git a/core/downloadfromdcthread.h b/core/downloadfromdcthread.h index e95cb7a98..ac83790e8 100644 --- a/core/downloadfromdcthread.h +++ b/core/downloadfromdcthread.h @@ -103,6 +103,7 @@ struct mydescriptor { * stay like this for now. */ void fill_computer_list(); +void show_computer_list(); extern QStringList vendorList; extern QHash<QString, QStringList> productList; extern QMap<QString, dc_descriptor_t *> descriptorLookup; diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp index 9bff8b680..ac971104d 100644 --- a/subsurface-mobile-helper.cpp +++ b/subsurface-mobile-helper.cpp @@ -100,10 +100,6 @@ void run_ui() ctxt->setContextProperty("connectionListModel", &connectionListModel); ctxt->setContextProperty("logModel", MessageHandlerModel::self()); - // call again to be able to log - // FIXME - this is redundant - but otherwise they don't end up in the AppLog - fill_computer_list(); - engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml"))); qqWindowObject = engine.rootObjects().value(0); if (!qqWindowObject) { @@ -117,6 +113,9 @@ void run_ui() QScreen *screen = qml_window->screen(); QObject::connect(qml_window, &QQuickWindow::screenChanged, QMLManager::instance(), &QMLManager::screenChanged); QMLManager *manager = QMLManager::instance(); + // now that the log file is initialized... + show_computer_list(); + manager->setDevicePixelRatio(qml_window->devicePixelRatio(), qml_window->screen()); manager->dlSortModel = sortModel; manager->screenChanged(screen); |