forked from qt-creator/qt-creator
Python: Fix loading working directory
Fixes: QTCREATORBUG-24440 Change-Id: I27a543f764e285acf678427cc909d2a95e5cb322 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -281,6 +281,7 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Utils::Id id)
|
|||||||
const QString script = bti.targetFilePath.toUserOutput();
|
const QString script = bti.targetFilePath.toUserOutput();
|
||||||
setDefaultDisplayName(tr("Run %1").arg(script));
|
setDefaultDisplayName(tr("Run %1").arg(script));
|
||||||
scriptAspect->setValue(script);
|
scriptAspect->setValue(script);
|
||||||
|
aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(bti.targetFilePath.parentDir());
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
|
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
|
||||||
@@ -298,9 +299,6 @@ void PythonRunConfiguration::updateLanguageServer()
|
|||||||
PyLSConfigureAssistant::instance()->openDocumentWithPython(python, document);
|
PyLSConfigureAssistant::instance()->openDocumentWithPython(python, document);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(
|
|
||||||
Utils::FilePath::fromString(mainScript()).parentDir());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PythonRunConfiguration::supportsDebugger() const
|
bool PythonRunConfiguration::supportsDebugger() const
|
||||||
|
Reference in New Issue
Block a user