diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-11 21:26:02 +0100 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-11 21:26:02 +0100 |
| commit | f0e644896d34c4c354a978788cbb461db653484b (patch) | |
| tree | 31086457b3a8f7c30e94e20a287914dcdb3d3c95 /app/pebbledinterface.cpp | |
| parent | 341c38a31f4bde9a2f016b4d58a11b8beb2bae5a (diff) | |
Implemented "Add App file" dialog
Diffstat (limited to 'app/pebbledinterface.cpp')
| -rw-r--r-- | app/pebbledinterface.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/pebbledinterface.cpp b/app/pebbledinterface.cpp index cc9a617..b30af28 100644 --- a/app/pebbledinterface.cpp +++ b/app/pebbledinterface.cpp @@ -170,6 +170,22 @@ void PebbledInterface::reconnect() watch->Reconnect(); } +bool PebbledInterface::registerAppFile(const QString& filePath) +{ + if (filePath.endsWith(".pbw", Qt::CaseInsensitive)) { + QDir dataDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation)); + if (dataDir.mkpath("apps")) { + QFile pbw(filePath); + QFileInfo dst(pbw); + dst.setFile(dataDir.absoluteFilePath("apps"), dst.fileName()); + QFile(dst.filePath()).remove(); + return pbw.copy(dst.filePath()); + } + } + + return false; +} + QUrl PebbledInterface::configureApp(const QString &uuid) { qDebug() << Q_FUNC_INFO << uuid; |
