Commit 41a91ff9 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Remove customexecutable RCs again if they are unused

parent 176115a0
......@@ -371,6 +371,10 @@ QString CustomExecutableRunConfiguration::executable() const
return exec;
}
bool CustomExecutableRunConfiguration::isConfigured() const
{
return !m_executable.isEmpty();
}
LocalApplicationRunConfiguration::RunMode CustomExecutableRunConfiguration::runMode() const
{
......
......@@ -76,6 +76,10 @@ public:
*/
QString executable() const;
/** Returns whether this runconfiguration ever was configured with a executable
*/
bool isConfigured() const;
/**
* Returns only what is stored in the internal variable, not what we might
* get after extending it with a path or asking the user. This value is
......
......@@ -999,6 +999,18 @@ void Qt4Project::checkForNewApplicationProjects()
if (!found) {
qt4Target->addRunConfigurationForPath(qt4proFile->path());
}
// Remove unused CustomExecutableRCs:
if (target->runConfigurations().count() > 1) {
QList<RunConfiguration*> toRemove;
foreach (RunConfiguration * rc, target->runConfigurations()) {
CustomExecutableRunConfiguration *cerc = qobject_cast<CustomExecutableRunConfiguration *>(rc);
if (cerc && !cerc->isConfigured())
toRemove.append(rc);
}
foreach (RunConfiguration *rc, toRemove)
target->removeRunConfiguration(rc);
}
}
}
}
......
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