fix(frontend):更新应用搜索添加到任务栏任务栏时使用的dbus接口.
This commit is contained in:
parent
6dfa46df54
commit
b9b41c7ccd
|
@ -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<bool> isExist = iface.call("CheckIfExist", path);
|
||||
if(isExist) {
|
||||
QDBusReply<bool> isExist = iface.call("checkQuickLauncher", path);
|
||||
if (isExist) {
|
||||
qWarning() << "Add shortcut to panel failed, because it is already existed!";
|
||||
return false;
|
||||
}
|
||||
QDBusReply<QVariant> ret = iface.call("AddToTaskbar", path);
|
||||
qDebug() << "Add shortcut to panel successed!";
|
||||
QDBusReply<QVariant> 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue