diff options
Diffstat (limited to 'src/salmeta.cpp')
-rw-r--r-- | src/salmeta.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/salmeta.cpp b/src/salmeta.cpp index c4bcb0c..f13cd64 100644 --- a/src/salmeta.cpp +++ b/src/salmeta.cpp @@ -2,9 +2,10 @@ #include <sailfishapp.h> #include "controller.h" +#include "watchviewitem.h" static bool launch_daemon = false; -static QString settings_key_prefix; +static QString settings_key_prefix("/apps/salmeta/watch0"); int main(int argc, char *argv[]) { @@ -24,16 +25,15 @@ int main(int argc, char *argv[]) ++it; } - if (launch_daemon) { - if (settings_key_prefix.isEmpty()) { - settings_key_prefix = "/apps/salmeta/watch0"; - } + qmlRegisterType<WatchViewItem>("com.javispedro.salmeta", 1, 0, "WatchView"); + if (launch_daemon) { qDebug() << "Starting salmeta (daemon) with settings from" << settings_key_prefix; new Controller(settings_key_prefix, SailfishApp::createView()); } else { QQuickView *view = SailfishApp::createView(); + view->rootContext()->setContextProperty("settingsPrefix", settings_key_prefix); view->setSource(SailfishApp::pathTo("qml/salmeta.qml")); view->show(); } |