Commit 13675310 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

ProjectExplorer: Use native separators when reporting files

... that failed to get added to a project.

Change-Id: I148edc7d0c7fa327233fa8aff7122ee3412a47ba
Reviewed-by: default avatarRobert Loehning <>
Reviewed-by: default avatarEike Ziller <>
parent 1a9e097c
......@@ -3167,13 +3167,15 @@ void ProjectExplorerPlugin::addExistingFiles(FolderNode *folderNode, const QStri
folderNode->addFiles(fileNames, &notAdded);
if (!notAdded.isEmpty()) {
QString message = tr("Could not add following files to project %1:").arg(folderNode->projectNode()->displayName());
message += QLatin1Char('\n');
QString files = notAdded.join(QLatin1Char('\n'));
const QString message = tr("Could not add following files to project %1:")
.arg(folderNode->projectNode()->displayName()) + QLatin1Char('\n');
const QStringList nativeFiles
= Utils::transform(notAdded,
[](const QString &f) { return QDir::toNativeSeparators(f); });
QMessageBox::warning(ICore::mainWindow(), tr("Adding Files to Project Failed"),
message + files);
foreach (const QString &file, notAdded)
message + nativeFiles.join(QLatin1Char('\n')));
fileNames = Utils::filtered(fileNames,
[&notAdded](const QString &f) { return !notAdded.contains(f); });
VcsManager::promptToAdd(dir, fileNames);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment