2023-02-23 15:08:08 +08:00
|
|
|
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
2023-02-14 18:13:19 +08:00
|
|
|
//
|
2023-02-23 15:08:08 +08:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-06-15 14:14:43 +08:00
|
|
|
#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
|