feat: 增加RunCommandWithOptions接口
无 Log: 无 Influence: 无 Task: https://pms.uniontech.com/task-view-220801.html Change-Id: Ibeb61119d911e3274c7cd4d39fd0060beefdb518
This commit is contained in:
@ -160,10 +160,10 @@ bool StartManager::launchAppWithOptions(QString desktopFile, uint32_t timestamp,
|
||||
|
||||
bool StartManager::runCommand(QString exe, QStringList args)
|
||||
{
|
||||
return doRunCommandWithOptions(exe, args, QMap<QString, QString>());
|
||||
return doRunCommandWithOptions(exe, args, QVariantMap());
|
||||
}
|
||||
|
||||
bool StartManager::runCommandWithOptions(QString exe, QStringList args, QMap<QString, QString> options)
|
||||
bool StartManager::runCommandWithOptions(QString exe, QStringList args, QVariantMap options)
|
||||
{
|
||||
return doRunCommandWithOptions(exe, args, options);
|
||||
}
|
||||
@ -449,11 +449,11 @@ bool StartManager::launch(DesktopInfo *info, QString cmdLine, uint32_t timestamp
|
||||
return process.startDetached(exec, exeArgs);
|
||||
}
|
||||
|
||||
bool StartManager::doRunCommandWithOptions(QString exe, QStringList args, QMap<QString, QString> options)
|
||||
bool StartManager::doRunCommandWithOptions(QString exe, QStringList args, QVariantMap options)
|
||||
{
|
||||
QProcess process;
|
||||
if (options.find("dir") != options.end()) {
|
||||
process.setWorkingDirectory(options["dir"]);
|
||||
process.setWorkingDirectory(options["dir"].toString());
|
||||
}
|
||||
|
||||
return process.startDetached(exe, args);
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
bool launchAppAction(QString desktopFile, QString actionSection, uint32_t timestamp);
|
||||
bool launchAppWithOptions(QString desktopFile, uint32_t timestamp, QStringList files, QVariantMap options);
|
||||
bool runCommand(QString exe, QStringList args);
|
||||
bool runCommandWithOptions(QString exe, QStringList args, QMap<QString, QString> options);
|
||||
bool runCommandWithOptions(QString exe, QStringList args, QVariantMap options);
|
||||
|
||||
Q_SIGNALS:
|
||||
void autostartChanged(const QString &status, const QString &fileName);
|
||||
@ -61,7 +61,7 @@ private:
|
||||
bool doLaunchAppWithOptions(const QString &desktopFile);
|
||||
bool doLaunchAppWithOptions(QString desktopFile, uint32_t timestamp, QStringList files, QVariantMap options);
|
||||
bool launch(DesktopInfo *info, QString cmdLine, uint32_t timestamp, QStringList files);
|
||||
bool doRunCommandWithOptions(QString exe, QStringList args, QMap<QString, QString> options);
|
||||
bool doRunCommandWithOptions(QString exe, QStringList args, QVariantMap options);
|
||||
void waitCmd(DesktopInfo *info, QProcess *process, QString cmdName);
|
||||
bool shouldUseProxy(QString appId);
|
||||
bool shouldDisableScaling(QString appId);
|
||||
|
Reference in New Issue
Block a user