From cc0e6b342079d45d400dec6d8737dd6030de3224 Mon Sep 17 00:00:00 2001 From: Alexis Lopez Zubieta Date: Mon, 5 Aug 2019 19:13:36 -0500 Subject: [PATCH 1/5] Set target application name as the helper application name --- src/bin/CMakeLists.txt | 1 + src/bin/TargetDataLoader.cpp | 28 ++++++++++++++++++++++++++++ src/bin/TargetDataLoader.h | 17 +++++++++++++++++ src/bin/main.cpp | 6 ++++++ 4 files changed, 52 insertions(+) create mode 100644 src/bin/TargetDataLoader.cpp create mode 100644 src/bin/TargetDataLoader.h diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index e268051..6eee6a3 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -5,6 +5,7 @@ add_executable( RemoveJob.cpp InstallJob.cpp UninstallJob.cpp + TargetDataLoader.cpp ) target_link_libraries(plasma-appimage-integration appimageservices-interfaces KF5::KIOWidgets KF5::I18n KF5::Notifications) diff --git a/src/bin/TargetDataLoader.cpp b/src/bin/TargetDataLoader.cpp new file mode 100644 index 0000000..25a9bc5 --- /dev/null +++ b/src/bin/TargetDataLoader.cpp @@ -0,0 +1,28 @@ +// libraries +#include +#include + +// local +#include "InspectorInterface.h" +#include "TargetDataLoader.h" + +TargetDataLoader::TargetDataLoader(QString target) : target(std::move(target)) {} + +void TargetDataLoader::loadTargetDataIntoApplication() { + auto inspectorInterface = new OrgAppimageServices1InspectorInterface("org.appimage.Services1.Inspector", + "/org/appimage/Services1/Inspector", + QDBusConnection::sessionBus(), this); + auto reply = inspectorInterface->getApplicationInfo(target); + if (reply.isError()) + qWarning() << "Unable to fetch AppImage information " << reply.error().message(); + + else { + QString response = reply.value(); + QJsonDocument document = QJsonDocument::fromJson(response.toLocal8Bit()); + QJsonObject root = document.object(); + + QString nameValue = root.value("name").toString(); + if (!nameValue.isEmpty()) + QApplication::setApplicationName(nameValue); + } +} diff --git a/src/bin/TargetDataLoader.h b/src/bin/TargetDataLoader.h new file mode 100644 index 0000000..997be58 --- /dev/null +++ b/src/bin/TargetDataLoader.h @@ -0,0 +1,17 @@ +#pragma once + +// libraries +#include +#include + +class TargetDataLoader : public QObject { +Q_OBJECT +public: + TargetDataLoader(QString target); + + void loadTargetDataIntoApplication(); + +private: + QString target; + +}; \ No newline at end of file diff --git a/src/bin/main.cpp b/src/bin/main.cpp index 22b809c..e293fcd 100644 --- a/src/bin/main.cpp +++ b/src/bin/main.cpp @@ -13,6 +13,7 @@ #include "RemoveJob.h" #include "InstallJob.h" #include "UninstallJob.h" +#include "TargetDataLoader.h" QString parseTarget(QCommandLineParser& parser) { @@ -90,21 +91,26 @@ int main(int argc, char** argv) { if (command == "update") { QString target = parseTarget(parser); + TargetDataLoader(target).loadTargetDataIntoApplication(); executeUpdateCommand(target); } if (command == "remove") { QString target = parseTarget(parser); + TargetDataLoader(target).loadTargetDataIntoApplication(); executeRemoveCommand(target); } if (command == "install") { QString target = parseTarget(parser); + TargetDataLoader(target).loadTargetDataIntoApplication(); + executeInstallCommand(target); } if (command == "uninstall") { QString target = parseTarget(parser); + TargetDataLoader(target).loadTargetDataIntoApplication(); executeUninstallCommand(target); } return QApplication::exec(); -- GitLab From ebb4a5914fc92b29a7b26593ad92d9e86604944e Mon Sep 17 00:00:00 2001 From: Alexis Lopez Zubieta Date: Tue, 6 Aug 2019 11:40:17 -0500 Subject: [PATCH 2/5] Set target application icon as the helper application icon --- .../org.appimage.Services.Inspector.xml | 5 ++ src/bin/RemoveJob.cpp | 16 +++-- src/bin/TargetDataLoader.cpp | 57 ++++++++++++++- src/bin/TargetDataLoader.h | 10 ++- src/bin/main.cpp | 69 ++++++------------- 5 files changed, 99 insertions(+), 58 deletions(-) diff --git a/src/appimageservices-interface/org.appimage.Services.Inspector.xml b/src/appimageservices-interface/org.appimage.Services.Inspector.xml index ee9bf4a..93b4f93 100644 --- a/src/appimageservices-interface/org.appimage.Services.Inspector.xml +++ b/src/appimageservices-interface/org.appimage.Services.Inspector.xml @@ -5,6 +5,11 @@ + + + + + diff --git a/src/bin/RemoveJob.cpp b/src/bin/RemoveJob.cpp index 04268f0..2bdbdd9 100644 --- a/src/bin/RemoveJob.cpp +++ b/src/bin/RemoveJob.cpp @@ -6,16 +6,18 @@ #include "LauncherInterface.h" RemoveJob::RemoveJob(const QString& target, QObject* parent) - : KJob(parent), target(target), - launcherInterface(new OrgAppimageServices1LauncherInterface("org.appimage.Services1.Launcher", - "/org/appimage/Services1/Launcher", - QDBusConnection::sessionBus(), this)) {} + : KJob(parent), target(target), + launcherInterface(new OrgAppimageServices1LauncherInterface("org.appimage.Services1.Launcher", + "/org/appimage/Services1/Launcher", + QDBusConnection::sessionBus(), this)) {} void RemoveJob::start() { + description(this, i18n("Removing launcher entry")); + auto reply = launcherInterface->unregisterApp(target); if (reply.isError()) { setError(-1); - setErrorText(i18n("Remove failed: %0").arg(reply.error().message())); + setErrorText(reply.error().message()); } QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(reply, this); @@ -26,9 +28,9 @@ void RemoveJob::start() { void RemoveJob::callFinishedSlot(QDBusPendingCallWatcher* watcher) { if (watcher->isError()) { setError(-1); - setErrorText(i18n("Remove failed: %0").arg(watcher->error().message())); + setErrorText(watcher->error().message()); } else - description(this, i18n("Application successfully removed")); + infoMessage(this, i18n("Application successfully removed")); // notify result delayed QTimer::singleShot(1000, this, &RemoveJob::emitResult); diff --git a/src/bin/TargetDataLoader.cpp b/src/bin/TargetDataLoader.cpp index 25a9bc5..0dbcad8 100644 --- a/src/bin/TargetDataLoader.cpp +++ b/src/bin/TargetDataLoader.cpp @@ -1,17 +1,22 @@ // libraries +#include #include -#include // local #include "InspectorInterface.h" #include "TargetDataLoader.h" -TargetDataLoader::TargetDataLoader(QString target) : target(std::move(target)) {} +TargetDataLoader::TargetDataLoader(QString target, QObject* parent) : QObject(parent), target(std::move(target)) {} void TargetDataLoader::loadTargetDataIntoApplication() { auto inspectorInterface = new OrgAppimageServices1InspectorInterface("org.appimage.Services1.Inspector", "/org/appimage/Services1/Inspector", QDBusConnection::sessionBus(), this); + loadApplicationIcon(inspectorInterface); + loadApplicationName(inspectorInterface); +} + +void TargetDataLoader::loadApplicationName(OrgAppimageServices1InspectorInterface* inspectorInterface) const { auto reply = inspectorInterface->getApplicationInfo(target); if (reply.isError()) qWarning() << "Unable to fetch AppImage information " << reply.error().message(); @@ -26,3 +31,51 @@ void TargetDataLoader::loadTargetDataIntoApplication() { QApplication::setApplicationName(nameValue); } } + +void TargetDataLoader::loadApplicationIcon(OrgAppimageServices1InspectorInterface* inspectorInterface) { + QTemporaryFile temporaryIconFile("XXXXXX"); + if (temporaryIconFile.open()) { + auto reply = inspectorInterface->extractApplicationIcon(target, temporaryIconFile.fileName()); + if (reply.isError()) + qWarning() << "Unable to fetch AppImage icon " << reply.error().message(); + + QString themeIconName = "application-vnd.appimage"; + QImage applicationIcon(temporaryIconFile.fileName()); + if (!applicationIcon.isNull()) { + // scale the icon to a valid icon size + applicationIcon = applicationIcon.scaled(512, 512, Qt::KeepAspectRatio); + + // prepare target dir + QString dirPath = QDir::homePath() + "/.local/share/icons/hicolor/%1x%1/apps/"; + dirPath = dirPath.arg(applicationIcon.height()); + QDir::home().mkpath(dirPath); + + // prepare file name + QFileInfo temporaryIconFileInfo(temporaryIconFile); + QString fileName = "plasma-appimage-integration_%2.png"; + fileName = fileName.arg(temporaryIconFileInfo.baseName()); + + // save the icon to the right place on the hicolor theme to make it accessible from the kjob dialog + temporaryAppIconPath = dirPath + fileName; + if (applicationIcon.save(temporaryAppIconPath, "PNG")) { + // use the temporary created icon + themeIconName = "plasma-appimage-integration_" + temporaryIconFileInfo.baseName(); + } else { + qWarning() << "unable so save icon to " << temporaryAppIconPath; + } + } + + // double check that the icon was properly registered in the theme before using it + if (QIcon::hasThemeIcon(themeIconName)) { + QApplication::setWindowIcon(QIcon::fromTheme(themeIconName)); + } else { + qDebug() << "Icon not found in theme " << themeIconName; + QApplication::setWindowIcon(QIcon::fromTheme("application-vnd.appimage")); + } + } +} + +TargetDataLoader::~TargetDataLoader() { + if (QFile::exists(temporaryAppIconPath)) + QFile::remove(temporaryAppIconPath); +} diff --git a/src/bin/TargetDataLoader.h b/src/bin/TargetDataLoader.h index 997be58..7953703 100644 --- a/src/bin/TargetDataLoader.h +++ b/src/bin/TargetDataLoader.h @@ -4,14 +4,22 @@ #include #include +class OrgAppimageServices1InspectorInterface; + class TargetDataLoader : public QObject { Q_OBJECT public: - TargetDataLoader(QString target); + explicit TargetDataLoader(QString target, QObject* parent = nullptr); + + ~TargetDataLoader() override; void loadTargetDataIntoApplication(); private: QString target; + QString temporaryAppIconPath; + + void loadApplicationIcon(OrgAppimageServices1InspectorInterface* inspectorInterface); + void loadApplicationName(OrgAppimageServices1InspectorInterface* inspectorInterface) const; }; \ No newline at end of file diff --git a/src/bin/main.cpp b/src/bin/main.cpp index e293fcd..d4af305 100644 --- a/src/bin/main.cpp +++ b/src/bin/main.cpp @@ -33,41 +33,6 @@ QString parseTarget(QCommandLineParser& parser) { } } -void executeUpdateCommand(const QString& target) { - KJob* job = new UpdateJob(target); - - KIO::getJobTracker()->registerJob(job); - job->start(); - - if (job->error() != 0) - UpdateJob::notifyError(i18n("Update failed").arg(target), job->errorString()); -} - -void executeRemoveCommand(const QString& target) { - KJob* job = new RemoveJob(target); - - KIO::getJobTracker()->registerJob(job); - job->start(); - - if (job->error() != 0) - UpdateJob::notifyError(i18n("Remove failed").arg(target), job->errorString()); - -} - -void executeInstallCommand(const QString& target) { - KJob* job = new InstallJob(target); - - KIO::getJobTracker()->registerJob(job); - job->start(); -} - -void executeUninstallCommand(const QString& target) { - KJob* job = new UninstallJob(target); - - KIO::getJobTracker()->registerJob(job); - job->start(); -} - int main(int argc, char** argv) { QApplication app(argc, argv); QApplication::setApplicationName("plasma-appimage-integration"); @@ -89,30 +54,38 @@ int main(int argc, char** argv) { const QString& command = positionalArguments.at(0); + QString target; + KJob* job = nullptr; if (command == "update") { - QString target = parseTarget(parser); - TargetDataLoader(target).loadTargetDataIntoApplication(); - executeUpdateCommand(target); + target = parseTarget(parser); + job = new UpdateJob(target); } if (command == "remove") { - QString target = parseTarget(parser); - TargetDataLoader(target).loadTargetDataIntoApplication(); - executeRemoveCommand(target); + target = parseTarget(parser); + job = new RemoveJob(target); } if (command == "install") { - QString target = parseTarget(parser); - TargetDataLoader(target).loadTargetDataIntoApplication(); - - executeInstallCommand(target); + target = parseTarget(parser); + job = new InstallJob(target); } if (command == "uninstall") { - QString target = parseTarget(parser); - TargetDataLoader(target).loadTargetDataIntoApplication(); - executeUninstallCommand(target); + target = parseTarget(parser); + job = new UninstallJob(target); } + + if (!target.isEmpty()) { + auto targetDataLoader = new TargetDataLoader(target, &app); + targetDataLoader->loadTargetDataIntoApplication(); + } + + if (job != nullptr) { + KIO::getJobTracker()->registerJob(job); + QMetaObject::invokeMethod(job, "start"); + } + return QApplication::exec(); } -- GitLab From bb370a6f7bfff4aff067828c5a298b143e8a2053 Mon Sep 17 00:00:00 2001 From: Alexis Lopez Zubieta Date: Tue, 6 Aug 2019 11:50:09 -0500 Subject: [PATCH 3/5] Improve progress messages --- src/bin/InstallJob.cpp | 4 ++-- src/bin/RemoveJob.cpp | 5 +++-- src/bin/UninstallJob.cpp | 6 ++++-- src/bin/UpdateJob.cpp | 23 ++++++----------------- src/bin/UpdateJob.h | 2 -- 5 files changed, 15 insertions(+), 25 deletions(-) diff --git a/src/bin/InstallJob.cpp b/src/bin/InstallJob.cpp index 171c73c..6bee3e7 100644 --- a/src/bin/InstallJob.cpp +++ b/src/bin/InstallJob.cpp @@ -15,8 +15,8 @@ void InstallJob::start() { qDebug() << "calling pkexec appimage-services install " << target; connect(&process, SIGNAL(finished(int)), this, SLOT(onProcessFinished(int))); - description(this, i18n("Installing Application"), - qMakePair(i18nc("The AppImage being installed", "Source"), target)); + description(this, i18n("Installing application"), + qMakePair(i18nc("The AppImage being installed", "Application"), target)); process.start(); } diff --git a/src/bin/RemoveJob.cpp b/src/bin/RemoveJob.cpp index 2bdbdd9..383fbcf 100644 --- a/src/bin/RemoveJob.cpp +++ b/src/bin/RemoveJob.cpp @@ -12,7 +12,8 @@ RemoveJob::RemoveJob(const QString& target, QObject* parent) QDBusConnection::sessionBus(), this)) {} void RemoveJob::start() { - description(this, i18n("Removing launcher entry")); + description(this, i18n("Removing launcher entry"), + qMakePair(i18nc("Target AppImage", "Application"), target)); auto reply = launcherInterface->unregisterApp(target); if (reply.isError()) { @@ -30,7 +31,7 @@ void RemoveJob::callFinishedSlot(QDBusPendingCallWatcher* watcher) { setError(-1); setErrorText(watcher->error().message()); } else - infoMessage(this, i18n("Application successfully removed")); + infoMessage(this, i18n("Entry removed")); // notify result delayed QTimer::singleShot(1000, this, &RemoveJob::emitResult); diff --git a/src/bin/UninstallJob.cpp b/src/bin/UninstallJob.cpp index 4b9ffd6..fc81325 100644 --- a/src/bin/UninstallJob.cpp +++ b/src/bin/UninstallJob.cpp @@ -15,8 +15,8 @@ void UninstallJob::start() { qDebug() << "calling pkexec appimage-services install " << target; connect(&process, SIGNAL(finished(int)), this, SLOT(onProcessFinished(int))); - description(this, i18n("Uninstalling Application"), - qMakePair(i18nc("The AppImage being uninstalled", "Source"), target)); + description(this, i18n("Uninstalling application"), + qMakePair(i18nc("The AppImage being uninstalled", "Application"), target)); process.start(); } @@ -27,6 +27,8 @@ void UninstallJob::onProcessFinished(int exitCode) { if (exitCode != 0) { setError(exitCode); setErrorText(process.readAllStandardError()); + } else { + infoMessage(this, i18n("Application uninstalled")); } // notify result delayed diff --git a/src/bin/UpdateJob.cpp b/src/bin/UpdateJob.cpp index c3d26f2..cdbfb05 100644 --- a/src/bin/UpdateJob.cpp +++ b/src/bin/UpdateJob.cpp @@ -1,6 +1,4 @@ // libraries -#include -#include #include #include #include @@ -25,16 +23,13 @@ void UpdateJob::onBytesReceivedChanged(int value) { void UpdateJob::onStateChanged(int state) { switch (state) { case 10: - description(this, i18nc("Job heading, like 'Copying'", "Reading update data"), - qMakePair(i18nc("The AppImage being updated", "Source"), target)); + infoMessage(this, i18nc("Job heading, like 'Copying'", "Reading update data")); break; case 20: - description(this, i18nc("Job heading, like 'Copying'", "Looking for updates"), - qMakePair(i18nc("The AppImage being updated", "Source"), target)); + infoMessage(this, i18nc("Job heading, like 'Copying'", "Looking for updates")); break; case 30: - description(this, i18nc("Job heading, like 'Copying'", "Downloading"), - qMakePair(i18nc("The AppImage being updated", "Source"), target)); + infoMessage(this, i18nc("Job heading, like 'Copying'", "Downloading update")); break; // final states case 21: @@ -58,6 +53,9 @@ bool UpdateJob::doKill() { } void UpdateJob::start() { + description(this, i18nc("Job heading, like 'Copying'", "Updating application"), + qMakePair(i18nc("The AppImage being updated", "Application"), target)); + if (error() == 0) connectUpdaterInterface(); @@ -146,15 +144,6 @@ void UpdateJob::onError(int errorCode) { setErrorText(errorTitle); } -void UpdateJob::notifyError(const QString& title, const QString& message, QWidget* parentWidget) { - KNotification* notify = new KNotification(QStringLiteral("notification"), parentWidget, - KNotification::CloseOnTimeout | KNotification::DefaultEvent); - notify->setTitle(title); - notify->setText(message); - notify->setIconName("dialog-warning"); - notify->sendEvent(); -} - void UpdateJob::emitResultDelayed() { QTimer::singleShot(400, [this]() { emitResult(); diff --git a/src/bin/UpdateJob.h b/src/bin/UpdateJob.h index 79f09c4..a9a7a72 100644 --- a/src/bin/UpdateJob.h +++ b/src/bin/UpdateJob.h @@ -20,8 +20,6 @@ public: void start() override; - static void notifyError(const QString& title, const QString& message, QWidget* parentWidget = nullptr); - protected slots: void onBytesTotalChanged(int total); -- GitLab From dfa06f3a593b5403c5a1a2202e76552eef8b6927 Mon Sep 17 00:00:00 2001 From: Alexis Lopez Zubieta Date: Tue, 6 Aug 2019 12:02:18 -0500 Subject: [PATCH 4/5] Add register job --- src/bin/CMakeLists.txt | 1 + src/bin/RegisterJob.cpp | 37 +++++++++++++++++++ src/bin/RegisterJob.h | 24 ++++++++++++ src/bin/main.cpp | 6 +++ .../AppImageFileItemActions.cpp | 24 +++--------- 5 files changed, 74 insertions(+), 18 deletions(-) create mode 100644 src/bin/RegisterJob.cpp create mode 100644 src/bin/RegisterJob.h diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index 6eee6a3..305f0cc 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -2,6 +2,7 @@ add_executable( plasma-appimage-integration main.cpp UpdateJob.cpp + RegisterJob.cpp RemoveJob.cpp InstallJob.cpp UninstallJob.cpp diff --git a/src/bin/RegisterJob.cpp b/src/bin/RegisterJob.cpp new file mode 100644 index 0000000..3e05fe3 --- /dev/null +++ b/src/bin/RegisterJob.cpp @@ -0,0 +1,37 @@ +// libraries +#include + +// local +#include "RegisterJob.h" +#include "LauncherInterface.h" + +RegisterJob::RegisterJob(const QString& target, QObject* parent) + : KJob(parent), target(target), + launcherInterface(new OrgAppimageServices1LauncherInterface("org.appimage.Services1.Launcher", + "/org/appimage/Services1/Launcher", + QDBusConnection::sessionBus(), this)) {} + +void RegisterJob::start() { + description(this, i18n("Creating launcher entry"), + qMakePair(i18nc("Target AppImage", "Application"), target)); + + auto reply = launcherInterface->registerApp(target); + if (reply.isError()) { + setError(-1); + setErrorText(reply.error().message()); + } + + auto* watcher = new QDBusPendingCallWatcher(reply, this); + + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, &RegisterJob::callFinishedSlot); +} + +void RegisterJob::callFinishedSlot(QDBusPendingCallWatcher* watcher) { + if (watcher->isError()) { + setError(-1); + setErrorText(watcher->error().message()); + } + + // notify result delayed + QTimer::singleShot(1000, this, &RegisterJob::emitResult); +} diff --git a/src/bin/RegisterJob.h b/src/bin/RegisterJob.h new file mode 100644 index 0000000..6de4b60 --- /dev/null +++ b/src/bin/RegisterJob.h @@ -0,0 +1,24 @@ +#pragma once + +// libraries +#include +#include + +class QDBusPendingCallWatcher; + +class OrgAppimageServices1LauncherInterface; + +class RegisterJob : public KJob { +public: + RegisterJob(const QString& target, QObject* parent = nullptr); + + void start() override; + +protected slots: + + void callFinishedSlot(QDBusPendingCallWatcher* watcher); + +private: + QString target; + OrgAppimageServices1LauncherInterface* launcherInterface; +}; diff --git a/src/bin/main.cpp b/src/bin/main.cpp index d4af305..9744618 100644 --- a/src/bin/main.cpp +++ b/src/bin/main.cpp @@ -10,6 +10,7 @@ // local #include "UpdateJob.h" +#include "RegisterJob.h" #include "RemoveJob.h" #include "InstallJob.h" #include "UninstallJob.h" @@ -66,6 +67,11 @@ int main(int argc, char** argv) { job = new RemoveJob(target); } + if (command == "register") { + target = parseTarget(parser); + job = new RegisterJob(target); + } + if (command == "install") { target = parseTarget(parser); job = new InstallJob(target); diff --git a/src/fileitem-actions/AppImageFileItemActions.cpp b/src/fileitem-actions/AppImageFileItemActions.cpp index 8552cff..789a38c 100644 --- a/src/fileitem-actions/AppImageFileItemActions.cpp +++ b/src/fileitem-actions/AppImageFileItemActions.cpp @@ -94,25 +94,13 @@ QAction *AppImageFileItemActions::createInstallAction(const KFileItemListPropert void AppImageFileItemActions::addToMenu() { const QList urls = sender()->property("urls").value>(); - QWidget* parentWidget = sender()->property("parentWidget").value(); + QString program = "plasma-appimage-integration"; - QList> replies; - for (const QUrl& url : urls) - replies += launcherInterface->registerApp(url.toString()); - - QString errorTitle = i18n("Add to launcher failed"); - for (QDBusPendingReply& reply: replies) { - reply.waitForFinished(); - - if (reply.isError()) - showErrorMessage(errorTitle, reply.error().message(), parentWidget); - else { - // notify failed operation - if (!reply.value()) { - QString url = urls.at(replies.indexOf(reply)).toString(); - showErrorMessage(errorTitle, i18n("\"%0\"\nthe file seems broken").arg(url), parentWidget); - } - } + for (const QUrl& url : urls) { + QStringList arguments; + arguments << "register" << url.toLocalFile(); + + QProcess::startDetached(program, arguments); } } -- GitLab From a1015c666a74bffbd4860a547b1511980e05bec2 Mon Sep 17 00:00:00 2001 From: Alexis Lopez Zubieta Date: Tue, 6 Aug 2019 12:05:50 -0500 Subject: [PATCH 5/5] Use remove helper on the remove file item action --- src/fileitem-actions/AppImageFileItemActions.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/fileitem-actions/AppImageFileItemActions.cpp b/src/fileitem-actions/AppImageFileItemActions.cpp index 789a38c..60094c5 100644 --- a/src/fileitem-actions/AppImageFileItemActions.cpp +++ b/src/fileitem-actions/AppImageFileItemActions.cpp @@ -106,8 +106,14 @@ void AppImageFileItemActions::addToMenu() { void AppImageFileItemActions::removeFromMenu() { const QList urls = sender()->property("urls").value>(); - for (const QUrl& url : urls) - launcherInterface->unregisterApp(url.toString()); + QString program = "plasma-appimage-integration"; + + for (const QUrl& url : urls) { + QStringList arguments; + arguments << "remove" << url.toLocalFile(); + + QProcess::startDetached(program, arguments); + } } void AppImageFileItemActions::update() { -- GitLab