summaryrefslogtreecommitdiff
path: root/src/plugins/cmakeprojectmanager
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@nokia.com>2010-03-25 13:19:27 +0100
committerTobias Hunger <tobias.hunger@nokia.com>2010-03-25 14:21:43 +0100
commit1ca8cb239759efd59b841b262e7fe618ff18d99a (patch)
treed74acbbae2d363bfad34f7cb5f7456f07de53f38 /src/plugins/cmakeprojectmanager
parent3a15c8c3c543adcc42eec8a30a7675ddd3b90526 (diff)
downloadqt-creator-1ca8cb239759efd59b841b262e7fe618ff18d99a.tar.gz
Introduce method to access the project directory
... use it. Reviewed-by: dt
Diffstat (limited to 'src/plugins/cmakeprojectmanager')
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp4
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.cpp15
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.h2
3 files changed, 7 insertions, 14 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
index 6e006053c4..ab7fbde24f 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
@@ -93,7 +93,7 @@ QString CMakeBuildConfiguration::buildDirectory() const
{
QString buildDirectory = m_buildDirectory;
if (buildDirectory.isEmpty())
- buildDirectory = cmakeTarget()->cmakeProject()->sourceDirectory() + "/qtcreator-build";
+ buildDirectory = target()->project()->projectDirectory() + "/qtcreator-build";
return buildDirectory;
}
@@ -221,7 +221,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
cleanMakeStep->setClean(true);
CMakeOpenProjectWizard copw(cmtarget->cmakeProject()->projectManager(),
- cmtarget->cmakeProject()->sourceDirectory(),
+ cmtarget->project()->projectDirectory(),
bc->buildDirectory(),
bc->environment());
if (copw.exec() != QDialog::Accepted) {
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index 0ef66e8f20..f9094c975e 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -156,11 +156,6 @@ void CMakeProject::changeBuildDirectory(CMakeBuildConfiguration *bc, const QStri
parseCMakeLists();
}
-QString CMakeProject::sourceDirectory() const
-{
- return QFileInfo(m_fileName).absolutePath();
-}
-
bool CMakeProject::parseCMakeLists()
{
if (!activeTarget() ||
@@ -198,7 +193,7 @@ bool CMakeProject::parseCMakeLists()
projectFiles.insert(node->path());
} else {
// Manually add the CMakeLists.txt file
- QString cmakeListTxt = sourceDirectory() + "/CMakeLists.txt";
+ QString cmakeListTxt = projectDirectory() + "/CMakeLists.txt";
fileList.append(new ProjectExplorer::FileNode(cmakeListTxt, ProjectExplorer::ProjectFileType, false));
projectFiles.insert(cmakeListTxt);
}
@@ -240,7 +235,7 @@ bool CMakeProject::parseCMakeLists()
allIncludePaths.append(headerPath.path());
}
// This explicitly adds -I. to the include paths
- allIncludePaths.append(sourceDirectory());
+ allIncludePaths.append(projectDirectory());
allIncludePaths.append(cbpparser.includeFiles());
CppTools::CppModelManagerInterface *modelmanager =
@@ -479,7 +474,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
// Ask the user for where he wants to build it
// and the cmake command line
- CMakeOpenProjectWizard copw(m_manager, sourceDirectory(), ProjectExplorer::Environment::systemEnvironment());
+ CMakeOpenProjectWizard copw(m_manager, projectDirectory(), ProjectExplorer::Environment::systemEnvironment());
if (copw.exec() != QDialog::Accepted)
return false;
@@ -641,7 +636,7 @@ void CMakeBuildSettingsWidget::init(BuildConfiguration *bc)
{
m_buildConfiguration = static_cast<CMakeBuildConfiguration *>(bc);
m_pathLineEdit->setText(m_buildConfiguration->buildDirectory());
- if (m_buildConfiguration->buildDirectory() == m_project->sourceDirectory())
+ if (m_buildConfiguration->buildDirectory() == m_project->projectDirectory())
m_changeButton->setEnabled(false);
else
m_changeButton->setEnabled(true);
@@ -650,7 +645,7 @@ void CMakeBuildSettingsWidget::init(BuildConfiguration *bc)
void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
{
CMakeOpenProjectWizard copw(m_project->projectManager(),
- m_project->sourceDirectory(),
+ m_project->projectDirectory(),
m_buildConfiguration->buildDirectory(),
m_buildConfiguration->environment());
if (copw.exec() == QDialog::Accepted) {
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h
index 62612c0f7c..407bd58d5f 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.h
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.h
@@ -97,8 +97,6 @@ public:
CMakeBuildTarget buildTargetForTitle(const QString &title);
- QString sourceDirectory() const;
-
bool parseCMakeLists();
signals: