forked from qt-creator/qt-creator
Python: Hide some internals from PythonRunConfiguration API
Change-Id: Ibed21265bf7099b06ea61751fb487b78e8071f34 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -136,13 +136,14 @@ public:
|
|||||||
const Utils::FilePath &python,
|
const Utils::FilePath &python,
|
||||||
const QString &requestedPackageName);
|
const QString &requestedPackageName);
|
||||||
void updateExtraCompilers();
|
void updateExtraCompilers();
|
||||||
|
void currentInterpreterChanged();
|
||||||
|
|
||||||
Utils::FilePath m_pySideUicPath;
|
Utils::FilePath m_pySideUicPath;
|
||||||
|
|
||||||
PythonRunConfiguration *q;
|
PythonRunConfiguration *q;
|
||||||
QList<PySideUicExtraCompiler *> m_extraCompilers;
|
QList<PySideUicExtraCompiler *> m_extraCompilers;
|
||||||
QFutureWatcher<PipPackageInfo> m_watcher;
|
QFutureWatcher<PipPackageInfo> m_watcher;
|
||||||
QMetaObject::Connection m_watcherConnection;
|
QMetaObject::Connection m_watcherConnection;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id)
|
PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id)
|
||||||
@@ -153,8 +154,8 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id)
|
|||||||
interpreterAspect->setSettingsKey("PythonEditor.RunConfiguation.Interpreter");
|
interpreterAspect->setSettingsKey("PythonEditor.RunConfiguation.Interpreter");
|
||||||
interpreterAspect->setSettingsDialogId(Constants::C_PYTHONOPTIONS_PAGE_ID);
|
interpreterAspect->setSettingsDialogId(Constants::C_PYTHONOPTIONS_PAGE_ID);
|
||||||
|
|
||||||
connect(interpreterAspect, &InterpreterAspect::changed,
|
connect(interpreterAspect, &InterpreterAspect::changed, this,
|
||||||
this, &PythonRunConfiguration::currentInterpreterChanged);
|
[this] { d->currentInterpreterChanged(); });
|
||||||
|
|
||||||
connect(PythonSettings::instance(), &PythonSettings::interpretersChanged,
|
connect(PythonSettings::instance(), &PythonSettings::interpretersChanged,
|
||||||
interpreterAspect, &InterpreterAspect::updateInterpreters);
|
interpreterAspect, &InterpreterAspect::updateInterpreters);
|
||||||
@@ -219,7 +220,7 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Id id)
|
|||||||
|
|
||||||
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
|
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
|
||||||
connect(target, &Target::buildSystemUpdated, this, [this]() { d->updateExtraCompilers(); });
|
connect(target, &Target::buildSystemUpdated, this, [this]() { d->updateExtraCompilers(); });
|
||||||
currentInterpreterChanged();
|
d->currentInterpreterChanged();
|
||||||
|
|
||||||
connect(PySideInstaller::instance(), &PySideInstaller::pySideInstalled, this,
|
connect(PySideInstaller::instance(), &PySideInstaller::pySideInstalled, this,
|
||||||
[this](const FilePath &python) {
|
[this](const FilePath &python) {
|
||||||
@@ -307,12 +308,12 @@ void PythonRunConfigurationPrivate::handlePySidePackageInfo(const PipPackageInfo
|
|||||||
pySideBuildStep->updatePySideProjectPath(pythonTools.pySideProjectPath);
|
pySideBuildStep->updatePySideProjectPath(pythonTools.pySideProjectPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PythonRunConfiguration::currentInterpreterChanged()
|
void PythonRunConfigurationPrivate::currentInterpreterChanged()
|
||||||
{
|
{
|
||||||
const FilePath python = aspect<InterpreterAspect>()->currentInterpreter().command;
|
const FilePath python = q->aspect<InterpreterAspect>()->currentInterpreter().command;
|
||||||
d->checkForPySide(python);
|
checkForPySide(python);
|
||||||
|
|
||||||
for (FilePath &file : project()->files(Project::AllFiles)) {
|
for (FilePath &file : q->project()->files(Project::AllFiles)) {
|
||||||
if (auto document = TextEditor::TextDocument::textDocumentForFilePath(file)) {
|
if (auto document = TextEditor::TextDocument::textDocumentForFilePath(file)) {
|
||||||
if (document->mimeType() == Constants::C_PY_MIMETYPE
|
if (document->mimeType() == Constants::C_PY_MIMETYPE
|
||||||
|| document->mimeType() == Constants::C_PY3_MIMETYPE) {
|
|| document->mimeType() == Constants::C_PY3_MIMETYPE) {
|
||||||
|
|||||||
@@ -14,10 +14,11 @@ class PySideUicExtraCompiler;
|
|||||||
class PythonRunConfiguration : public ProjectExplorer::RunConfiguration
|
class PythonRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PythonRunConfiguration(ProjectExplorer::Target *target, Utils::Id id);
|
PythonRunConfiguration(ProjectExplorer::Target *target, Utils::Id id);
|
||||||
~PythonRunConfiguration() override;
|
~PythonRunConfiguration() override;
|
||||||
void currentInterpreterChanged();
|
|
||||||
QList<PySideUicExtraCompiler *> extraCompilers() const;
|
QList<PySideUicExtraCompiler *> extraCompilers() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user