forked from qt-creator/qt-creator
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
This commit is contained in:
@@ -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
|
|||||||
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()
|
|||||||
} 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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user