From 7887fa9a2e31510cabda6b19844dfe2440a6df91 Mon Sep 17 00:00:00 2001 From: JunjieBai Date: Wed, 5 Jun 2024 09:08:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=E6=9B=B4=E6=96=B0=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E6=90=9C=E7=B4=A2=E6=B7=BB=E5=8A=A0=E5=88=B0=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=A0=8F=E4=BB=BB=E5=8A=A1=E6=A0=8F=E6=97=B6=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84dbus=E6=8E=A5=E5=8F=A3.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libsearch/appsearch/app-search-plugin.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/libsearch/appsearch/app-search-plugin.cpp b/libsearch/appsearch/app-search-plugin.cpp index b9e4189..2bf9d10 100644 --- a/libsearch/appsearch/app-search-plugin.cpp +++ b/libsearch/appsearch/app-search-plugin.cpp @@ -320,19 +320,23 @@ bool AppSearchPlugin::launch(const QString &path) bool AppSearchPlugin::addPanelShortcut(const QString& path) { DataCollecter::collectLaunchEvent(QStringLiteral("applicationSearch"), QStringLiteral("addPanelShortcut")); - QDBusInterface iface("com.ukui.panel.desktop", - "/", - "com.ukui.panel.desktop", + QDBusInterface iface("org.ukui.taskManager", + "/taskManager", + "org.ukui.taskManager", QDBusConnection::sessionBus()); if(iface.isValid()) { - QDBusReply isExist = iface.call("CheckIfExist", path); - if(isExist) { + QDBusReply isExist = iface.call("checkQuickLauncher", path); + if (isExist) { qWarning() << "Add shortcut to panel failed, because it is already existed!"; return false; } - QDBusReply ret = iface.call("AddToTaskbar", path); - qDebug() << "Add shortcut to panel successed!"; - return true; + QDBusReply ret = iface.call("addQuickLauncher", path); + if (ret.isValid()) { + qDebug() << "Add shortcut to taskManager successed!"; + return true; + } else { + qWarning() << "Fail to add shortcut to taskManager!"; + } } return false; }