forked from qt-creator/qt-creator
Android: Move some unshared code closer to its only place of use
Change-Id: Ieaba2c8f76ee9ac020ebd44712aee593c34e4bf0 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -111,8 +111,23 @@ QString QmakeAndroidRunConfiguration::disabledReason() const
|
|||||||
return tr("The .pro file \"%1\" is currently being parsed.")
|
return tr("The .pro file \"%1\" is currently being parsed.")
|
||||||
.arg(m_proFilePath.fileName());
|
.arg(m_proFilePath.fileName());
|
||||||
|
|
||||||
if (!qmakeProject()->hasParsingData())
|
if (!qmakeProject()->hasParsingData()) {
|
||||||
return qmakeProject()->disabledReasonForRunConfiguration(m_proFilePath);
|
if (!m_proFilePath.exists())
|
||||||
|
return tr("The .pro file \"%1\" does not exist.")
|
||||||
|
.arg(m_proFilePath.fileName());
|
||||||
|
|
||||||
|
QmakeProjectManager::QmakeProFileNode *rootProjectNode = qmakeProject()->rootProjectNode();
|
||||||
|
if (!rootProjectNode) // Shutting down
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
if (!rootProjectNode->findProFileFor(m_proFilePath))
|
||||||
|
return tr("The .pro file \"%1\" is not part of the project.")
|
||||||
|
.arg(m_proFilePath.fileName());
|
||||||
|
|
||||||
|
return tr("The .pro file \"%1\" could not be parsed.")
|
||||||
|
.arg(m_proFilePath.fileName());
|
||||||
|
}
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1019,26 +1019,6 @@ void QmakeProject::configureAsExampleProject(const QSet<Core::Id> &platforms)
|
|||||||
qDeleteAll(infoList);
|
qDeleteAll(infoList);
|
||||||
}
|
}
|
||||||
|
|
||||||
// All the Qmake run configurations should share code.
|
|
||||||
// This is a rather suboptimal way to do that for disabledReason()
|
|
||||||
// but more pratical then duplicated the code everywhere
|
|
||||||
QString QmakeProject::disabledReasonForRunConfiguration(const FileName &proFilePath)
|
|
||||||
{
|
|
||||||
if (!proFilePath.exists())
|
|
||||||
return tr("The .pro file \"%1\" does not exist.")
|
|
||||||
.arg(proFilePath.fileName());
|
|
||||||
|
|
||||||
if (!rootProjectNode()) // Shutting down
|
|
||||||
return QString();
|
|
||||||
|
|
||||||
if (!rootProjectNode()->findProFileFor(proFilePath))
|
|
||||||
return tr("The .pro file \"%1\" is not part of the project.")
|
|
||||||
.arg(proFilePath.fileName());
|
|
||||||
|
|
||||||
return tr("The .pro file \"%1\" could not be parsed.")
|
|
||||||
.arg(proFilePath.fileName());
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmakeProject::updateBuildSystemData()
|
void QmakeProject::updateBuildSystemData()
|
||||||
{
|
{
|
||||||
Target *const target = activeTarget();
|
Target *const target = activeTarget();
|
||||||
|
|||||||
@@ -101,9 +101,6 @@ public:
|
|||||||
|
|
||||||
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;
|
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;
|
||||||
|
|
||||||
/// \internal
|
|
||||||
QString disabledReasonForRunConfiguration(const Utils::FileName &proFilePath);
|
|
||||||
|
|
||||||
void emitBuildDirectoryInitialized();
|
void emitBuildDirectoryInitialized();
|
||||||
static void proFileParseError(const QString &errorMessage);
|
static void proFileParseError(const QString &errorMessage);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user