diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-12-19 15:00:54 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-19 07:28:25 -0800 |
commit | 1bb7ab30c68d7ebfc8c00048b8baeee1a10e0aab (patch) | |
tree | c7719508a3689c25749d670541025855efbfc866 /qt-ui | |
parent | 69ed0d8393868dd4953d1fd906a83258408d7639 (diff) | |
download | subsurface-1bb7ab30c68d7ebfc8c00048b8baeee1a10e0aab.tar.gz |
Files: prefer toUtf8() over toLocal8Bit()
We may want to use toUtf8() for win32 considerations.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/mainwindow.cpp | 4 | ||||
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 36fa71d73..276f24ba9 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).toLocal8Bit(); + fileNamePtr = fileNames.at(i).toUtf8(); 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).toLocal8Bit(); + fileNamePtr = fileNames.at(i).toUtf8(); parse_file(fileNamePtr.data(), &error); set_filename(fileNamePtr.data(), TRUE); setTitle(MWTF_FILENAME); diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 096100ad8..266332f29 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -125,7 +125,7 @@ static char *prepare_dives_for_divelogs(const bool selected) /* generate a random filename and create/open that file with zip_open */ QString tempfileQ = QDir::tempPath() + "/import-" + QString::number(qrand() % 99999999) + ".dld"; - tempfile = strdup(tempfileQ.toLocal8Bit().data()); + tempfile = strdup(tempfileQ.toUtf8().data()); zip = zip_open(tempfile, ZIP_CREATE, NULL); if (!zip) { @@ -759,7 +759,7 @@ void DivelogsDeWebServices::downloadFinished() if (!zip) ::close(duppedfd); #else - struct zip *zip = zip_open(zipFile.fileName().toLocal8Bit().data(), 0, &errorcode); + struct zip *zip = zip_open(zipFile.fileName().toUtf8().data(), 0, &errorcode); #endif if (!zip) { char buf[512]; @@ -855,7 +855,7 @@ void DivelogsDeWebServices::buttonClicked(QAbstractButton* button) } /* parse file and import dives */ char *error = NULL; - parse_file(zipFile.fileName().toLocal8Bit().data(), &error); + parse_file(zipFile.fileName().toUtf8().data(), &error); if (error != NULL) { mainWindow()->showError(error); free(error); |