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 <christian.kandeler@qt.io>
This commit is contained in:
Alessandro Portale
2020-06-16 23:43:23 +02:00
parent 80b04b8248
commit e1ce36362d

View File

@@ -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);
}