forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user