forked from qt-creator/qt-creator
Android: Merge run configuration into base class
The base AndroidRunConfiguration as such is buildsystem agnostic now, it is, however not usable with other buildsystems as the apk build step relies on qmake specific information, so the run configuration factory stays on the buildsystem specific side for now. Change-Id: I00538846028cc060aceea15ffd2e63068450f1e8 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -30,7 +30,9 @@
|
||||
#include "androidrunconfigurationwidget.h"
|
||||
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <qtsupport/qtoutputformatter.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
@@ -49,6 +51,9 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Core::Id id)
|
||||
: RunConfiguration(target, id)
|
||||
{
|
||||
setOutputFormatter<QtSupport::QtOutputFormatter>();
|
||||
connect(target->project(), &Project::parsingFinished, this, [this] {
|
||||
updateTargetInformation();
|
||||
});
|
||||
}
|
||||
|
||||
void AndroidRunConfiguration::setPreStartShellCommands(const QStringList &cmdList)
|
||||
@@ -115,4 +120,29 @@ const QStringList &AndroidRunConfiguration::postFinishShellCommands() const
|
||||
return m_postFinishShellCommands;
|
||||
}
|
||||
|
||||
void AndroidRunConfiguration::updateTargetInformation()
|
||||
{
|
||||
const BuildTargetInfo bti = buildTargetInfo();
|
||||
setDisplayName(bti.displayName);
|
||||
setDefaultDisplayName(bti.displayName);
|
||||
}
|
||||
|
||||
QString AndroidRunConfiguration::disabledReason() const
|
||||
{
|
||||
const BuildTargetInfo bti = buildTargetInfo();
|
||||
const QString projectFileName = bti.projectFilePath.toString();
|
||||
|
||||
if (project()->isParsing())
|
||||
return tr("The project file \"%1\" is currently being parsed.").arg(projectFileName);
|
||||
|
||||
if (!project()->hasParsingData()) {
|
||||
if (!bti.projectFilePath.exists())
|
||||
return tr("The project file \"%1\" does not exist.").arg(projectFileName);
|
||||
|
||||
return tr("The project file \"%1\" could not be parsed.").arg(projectFileName);
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
} // namespace Android
|
||||
|
||||
Reference in New Issue
Block a user