Commit e35a1e61 authored by dt's avatar dt
Browse files

Fix crash for Custom Executable RunConfiguation with qml projects

Custom Executable RunConfiguation assumed that there is always a active
buildconfiguration which is simply not true for qml projects.

Also fix a small bug that the executable was not searched in the full
environment but only in the build environment.

Reviewed-By: Tobias Hunger
parent d7a190a1
......@@ -329,7 +329,7 @@ QString CustomExecutableRunConfiguration::executable() const
{
QString exec;
if (!m_executable.isEmpty() && QDir::isRelativePath(m_executable)) {
Environment env = activeBuildConfiguration()->environment();
Environment env = environment();
exec = env.searchInPath(m_executable);
if (exec.isEmpty())
exec = QDir::cleanPath(workingDirectory() + QLatin1Char('/') + m_executable);
......@@ -380,8 +380,11 @@ QString CustomExecutableRunConfiguration::baseWorkingDirectory() const
QString CustomExecutableRunConfiguration::workingDirectory() const
{
QString wd = m_workingDirectory;
if (activeBuildConfiguration()) {
QString bd = activeBuildConfiguration()->buildDirectory();
return wd.replace("$BUILDDIR", QDir::cleanPath(bd));
wd.replace("$BUILDDIR", QDir::cleanPath(bd));
}
return wd;
}
QStringList CustomExecutableRunConfiguration::commandLineArguments() const
......@@ -409,6 +412,7 @@ ProjectExplorer::Environment CustomExecutableRunConfiguration::baseEnvironment()
} else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) {
env = ProjectExplorer::Environment::systemEnvironment();
} else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) {
if (activeBuildConfiguration())
env = activeBuildConfiguration()->environment();
}
return env;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment