diff options
| author | hjk <hjk@qt.io> | 2024-12-06 14:53:54 +0100 |
|---|---|---|
| committer | hjk <hjk@qt.io> | 2024-12-09 08:58:25 +0000 |
| commit | 5fad41873e1fdf205186ea335e62a2eee64df1b8 (patch) | |
| tree | 101c63069fd97555c4f0d6862a944298eb35ca31 /src/plugins/python/pythonsettings.cpp | |
| parent | 015c1475422c10643995b883b40a243e1f1f95ce (diff) | |
Utils: Add FilePath::isLocal() and use it instead of !needsDevice()
"needsDevice()" is an odd name, but keep it for now until downstream
has caught up.
Change-Id: I1fdb65d55e84e31512edb8f0bea8a0a3f7b2879c
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Diffstat (limited to 'src/plugins/python/pythonsettings.cpp')
| -rw-r--r-- | src/plugins/python/pythonsettings.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index 58e5d11f81b..20eae05906b 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -287,7 +287,7 @@ void InterpreterOptionsWidget::updateCleanButton() void InterpreterOptionsWidget::updateGenerateKitButton(const Interpreter &interpreter) { bool enabled = !KitManager::kit(Id::fromString(interpreter.id)) - && (interpreter.command.needsDevice() || interpreter.command.isExecutableFile()); + && (!interpreter.command.isLocal() || interpreter.command.isExecutableFile()); m_generateKitButton->setEnabled(enabled); } @@ -806,7 +806,7 @@ void PythonSettings::removeKitsForInterpreter(const Interpreter &interpreter) bool PythonSettings::interpreterIsValid(const Interpreter &interpreter) { - return interpreter.command.needsDevice() || interpreter.command.isExecutableFile(); + return !interpreter.command.isLocal() || interpreter.command.isExecutableFile(); } void PythonSettings::setInterpreter(const QList<Interpreter> &interpreters, const QString &defaultId) @@ -1019,7 +1019,7 @@ void PythonSettings::initFromSettings(QtcSettings *settings) const auto keepInterpreter = [](const Interpreter &interpreter) { return !interpreter.autoDetected // always keep user added interpreters - || interpreter.command.needsDevice() // remote devices might not be reachable at startup + || !interpreter.command.isLocal() // remote devices might not be reachable at startup || interpreter.command.isExecutableFile(); }; @@ -1030,7 +1030,7 @@ void PythonSettings::initFromSettings(QtcSettings *settings) for (const Interpreter &interpreter : m_interpreters) { if (interpreter.autoDetected) { const FilePath &cmd = interpreter.command; - if (cmd.needsDevice() || cmd.parentDir().pathAppended("activate").exists()) + if (!cmd.isLocal() || cmd.parentDir().pathAppended("activate").exists()) continue; } addKitsForInterpreter(interpreter, false); @@ -1186,7 +1186,7 @@ Utils::ListModel<ProjectExplorer::Interpreter> *createInterpreterModel(QObject * return f; } case Qt::ToolTipRole: - if (interpreter.command.needsDevice()) + if (!interpreter.command.isLocal()) break; if (interpreter.command.isEmpty()) return Tr::tr("Executable is empty."); |
