forked from qt-creator/qt-creator
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:
@@ -119,14 +119,14 @@ public:
|
|||||||
{
|
{
|
||||||
QStringList pathList;
|
QStringList pathList;
|
||||||
for (int i = 0; i < m_view.topLevelItemCount(); ++i)
|
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());
|
return pathList.join(Utils::HostOsInfo::pathListSeparator());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addPath(const QString &path)
|
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
|
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable
|
||||||
| Qt::ItemIsDragEnabled);
|
| Qt::ItemIsDragEnabled);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user