feat: 实现StartManager功能

实现StartManager功能, 曝露在ApplicationManager服务上

Log: 实现StartManager功能
Task: https://pms.uniontech.com/task-view-130337.html
Influence: 无
Change-Id: I8e83a66f8c25b09e0f4be1e4be9defac95b02b80
This commit is contained in:
weizhixiang
2022-05-15 12:10:42 +08:00
parent 13a1cabda1
commit 08d9f4895b
102 changed files with 2374 additions and 445 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 ~ 2023 Deepin Technology Co., Ltd.
* Copyright (C) 2021 ~ 2022 Deepin Technology Co., Ltd.
*
* Author: weizhixiang <weizhixiang@uniontech.com>
*
@ -254,9 +254,9 @@ bool Launcher::requestSendToDesktop(QString appId)
// 创建桌面快捷方式文件
DesktopInfo dinfo(itemsMap[appId].info.path.toStdString());
dinfo.kf.setKey(MainSection, dbusService.toStdString(), "X-Deepin-CreatedBy");
dinfo.kf.setKey(MainSection, appId.toStdString(), "X-Deepin-AppID");
if (!dinfo.kf.saveToFile(filePath.toStdString()))
dinfo.getKeyFile()->setKey(MainSection, dbusService.toStdString(), "X-Deepin-CreatedBy");
dinfo.getKeyFile()->setKey(MainSection, appId.toStdString(), "X-Deepin-AppID");
if (!dinfo.getKeyFile()->saveToFile(filePath.toStdString()))
return false;
std::thread thread([]() {
@ -824,7 +824,7 @@ AppType Launcher::getAppType(DesktopInfo &info, const Item &item)
QFileInfo fileInfo;
// 判断是否为flatpak应用
do {
if (!info.kf.containKey(MainSection, "X-Flatpak"))
if (!info.getKeyFile()->containKey(MainSection, "X-Flatpak"))
break;
std::vector<std::string> parts = DString::splitStr(info.getCommandLine(), ' ');
@ -863,7 +863,7 @@ AppType Launcher::getAppType(DesktopInfo &info, const Item &item)
// 判断是否为wineApp
do {
std::string createdBy = info.kf.getStr(MainSection, "X-Created-By");
std::string createdBy = info.getKeyFile()->getStr(MainSection, "X-Created-By");
if (DString::startWith(createdBy, "cxoffice-") || strstr(info.getCommandLine().c_str(), "env WINEPREFIX=")) {
ty = AppType::WineApp;
goto end;
@ -1052,10 +1052,10 @@ bool Launcher::isDeepinCustomDesktopFile(QString fileName)
Item Launcher:: NewItemWithDesktopInfo(DesktopInfo &info)
{
QString enName(info.kf.getStr(MainSection, KeyName).c_str());
QString enComment(info.kf.getStr(MainSection, KeyComment).c_str());
QString xDeepinCategory(info.kf.getStr(MainSection, "X-Deepin-Category").c_str());
QString xDeepinVendor(info.kf.getStr(MainSection, "X-Deepin-Vendor").c_str());
QString enName(info.getKeyFile()->getStr(MainSection, KeyName).c_str());
QString enComment(info.getKeyFile()->getStr(MainSection, KeyComment).c_str());
QString xDeepinCategory(info.getKeyFile()->getStr(MainSection, "X-Deepin-Category").c_str());
QString xDeepinVendor(info.getKeyFile()->getStr(MainSection, "X-Deepin-Vendor").c_str());
QString appName;
if (xDeepinVendor == "deepin")