Commit b30dfc3d authored by Tobias Hunger (external)'s avatar Tobias Hunger (external) Committed by Tobias Hunger
Browse files

ProjectExplorer: Sprinkle QDir::toNativeSeparators over warning messages



Change-Id: I9190ed8e986dc097ae5eafd18aafe345782242ed
Reviewed-by: default avatarRobert Loehning <robert.loehning@theqtcompany.com>
parent 5d588d41
...@@ -3241,7 +3241,9 @@ void ProjectExplorerPluginPrivate::removeFile() ...@@ -3241,7 +3241,9 @@ void ProjectExplorerPluginPrivate::removeFile()
if (!folderNode->removeFiles(QStringList(filePath))) { if (!folderNode->removeFiles(QStringList(filePath))) {
QMessageBox::warning(ICore::mainWindow(), tr("Removing File Failed"), QMessageBox::warning(ICore::mainWindow(), tr("Removing File Failed"),
tr("Could not remove file %1 from project %2.").arg(filePath).arg(folderNode->projectNode()->displayName())); tr("Could not remove file %1 from project %2.")
.arg(QDir::toNativeSeparators(filePath))
.arg(folderNode->projectNode()->displayName()));
return; return;
} }
...@@ -3262,7 +3264,8 @@ void ProjectExplorerPluginPrivate::deleteFile() ...@@ -3262,7 +3264,8 @@ void ProjectExplorerPluginPrivate::deleteFile()
QMessageBox::StandardButton button = QMessageBox::StandardButton button =
QMessageBox::question(ICore::mainWindow(), QMessageBox::question(ICore::mainWindow(),
tr("Delete File"), tr("Delete File"),
tr("Delete %1 from file system?").arg(filePath), tr("Delete %1 from file system?")
.arg(QDir::toNativeSeparators(filePath)),
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
if (button != QMessageBox::Yes) if (button != QMessageBox::Yes)
return; return;
...@@ -3281,7 +3284,8 @@ void ProjectExplorerPluginPrivate::deleteFile() ...@@ -3281,7 +3284,8 @@ void ProjectExplorerPluginPrivate::deleteFile()
if (file.exists()) { if (file.exists()) {
if (!file.remove()) if (!file.remove())
QMessageBox::warning(ICore::mainWindow(), tr("Deleting File Failed"), QMessageBox::warning(ICore::mainWindow(), tr("Deleting File Failed"),
tr("Could not delete file %1.").arg(filePath)); tr("Could not delete file %1.")
.arg(QDir::toNativeSeparators(filePath)));
} }
DocumentManager::unexpectFileChange(filePath); DocumentManager::unexpectFileChange(filePath);
} }
...@@ -3305,7 +3309,6 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath) ...@@ -3305,7 +3309,6 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath)
FolderNode *folderNode = node->parentFolderNode(); FolderNode *folderNode = node->parentFolderNode();
QString projectFileName = folderNode->projectNode()->path().fileName(); QString projectFileName = folderNode->projectNode()->path().fileName();
if (!folderNode->canRenameFile(orgFilePath, newFilePath)) { if (!folderNode->canRenameFile(orgFilePath, newFilePath)) {
QTimer::singleShot(0, [orgFilePath, newFilePath, projectFileName] { QTimer::singleShot(0, [orgFilePath, newFilePath, projectFileName] {
int res = QMessageBox::question(ICore::mainWindow(), int res = QMessageBox::question(ICore::mainWindow(),
...@@ -3313,8 +3316,8 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath) ...@@ -3313,8 +3316,8 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath)
tr("The project file %1 cannot be automatically changed.\n\n" tr("The project file %1 cannot be automatically changed.\n\n"
"Rename %2 to %3 anyway?") "Rename %2 to %3 anyway?")
.arg(projectFileName) .arg(projectFileName)
.arg(orgFilePath) .arg(QDir::toNativeSeparators(orgFilePath))
.arg(newFilePath)); .arg(QDir::toNativeSeparators(newFilePath)));
if (res == QMessageBox::Yes) if (res == QMessageBox::Yes)
FileUtils::renameFile(orgFilePath, newFilePath); FileUtils::renameFile(orgFilePath, newFilePath);
...@@ -3325,9 +3328,10 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath) ...@@ -3325,9 +3328,10 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath)
if (FileUtils::renameFile(orgFilePath, newFilePath)) { if (FileUtils::renameFile(orgFilePath, newFilePath)) {
// Tell the project plugin about rename // Tell the project plugin about rename
if (!folderNode->renameFile(orgFilePath, newFilePath)) { if (!folderNode->renameFile(orgFilePath, newFilePath)) {
QString renameFileError = tr("The file %1 was renamed to %2, but the project file %3 could not be automatically changed.") const QString renameFileError
.arg(orgFilePath) = tr("The file %1 was renamed to %2, but the project file %3 could not be automatically changed.")
.arg(newFilePath) .arg(QDir::toNativeSeparators(orgFilePath))
.arg(QDir::toNativeSeparators(newFilePath))
.arg(projectFileName); .arg(projectFileName);
QTimer::singleShot(0, [renameFileError]() { QTimer::singleShot(0, [renameFileError]() {
......
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