2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2022-01-21 14:38:50 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "utils_global.h"
|
|
|
|
|
|
2023-02-07 17:19:01 +01:00
|
|
|
#include "filepath.h"
|
|
|
|
|
|
2022-01-21 14:38:50 +01:00
|
|
|
#include <QMetaType>
|
|
|
|
|
#include <QVector>
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QSettings;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Utils {
|
|
|
|
|
|
|
|
|
|
class Environment;
|
|
|
|
|
|
|
|
|
|
class QTCREATOR_UTILS_EXPORT TerminalCommand
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TerminalCommand() = default;
|
2023-02-07 17:19:01 +01:00
|
|
|
TerminalCommand(const FilePath &command, const QString &openArgs,
|
2022-01-21 14:38:50 +01:00
|
|
|
const QString &executeArgs, bool needsQuotes = false);
|
|
|
|
|
|
|
|
|
|
bool operator==(const TerminalCommand &other) const;
|
|
|
|
|
bool operator<(const TerminalCommand &other) const;
|
|
|
|
|
|
2023-02-07 17:19:01 +01:00
|
|
|
Utils::FilePath command;
|
2022-01-21 14:38:50 +01:00
|
|
|
QString openArgs;
|
|
|
|
|
QString executeArgs;
|
|
|
|
|
bool needsQuotes = false;
|
|
|
|
|
|
|
|
|
|
static void setSettings(QSettings *settings);
|
|
|
|
|
static TerminalCommand defaultTerminalEmulator();
|
|
|
|
|
static QVector<TerminalCommand> availableTerminalEmulators();
|
|
|
|
|
static TerminalCommand terminalEmulator();
|
|
|
|
|
static void setTerminalEmulator(const TerminalCommand &term);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // Utils
|
|
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(Utils::TerminalCommand)
|