Promote previously python-specific InterpreterAspect

... and drop PythonRunConfiguration, which is a plain RunConfiguration now.

Change-Id: I540cb738180fc1424f730d6d1998886915ce527b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2022-04-13 12:26:54 +02:00
parent 9a6d8aebe7
commit 28cfdf388a
16 changed files with 327 additions and 339 deletions

View File

@@ -25,6 +25,8 @@
#pragma once
#include <projectexplorer/runconfigurationaspects.h>
#include <utils/fileutils.h>
#include <utils/optional.h>
@@ -33,35 +35,14 @@
namespace Python {
namespace Internal {
class Interpreter
{
public:
Interpreter() = default;
Interpreter(const Utils::FilePath &python,
const QString &defaultName,
bool windowedSuffix = false);
Interpreter(const QString &id,
const QString &name,
const Utils::FilePath &command,
bool autoDetected = true);
inline bool operator==(const Interpreter &other) const
{
return id == other.id && name == other.name && command == other.command;
}
QString id = QUuid::createUuid().toString();
QString name;
Utils::FilePath command;
bool autoDetected = true;
};
class PythonSettings : public QObject
{
Q_OBJECT
public:
static void init();
using Interpreter = ProjectExplorer::Interpreter;
static QList<Interpreter> interpreters();
static Interpreter defaultInterpreter();
static Interpreter interpreter(const QString &interpreterId);