Skip to content
Snippets Groups Projects
Commit 6a4ecce8 authored by Petar Perisin's avatar Petar Perisin
Browse files

GenericProject: add only existing files


when refreshing project check if files exist, and add only existing
files to the project

Change-Id: I5937bbe39e56c089b97350e095458c014fd294fb
Reviewed-by: default avatarThorbjørn Lindeijer <bjorn@lindeijer.nl>
parent c5228e64
No related branches found
No related tags found
No related merge requests found
......@@ -328,6 +328,7 @@ QStringList GenericProject::processEntries(const QStringList &paths,
const QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
const QDir projectDir(QFileInfo(m_fileName).dir());
QFileInfo fileInfo;
QStringList absolutePaths;
foreach (const QString &path, paths) {
QString trimmedPath = path.trimmed();
......@@ -338,10 +339,13 @@ QStringList GenericProject::processEntries(const QStringList &paths,
trimmedPath = Utils::FileName::fromUserInput(trimmedPath).toString();
const QString absPath = QFileInfo(projectDir, trimmedPath).absoluteFilePath();
absolutePaths.append(absPath);
if (map)
map->insert(absPath, trimmedPath);
fileInfo.setFile(projectDir, trimmedPath);
if (fileInfo.exists()) {
const QString absPath = fileInfo.absoluteFilePath();
absolutePaths.append(absPath);
if (map)
map->insert(absPath, trimmedPath);
}
}
absolutePaths.removeDuplicates();
return absolutePaths;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment