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 ...@@ -329,7 +329,7 @@ QString CustomExecutableRunConfiguration::executable() const
{ {
QString exec; QString exec;
if (!m_executable.isEmpty() && QDir::isRelativePath(m_executable)) { if (!m_executable.isEmpty() && QDir::isRelativePath(m_executable)) {
Environment env = activeBuildConfiguration()->environment(); Environment env = environment();
exec = env.searchInPath(m_executable); exec = env.searchInPath(m_executable);
if (exec.isEmpty()) if (exec.isEmpty())
exec = QDir::cleanPath(workingDirectory() + QLatin1Char('/') + m_executable); exec = QDir::cleanPath(workingDirectory() + QLatin1Char('/') + m_executable);
...@@ -380,8 +380,11 @@ QString CustomExecutableRunConfiguration::baseWorkingDirectory() const ...@@ -380,8 +380,11 @@ QString CustomExecutableRunConfiguration::baseWorkingDirectory() const
QString CustomExecutableRunConfiguration::workingDirectory() const QString CustomExecutableRunConfiguration::workingDirectory() const
{ {
QString wd = m_workingDirectory; QString wd = m_workingDirectory;
QString bd = activeBuildConfiguration()->buildDirectory(); if (activeBuildConfiguration()) {
return wd.replace("$BUILDDIR", QDir::cleanPath(bd)); QString bd = activeBuildConfiguration()->buildDirectory();
wd.replace("$BUILDDIR", QDir::cleanPath(bd));
}
return wd;
} }
QStringList CustomExecutableRunConfiguration::commandLineArguments() const QStringList CustomExecutableRunConfiguration::commandLineArguments() const
...@@ -409,7 +412,8 @@ ProjectExplorer::Environment CustomExecutableRunConfiguration::baseEnvironment() ...@@ -409,7 +412,8 @@ ProjectExplorer::Environment CustomExecutableRunConfiguration::baseEnvironment()
} else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) { } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) {
env = ProjectExplorer::Environment::systemEnvironment(); env = ProjectExplorer::Environment::systemEnvironment();
} else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) { } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) {
env = activeBuildConfiguration()->environment(); if (activeBuildConfiguration())
env = activeBuildConfiguration()->environment();
} }
return env; 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