mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
dbdf50d03c
commit
8eb6dfdb02
4 changed files with 21 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue