CMake: Move CMakeProjectManager::findCbpFile to tealeafreader.cpp

That's the the only user of that code.

Change-Id: Iabc6a1fa9a4ad05c467e8ed64386d3185de25f02
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2017-02-25 17:27:00 +01:00
parent 28b6c4f671
commit 8b5b1f1de7
3 changed files with 22 additions and 26 deletions

View File

@@ -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;
}