fix: 修复设置开机自启动应用重启后失效问题
1. 设置自动启动时未将应用desktop文件写入到~/.config/autostart/目录下 2. 应用自动启动接口优化,确保调用时,接口返回正确。 (设置为自启动时,手动将Hidden字段写入到自启动目录的desktop文件中,并设置为false,只有这样, 安全中心才不会弹出自启动确认窗口, 这种操作是沿用V20阶段的约定规范,这块已经与安全中心研发对接过) Log: Influence: 设置自启动后重启应用也会保持生效 Bug: https://pms.uniontech.com/bug-view-172263.html Bug: https://pms.uniontech.com/bug-view-172281.html Task: https://pms.uniontech.com/task-view-215413.html Change-Id: Idd03ac40850c95ef8cef2ac169cfe006405b809b
This commit is contained in:
@ -246,16 +246,16 @@ QList<QDBusObjectPath> ApplicationManager::GetInstances(const QString& id)
|
||||
return {};
|
||||
}
|
||||
|
||||
bool ApplicationManager::AddAutostart(QString fileName)
|
||||
bool ApplicationManager::AddAutostart(const QString &desktop)
|
||||
{
|
||||
Q_D(ApplicationManager);
|
||||
if (!d->checkDMsgUid())
|
||||
return false;
|
||||
|
||||
return d->startManager->addAutostart(fileName);
|
||||
return d->startManager->addAutostart(desktop);
|
||||
}
|
||||
|
||||
bool ApplicationManager::RemoveAutostart(QString fileName)
|
||||
bool ApplicationManager::RemoveAutostart(const QString &fileName)
|
||||
{
|
||||
Q_D(ApplicationManager);
|
||||
if (!d->checkDMsgUid())
|
||||
@ -273,7 +273,7 @@ QStringList ApplicationManager::AutostartList()
|
||||
return d->startManager->autostartList();
|
||||
}
|
||||
|
||||
bool ApplicationManager::IsAutostart(QString fileName)
|
||||
bool ApplicationManager::IsAutostart(const QString &fileName)
|
||||
{
|
||||
Q_D(ApplicationManager);
|
||||
if (!d->checkDMsgUid())
|
||||
@ -301,7 +301,7 @@ void ApplicationManager::LaunchApp(const QString &desktopFile, uint32_t timestam
|
||||
d->startManager->launchApp(desktopFile, timestamp, files);
|
||||
}
|
||||
|
||||
void ApplicationManager::LaunchAppAction(QString desktopFile, QString action, uint32_t timestamp)
|
||||
void ApplicationManager::LaunchAppAction(const QString &desktopFile, const QString &action, uint32_t timestamp)
|
||||
{
|
||||
Q_D(ApplicationManager);
|
||||
if (!d->checkDMsgUid())
|
||||
|
@ -64,16 +64,16 @@ public:
|
||||
void processInstanceStatus(Methods::ProcessStatus instanceStatus);
|
||||
|
||||
Q_SIGNALS:
|
||||
void AutostartChanged(QString status, QString filePath);
|
||||
void AutostartChanged(const QString &status, const QString &filePath);
|
||||
|
||||
public Q_SLOTS:
|
||||
bool AddAutostart(QString fileName);
|
||||
bool AddAutostart(const QString &desktop);
|
||||
QStringList AutostartList();
|
||||
bool IsAutostart(QString fileName);
|
||||
bool RemoveAutostart(QString fileName);
|
||||
bool IsAutostart(const QString &fileName);
|
||||
bool RemoveAutostart(const QString &fileName);
|
||||
void Launch(const QString &desktopFile);
|
||||
void LaunchApp(const QString &desktopFile, uint32_t timestamp, const QStringList &files);
|
||||
void LaunchAppAction(QString desktopFile, QString action, uint32_t timestamp);
|
||||
void LaunchAppAction(const QString &desktopFile, const QString &action, uint32_t timestamp);
|
||||
|
||||
protected:
|
||||
ApplicationManager(QObject *parent = nullptr);
|
||||
|
Reference in New Issue
Block a user