diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-11 18:36:08 +0100 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-11 18:36:08 +0100 |
| commit | 341c38a31f4bde9a2f016b4d58a11b8beb2bae5a (patch) | |
| tree | 3dddaf559db4695c11edd09b7da6e9d77c2ca51c | |
| parent | a154e7d4f9d83d9ebae794c195190caef0cc1269 (diff) | |
Implemented adding App by opening .pbw file
| -rw-r--r-- | app/pebble.cpp | 15 | ||||
| -rw-r--r-- | daemon/daemon.cpp | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/app/pebble.cpp b/app/pebble.cpp index 41da080..6f5d605 100644 --- a/app/pebble.cpp +++ b/app/pebble.cpp @@ -38,6 +38,21 @@ int main(int argc, char *argv[]) { QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv)); + app->setApplicationName("pebble"); + app->setOrganizationName(""); + + for (int i = 1; i < argc; i++) { + if (QString(argv[i]).endsWith(".pbw", Qt::CaseInsensitive)) { + QDir dataDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation)); + if (dataDir.mkpath("apps")) { + QFile pbw(argv[i]); + QFileInfo dst(pbw); + dst.setFile(dataDir.absoluteFilePath("apps"), dst.fileName()); + QFile(dst.filePath()).remove(); + pbw.copy(dst.filePath()); + } + } + } qmlRegisterUncreatableType<PebbledInterface>("org.pebbled", 0, 1, "PebbledInterface", "Please use pebbled context property"); diff --git a/daemon/daemon.cpp b/daemon/daemon.cpp index b645eba..85af751 100644 --- a/daemon/daemon.cpp +++ b/daemon/daemon.cpp @@ -48,6 +48,7 @@ int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); app.setApplicationName("pebble"); // Use the same appname as the UI. + app.setOrganizationName(""); QStringList filterRules; |
