diff options
author | Thiago Macieira <thiago@macieira.org> | 2013-12-19 17:02:34 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-20 09:53:05 -0800 |
commit | 8eb6dfdb02cf7b9d2c92f9e6ef28ad5312415302 (patch) | |
tree | c30921972538ec90afa11eb62c664ea58efac8d0 /qt-ui/mainwindow.cpp | |
parent | dbdf50d03cd19b8cf62f39a2578996215f47034e (diff) | |
download | subsurface-8eb6dfdb02cf7b9d2c92f9e6ef28ad5312415302.tar.gz |
Use QFile::{encode,decode}Name for file names
And make them use UTF-8 on Windows instead of the local 8 bit encoding.
This will also get us the proper NFD encoding on OS X.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 276f24ba9..5f410ff3c 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -825,7 +825,7 @@ void MainWindow::importFiles(const QStringList fileNames) QByteArray fileNamePtr; char *error = NULL; for (int i = 0; i < fileNames.size(); ++i) { - fileNamePtr = fileNames.at(i).toUtf8(); + fileNamePtr = QFile::encodeName(fileNames.at(i)); parse_file(fileNamePtr.data(), &error); if (error != NULL) { showError(error); @@ -846,7 +846,7 @@ void MainWindow::loadFiles(const QStringList fileNames) QByteArray fileNamePtr; for (int i = 0; i < fileNames.size(); ++i) { - fileNamePtr = fileNames.at(i).toUtf8(); + fileNamePtr = QFile::encodeName(fileNames.at(i)); parse_file(fileNamePtr.data(), &error); set_filename(fileNamePtr.data(), TRUE); setTitle(MWTF_FILENAME); |