From 6fd4a07a3a317909524560201c576e1e7a3ce6f7 Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Mon, 11 May 2015 16:17:09 +0200 Subject: Improved local applications handling - better filter listing local apps in Downloads - option to remove app from local list --- app/pebbledinterface.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/pebbledinterface.cpp') 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()) { -- cgit v1.2.3