feat: AM 默认程序迁移

默认程序迁移到AM中

Log: 默认程序迁移到AM
Task: https://pms.uniontech.com/task-view-140029.html
Influence: 默认程序
Change-Id: I0824c503b6ab844f09b3bf3cf740565b1e4215e5
This commit is contained in:
echengqi
2022-06-15 14:14:43 +08:00
parent 2b00b9b291
commit dfa232bb98
31 changed files with 1907 additions and 66 deletions

43
src/lib/terminalinfo.h Normal file
View File

@ -0,0 +1,43 @@
#ifndef TERMINALINFO_H
#define TERMINALINFO_H
#include "appinfo.h"
#include <memory>
#include <vector>
#include <map>
#include <QGSettings>
class TerminalInfo
{
public:
static TerminalInfo& getInstanceTerminal();
void resetTerminal();
std::string getPresetTerminalPath();
bool setDefaultTerminal(std::string id);
std::shared_ptr<AppInfoManger> getDefaultTerminal();
std::vector<std::shared_ptr<AppInfoManger>> getTerminalInfos();
TerminalInfo(const TerminalInfo& term) = delete;
TerminalInfo& operator=(const TerminalInfo& term) = delete;
private:
TerminalInfo();
void init();
bool isTerminalApp(std::shared_ptr<AppInfoManger> appInfo);
private:
std::vector<std::string> termBlackList;
std::map<std::string, std::string> execArgMap;
std::vector<std::string> terms;
const std::string gsSchemaDefaultTerminal;
const std::string gsKeyExec;
const std::string gsKeyExecArg;
const std::string gsKeyAppId;
const std::string categoryTerminalEmulator;
const std::string execXTerminalEmulator;
std::shared_ptr<QGSettings> defaultTerminal;
};
#endif // TERMINALINFO_H