forked from openkylin/ukui-menu
添加应用管理器接口
This commit is contained in:
parent
4ab17b5d0c
commit
3f8c573edb
|
@ -615,7 +615,7 @@ void TabletWindow::execApplication(QString desktopfp)
|
||||||
|
|
||||||
if (!g_subProjectCodeName.contains("mavis")
|
if (!g_subProjectCodeName.contains("mavis")
|
||||||
|| (g_subProjectCodeName.contains("mavis") && !QDBusReply<bool>(iface.call("LaunchApp", desktopfp)))) {
|
|| (g_subProjectCodeName.contains("mavis") && !QDBusReply<bool>(iface.call("LaunchApp", desktopfp)))) {
|
||||||
execApp(desktopfp);
|
// execApp(desktopfp);
|
||||||
QString str;
|
QString str;
|
||||||
//打开文件.desktop
|
//打开文件.desktop
|
||||||
GError **error = nullptr;
|
GError **error = nullptr;
|
||||||
|
|
|
@ -710,22 +710,32 @@ bool deleteAppRecord(QString desktopfn)
|
||||||
|
|
||||||
void execApp(QString desktopfp)
|
void execApp(QString desktopfp)
|
||||||
{
|
{
|
||||||
UkuiMenuInterface interface;
|
|
||||||
|
|
||||||
if (interface.checkKreApp(desktopfp)) {
|
QDBusInterface iface("com.kylin.AppManager",
|
||||||
QProcess::startDetached(interface.getAppExec(desktopfp));
|
"/com/kylin/AppManager",
|
||||||
} else {
|
"com.kylin.AppManager",
|
||||||
QString appName = interface.getAppExec(desktopfp);
|
QDBusConnection::sessionBus());
|
||||||
QStringList strList = (appName.replace("\"", "")).split(" ");
|
QDBusReply<bool> res = iface.call("LaunchApp", desktopfp);
|
||||||
|
|
||||||
if (QString(strList.at(0)) == "kmplayer") {
|
if (!res.isValid() || !res) {
|
||||||
QProcess::startDetached(strList.at(0));
|
|
||||||
return;
|
UkuiMenuInterface interface;
|
||||||
|
|
||||||
|
if (interface.checkKreApp(desktopfp)) {
|
||||||
|
QProcess::startDetached(interface.getAppExec(desktopfp));
|
||||||
|
} else {
|
||||||
|
QString appName = interface.getAppExec(desktopfp);
|
||||||
|
QStringList strList = (appName.replace("\"", "")).split(" ");
|
||||||
|
|
||||||
|
if (QString(strList.at(0)) == "kmplayer") {
|
||||||
|
QProcess::startDetached(strList.at(0));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GDesktopAppInfo *desktopAppInfo = g_desktop_app_info_new_from_filename(desktopfp.toLocal8Bit().data());
|
||||||
|
g_app_info_launch(G_APP_INFO(desktopAppInfo), nullptr, nullptr, nullptr);
|
||||||
|
g_object_unref(desktopAppInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
GDesktopAppInfo *desktopAppInfo = g_desktop_app_info_new_from_filename(desktopfp.toLocal8Bit().data());
|
|
||||||
g_app_info_launch(G_APP_INFO(desktopAppInfo), nullptr, nullptr, nullptr);
|
|
||||||
g_object_unref(desktopAppInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QFileInfo fileInfo(desktopfp);
|
QFileInfo fileInfo(desktopfp);
|
||||||
|
|
Loading…
Reference in New Issue