summaryrefslogtreecommitdiff
path: root/app/pebbledinterface.cpp
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2015-05-11 16:17:09 +0200
committerTomasz Sterna <tomek@xiaoka.com>2015-05-11 16:17:09 +0200
commit6fd4a07a3a317909524560201c576e1e7a3ce6f7 (patch)
tree1e11316047bdb6bbe72d76609010a0b967b1a8af /app/pebbledinterface.cpp
parent3f64297af4e7a070b4f62ebf3f17105ee6b0a3a8 (diff)
Improved local applications handling
- better filter listing local apps in Downloads - option to remove app from local list
Diffstat (limited to 'app/pebbledinterface.cpp')
-rw-r--r--app/pebbledinterface.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/pebbledinterface.cpp b/app/pebbledinterface.cpp
index 13535da..84a4ae2 100644
--- a/app/pebbledinterface.cpp
+++ b/app/pebbledinterface.cpp
@@ -215,6 +215,19 @@ bool PebbledInterface::registerAppFile(const QString& filePath)
return false;
}
+bool PebbledInterface::unregisterAppFile(const QString& filePath)
+{
+ if (filePath.endsWith(".pbw", Qt::CaseInsensitive)) {
+ QDir dataDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
+ if (filePath.startsWith(dataDir.absolutePath())) {
+ QFile pbw(filePath);
+ return pbw.remove();
+ }
+ }
+
+ return false;
+}
+
QUrl PebbledInterface::configureApp(const QString &uuid)
{
qDebug() << Q_FUNC_INFO << uuid;
@@ -359,6 +372,7 @@ void PebbledInterface::refreshAllApps()
m.insert("versionLabel", orig.value("version-label"));
m.insert("isWatchface", orig.value("is-watchface"));
m.insert("isConfigurable", orig.value("configurable"));
+ m.insert("path", orig.value("path"));
QByteArray pngIcon = orig.value("menu-icon").toByteArray();
if (!pngIcon.isEmpty()) {