GUI: Show native paths in ProjectFiles -dialog.
When adding paths to the dialog convert them to native separators. When saving the paths convert them to internal separators.
This commit is contained in:
parent
abf0a2ea52
commit
1e503cbad5
|
@ -23,6 +23,7 @@
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QDir>
|
||||||
#include "projectfiledialog.h"
|
#include "projectfiledialog.h"
|
||||||
|
|
||||||
ProjectFileDialog::ProjectFileDialog(const QString &path, QWidget *parent)
|
ProjectFileDialog::ProjectFileDialog(const QString &path, QWidget *parent)
|
||||||
|
@ -54,6 +55,7 @@ QStringList ProjectFileDialog::GetIncludePaths() const
|
||||||
if (!include.isEmpty())
|
if (!include.isEmpty())
|
||||||
{
|
{
|
||||||
include = include.trimmed();
|
include = include.trimmed();
|
||||||
|
include = QDir::fromNativeSeparators(include);
|
||||||
if (include.indexOf(';') != -1)
|
if (include.indexOf(';') != -1)
|
||||||
includes = include.split(";");
|
includes = include.split(";");
|
||||||
else
|
else
|
||||||
|
@ -84,6 +86,7 @@ QStringList ProjectFileDialog::GetPaths() const
|
||||||
if (!path.isEmpty())
|
if (!path.isEmpty())
|
||||||
{
|
{
|
||||||
path = path.trimmed();
|
path = path.trimmed();
|
||||||
|
path = QDir::fromNativeSeparators(path);
|
||||||
if (path.indexOf(';') != -1)
|
if (path.indexOf(';') != -1)
|
||||||
paths = path.split(";");
|
paths = path.split(";");
|
||||||
else
|
else
|
||||||
|
@ -109,6 +112,7 @@ void ProjectFileDialog::SetIncludepaths(const QStringList &includes)
|
||||||
// Remove ; from the end of the string
|
// Remove ; from the end of the string
|
||||||
if (includestr.endsWith(';'))
|
if (includestr.endsWith(';'))
|
||||||
includestr = includestr.left(includestr.length() - 1);
|
includestr = includestr.left(includestr.length() - 1);
|
||||||
|
includestr = QDir::toNativeSeparators(includestr);
|
||||||
mUI.mEditIncludePaths->setText(includestr);
|
mUI.mEditIncludePaths->setText(includestr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,6 +143,7 @@ void ProjectFileDialog::SetPaths(const QStringList &paths)
|
||||||
// Remove ; from the end of the string
|
// Remove ; from the end of the string
|
||||||
if (pathstr.endsWith(';'))
|
if (pathstr.endsWith(';'))
|
||||||
pathstr = pathstr.left(pathstr.length() - 1);
|
pathstr = pathstr.left(pathstr.length() - 1);
|
||||||
|
pathstr = QDir::toNativeSeparators(pathstr);
|
||||||
mUI.mEditPaths->setText(pathstr);
|
mUI.mEditPaths->setText(pathstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue