From e1ce36362d4e01051dbc7d4387f67a34d9e4b4db Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 16 Jun 2020 23:43:23 +0200 Subject: [PATCH] PathListDialog: Retain original dir separators When editing the "Path" variable on Windows, the PathListDialog currently returns the path with all '\\' dir separators turned into '/'. Such conversion makes sense for the "Add ..." operation but should not be enforced for all paths. Or in other words: Do it like EnvironmentWidget does. This change removes conversion of the separators of all paths. Task-number: QTCREATORBUG-24213 Change-Id: Icab1bdc190e55e8f5724a93b7cd14b08e4c68829 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/environmentwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index 70269e49ca9..b734fe95dc4 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -119,14 +119,14 @@ public: { QStringList pathList; for (int i = 0; i < m_view.topLevelItemCount(); ++i) - pathList << QDir::fromNativeSeparators(m_view.topLevelItem(i)->text(0)); + pathList << m_view.topLevelItem(i)->text(0); return pathList.join(Utils::HostOsInfo::pathListSeparator()); } private: void addPath(const QString &path) { - const auto item = new QTreeWidgetItem(&m_view, {QDir::toNativeSeparators(path)}); + const auto item = new QTreeWidgetItem(&m_view, {path}); item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled); }