forked from qt-creator/qt-creator
Qt run configurations: emit enabledChanged if the disable reason changed
Otherwise a misparse might get reported as .pro parsing still in progress. Change-Id: I0958032c7692faa4672410f395ededf6f1a2e379 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -146,9 +146,9 @@ bool Qt4RunConfiguration::isEnabled() const
|
||||
QString Qt4RunConfiguration::disabledReason() const
|
||||
{
|
||||
if (m_parseInProgress)
|
||||
return tr("The .pro file is currently being parsed.");
|
||||
return tr("The .pro file '%1' is currently being parsed.").arg(QFileInfo(m_proFilePath).fileName());
|
||||
if (!m_parseSuccess)
|
||||
return tr("The .pro file could not be parsed.");
|
||||
return tr("The .pro file '%1' could not be parsed.").arg(QFileInfo(m_proFilePath).fileName());
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -164,9 +164,10 @@ void Qt4RunConfiguration::proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro,
|
||||
}
|
||||
|
||||
bool enabled = isEnabled();
|
||||
QString reason = disabledReason();
|
||||
m_parseSuccess = success;
|
||||
m_parseInProgress = parseInProgress;
|
||||
if (enabled != isEnabled())
|
||||
if (enabled != isEnabled() || reason != disabledReason())
|
||||
emit enabledChanged();
|
||||
|
||||
if (!parseInProgress) {
|
||||
|
@@ -113,9 +113,10 @@ void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNode
|
||||
if (m_proFilePath != pro->path())
|
||||
return;
|
||||
bool enabled = isEnabled();
|
||||
QString reason = disabledReason();
|
||||
m_validParse = success;
|
||||
m_parseInProgress = parseInProgress;
|
||||
if (enabled != isEnabled())
|
||||
if (enabled != isEnabled() || reason != disabledReason())
|
||||
emit enabledChanged();
|
||||
if (!parseInProgress)
|
||||
emit targetInformationChanged();
|
||||
@@ -138,9 +139,11 @@ bool S60DeviceRunConfiguration::isEnabled() const
|
||||
QString S60DeviceRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (m_parseInProgress)
|
||||
return tr("The .pro file is currently being parsed.");
|
||||
return tr("The .pro file '%1' is currently being parsed.")
|
||||
.arg(QFileInfo(m_proFilePath).fileName());
|
||||
if (!m_validParse)
|
||||
return tr("The .pro file could not be parsed.");
|
||||
return tr("The .pro file '%1' could not be parsed.")
|
||||
.arg(QFileInfo(m_proFilePath).fileName());
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
@@ -157,11 +157,13 @@ Qt4BuildConfiguration *RemoteLinuxRunConfiguration::activeQt4BuildConfiguration(
|
||||
bool RemoteLinuxRunConfiguration::isEnabled() const
|
||||
{
|
||||
if (d->parseInProgress) {
|
||||
d->disabledReason = tr("The .pro file is being parsed.");
|
||||
d->disabledReason = tr("The .pro file '%1' is being parsed.")
|
||||
.arg(QFileInfo(d->proFilePath).fileName());
|
||||
return false;
|
||||
}
|
||||
if (!d->validParse) {
|
||||
d->disabledReason = tr("The .pro file could not be parsed.");
|
||||
d->disabledReason = tr("The .pro file '%1' could not be parsed.")
|
||||
.arg(QFileInfo(d->proFilePath).fileName());
|
||||
return false;
|
||||
}
|
||||
if (!activeQt4BuildConfiguration()) {
|
||||
@@ -195,9 +197,10 @@ void RemoteLinuxRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNod
|
||||
{
|
||||
if (d->proFilePath == pro->path()) {
|
||||
bool enabled = isEnabled();
|
||||
QString reason = disabledReason();
|
||||
d->validParse = success;
|
||||
d->parseInProgress = parseInProgress;
|
||||
if (enabled != isEnabled())
|
||||
if (enabled != isEnabled() || reason != disabledReason())
|
||||
updateEnabledState();
|
||||
if (!parseInProgress)
|
||||
emit targetInformationChanged();
|
||||
|
Reference in New Issue
Block a user