forked from qt-creator/qt-creator
ProjectExplorer: Drop the target argument
... from ProjectNode::targetData and setTargetData, and rename them to data and setData. It was only used in the implementation to retrieve the right node, instead move the responsibility to find the right node to the caller. Current assumption is that the functions were always called on the right node already. Change-Id: I9ae7e8a7ed5c79b924b99fd9a6a652bad56d114a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -186,7 +186,7 @@ void ChooseDirectoryPage::initializePage()
|
||||
|
||||
QString androidPackageDir;
|
||||
if (const ProjectNode *node = target->project()->findNodeForBuildKey(buildKey))
|
||||
androidPackageDir = node->targetData(Android::Constants::AndroidPackageSourceDir, target).toString();
|
||||
androidPackageDir = node->data(Android::Constants::AndroidPackageSourceDir).toString();
|
||||
|
||||
if (androidPackageDir.isEmpty()) {
|
||||
m_label->setText(tr("Select the Android package source directory.\n\n"
|
||||
@@ -352,14 +352,14 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles()
|
||||
ProjectNode *node = m_target->project()->findNodeForBuildKey(m_buildKey);
|
||||
if (node) {
|
||||
node->addFiles(addedFiles);
|
||||
androidPackageDir = node->targetData(Android::Constants::AndroidPackageSourceDir, m_target).toString();
|
||||
androidPackageDir = node->data(Android::Constants::AndroidPackageSourceDir).toString();
|
||||
}
|
||||
|
||||
if (androidPackageDir.isEmpty()) {
|
||||
// and now time for some magic
|
||||
const BuildTargetInfo bti = m_target->applicationTargets().buildTargetInfo(m_buildKey);
|
||||
const QString value = "$$PWD/" + bti.projectFilePath.toFileInfo().absoluteDir().relativeFilePath(m_directory);
|
||||
bool result = node->setTargetData(Android::Constants::AndroidPackageSourceDir, value, m_target);
|
||||
bool result = node->setData(Android::Constants::AndroidPackageSourceDir, value);
|
||||
|
||||
if (!result) {
|
||||
QMessageBox::warning(this, tr("Project File not Updated"),
|
||||
|
||||
Reference in New Issue
Block a user