diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index eb10a113bcc..c216ca06ce1 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -173,23 +173,3 @@ QString CMakeManager::mimeType() const { return QLatin1String(Constants::CMAKEPROJECTMIMETYPE); } - -QString CMakeManager::findCbpFile(const QDir &directory) -{ - // Find the cbp file - // the cbp file is named like the project() command in the CMakeList.txt file - // so this function below could find the wrong cbp file, if the user changes the project() - // 2name - QDateTime t; - QString file; - foreach (const QString &cbpFile , directory.entryList()) { - if (cbpFile.endsWith(QLatin1String(".cbp"))) { - QFileInfo fi(directory.path() + QLatin1Char('/') + cbpFile); - if (t.isNull() || fi.lastModified() > t) { - file = directory.path() + QLatin1Char('/') + cbpFile; - t = fi.lastModified(); - } - } - } - return file; -} diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h index 9a666d96f02..cd8f414a814 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.h @@ -29,7 +29,6 @@ QT_BEGIN_NAMESPACE class QAction; -class QDir; QT_END_NAMESPACE namespace CMakeProjectManager { @@ -46,8 +45,6 @@ public: ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString) override; QString mimeType() const override; - static QString findCbpFile(const QDir &); - private: void updateCmakeActions(); void clearCMakeCache(ProjectExplorer::Project *project); diff --git a/src/plugins/cmakeprojectmanager/tealeafreader.cpp b/src/plugins/cmakeprojectmanager/tealeafreader.cpp index 47ca819c1bd..c4c37a37f27 100644 --- a/src/plugins/cmakeprojectmanager/tealeafreader.cpp +++ b/src/plugins/cmakeprojectmanager/tealeafreader.cpp @@ -31,7 +31,6 @@ #include "cmakekitinformation.h" #include "cmakeparser.h" #include "cmakeprojectconstants.h" -#include "cmakeprojectmanager.h" #include "cmakeprojectnodes.h" #include @@ -169,9 +168,29 @@ void TeaLeafReader::resetData() m_files.clear(); } +static QString findCbpFile(const QDir &directory) +{ + // Find the cbp file + // the cbp file is named like the project() command in the CMakeList.txt file + // so this function below could find the wrong cbp file, if the user changes the project() + // 2name + QDateTime t; + QString file; + foreach (const QString &cbpFile , directory.entryList()) { + if (cbpFile.endsWith(QLatin1String(".cbp"))) { + QFileInfo fi(directory.path() + QLatin1Char('/') + cbpFile); + if (t.isNull() || fi.lastModified() > t) { + file = directory.path() + QLatin1Char('/') + cbpFile; + t = fi.lastModified(); + } + } + } + return file; +} + void TeaLeafReader::parse(bool force) { - const QString cbpFile = CMakeManager::findCbpFile(QDir(m_parameters.buildDirectory.toString())); + const QString cbpFile = findCbpFile(QDir(m_parameters.buildDirectory.toString())); const QFileInfo cbpFileFi = cbpFile.isEmpty() ? QFileInfo() : QFileInfo(cbpFile); if (!cbpFileFi.exists()) { // Initial create: @@ -385,7 +404,7 @@ void TeaLeafReader::extractData() // Do not insert topCMake into m_cmakeFiles: The project already watches that! // Find cbp file - FileName cbpFile = FileName::fromString(CMakeManager::findCbpFile(bldDir.toString())); + FileName cbpFile = FileName::fromString(findCbpFile(bldDir.toString())); if (cbpFile.isEmpty()) return; m_cmakeFiles.insert(cbpFile);