summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/qt4projectmanager/makestep.cpp52
-rw-r--r--src/plugins/qt4projectmanager/qt4nodes.cpp5
-rw-r--r--src/plugins/qt4projectmanager/qt4projectmanager.cpp6
-rw-r--r--src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp3
4 files changed, 37 insertions, 29 deletions
diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp
index f6977b6ded..2afc49d89a 100644
--- a/src/plugins/qt4projectmanager/makestep.cpp
+++ b/src/plugins/qt4projectmanager/makestep.cpp
@@ -183,15 +183,22 @@ bool MakeStep::init()
ProjectExplorer::ToolChain *toolchain = bc->toolChain();
- if (bc->subNodeBuild()) {
- QString makefile = bc->subNodeBuild()->makefile();
- if (!makefile.isEmpty()) {
+ Qt4ProjectManager::Qt4ProFileNode *subNode = bc->subNodeBuild();
+ if (subNode) {
+ QString makefile = subNode->makefile();
+ if (makefile.isEmpty())
+ makefile = QLatin1String("Makefile");
+ if (subNode->isDebugAndRelease()) {
+ if (bc->buildType() == Qt4BuildConfiguration::Debug)
+ makefile += QLatin1String(".Debug");
+ else
+ makefile += QLatin1String(".Release");
+ }
+ if (makefile != QLatin1String("Makefile")) {
Utils::QtcProcess::addArg(&args, QLatin1String("-f"));
Utils::QtcProcess::addArg(&args, makefile);
- m_makeFileToCheck = QDir(workingDirectory).filePath(makefile);
- } else {
- m_makeFileToCheck = QDir(workingDirectory).filePath(QLatin1String("Makefile"));
}
+ m_makeFileToCheck = QDir(workingDirectory).filePath(makefile);
} else {
if (!bc->makefile().isEmpty()) {
Utils::QtcProcess::addArg(&args, QLatin1String("-f"));
@@ -209,23 +216,24 @@ bool MakeStep::init()
Utils::QtcProcess::addArg(&args, bc->defaultMakeTarget());
}
- if (bc->fileNodeBuild()) {
- Qt4ProjectManager::Qt4ProFileNode *proNode = bc->subNodeBuild();
- if (!proNode) {
- Qt4Project *qt4project = qobject_cast<Qt4Project *>(project());
- if (qt4project)
- proNode = qt4project->rootQt4ProjectNode();
- }
- if (proNode) {
- QString objectsDir = QDir(pp->workingDirectory()).relativeFilePath(
- proNode->objectsDirectory());
- if (!objectsDir.isEmpty())
- objectsDir += QLatin1Char('/');
- QString objectFile = objectsDir +
- QFileInfo(bc->fileNodeBuild()->path()).baseName() +
- proNode->objectExtension();
- Utils::QtcProcess::addArg(&args, objectFile);
+ if (bc->fileNodeBuild() && subNode) {
+ QString objectsDir = subNode->objectsDirectory();
+ if (objectsDir.isEmpty()) {
+ objectsDir = subNode->buildDir(bc);
+ if (subNode->isDebugAndRelease()) {
+ if (bc->buildType() == Qt4BuildConfiguration::Debug)
+ objectsDir += QLatin1String("/debug");
+ else
+ objectsDir += QLatin1String("/release");
+ }
}
+ QString relObjectsDir = QDir(pp->workingDirectory()).relativeFilePath(objectsDir);
+ if (!relObjectsDir.isEmpty())
+ relObjectsDir += QLatin1Char('/');
+ QString objectFile = relObjectsDir +
+ QFileInfo(bc->fileNodeBuild()->path()).baseName() +
+ subNode->objectExtension();
+ Utils::QtcProcess::addArg(&args, objectFile);
}
Utils::Environment env = bc->environment();
// Force output to english for the parsers. Do this here and not in the toolchain's
diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp
index 11fc21889b..2914fc1b99 100644
--- a/src/plugins/qt4projectmanager/qt4nodes.cpp
+++ b/src/plugins/qt4projectmanager/qt4nodes.cpp
@@ -1469,7 +1469,7 @@ QString Qt4ProFileNode::objectExtension() const
QString Qt4ProFileNode::objectsDirectory() const
{
if (m_varValues[ObjectsDir].isEmpty())
- return buildDir();
+ return QString();
return m_varValues[ObjectsDir].first();
}
@@ -1571,8 +1571,7 @@ bool Qt4ProFileNode::hasBuildTargets(Qt4ProjectType projectType) const
bool Qt4ProFileNode::isDebugAndRelease() const
{
const QStringList configValues = m_varValues.value(ConfigVar);
- return (configValues.contains(QLatin1String("debug_and_release"))
- && configValues.contains(QLatin1String("debug_and_release_target")));
+ return configValues.contains(QLatin1String("debug_and_release"));
}
Qt4ProjectType Qt4ProFileNode::projectType() const
diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp
index acb260e034..9ec31bf5ee 100644
--- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp
+++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp
@@ -427,12 +427,14 @@ void Qt4Manager::handleSubDirContextMenu(Qt4Manager::Action action, bool isFileB
!qt4pro->activeTarget()->activeBuildConfiguration())
return;
+ if (!m_contextNode || !m_contextFile)
+ isFileBuild = false;
Qt4BuildConfiguration *bc = qt4pro->activeTarget()->activeQt4BuildConfiguration();
- if (m_contextNode != 0 && m_contextNode != qt4pro->rootProjectNode())
+ if (m_contextNode != 0 && (m_contextNode != qt4pro->rootProjectNode() || isFileBuild))
if (Qt4ProFileNode *profile = qobject_cast<Qt4ProFileNode *>(m_contextNode))
bc->setSubNodeBuild(profile);
- if (isFileBuild && m_contextFile)
+ if (isFileBuild)
bc->setFileNodeBuild(m_contextFile);
if (projectExplorer()->saveModifiedFiles()) {
const Core::Id buildStep = Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp
index c5de30834a..2edae38eed 100644
--- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp
+++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp
@@ -376,8 +376,7 @@ void Qt4ProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node,
Qt4ProFileNode *subProjectNode = node ? qobject_cast<Qt4ProFileNode *>(node->projectNode()) : 0;
ProjectExplorer::FileNode *fileNode = qobject_cast<ProjectExplorer::FileNode *>(node);
bool buildFilePossible = subProjectNode && fileNode
- && (fileNode->fileType() == ProjectExplorer::SourceType)
- && !subProjectNode->isDebugAndRelease();
+ && (fileNode->fileType() == ProjectExplorer::SourceType);
m_qt4ProjectManager->setContextNode(subProjectNode);
m_qt4ProjectManager->setContextProject(qt4Project);