Ensure that we use the right path separator when opening a book.

This commit is contained in:
Matthieu Gautier 2018-11-03 11:20:59 +01:00
parent 565e332de2
commit 963c0066c2
2 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,7 @@
#include <QDebug>
#include <QUrlQuery>
#include <QUrl>
#include <QDir>
ContentManager::ContentManager(Library* library, kiwix::Downloader* downloader, QObject *parent)
: QObject(parent),
@ -116,7 +117,8 @@ QStringList ContentManager::updateDownloadInfos(QString id, const QStringList &k
d->updateStatus(true);
if (d->getStatus() == kiwix::Download::K_COMPLETE) {
b.setPath(d->getPath());
QString tmp(QString::fromStdString(d->getPath()));
b.setPath(QDir::toNativeSeparators(tmp).toStdString());
b.setDownloadId("");
mp_library->save();
emit(mp_library->booksChanged());

View File

@ -123,6 +123,7 @@ void KiwixApp::openZimFile(const QString &zimfile)
tr("Open Zim"),
QString(),
"ZimFile (*.zim*)");
_zimfile = QDir::toNativeSeparators(_zimfile);
}
if (_zimfile.isEmpty()) {
return;