From 16924eea383d7fa5c89300c500c4689c6af1ad46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Wed, 29 Nov 2023 18:02:56 +0100 Subject: [PATCH] Fix url creation for local files --- YACReaderLibrary/db/comic_model.cpp | 3 ++- YACReaderLibrary/db/folder_model.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/YACReaderLibrary/db/comic_model.cpp b/YACReaderLibrary/db/comic_model.cpp index cc195970..7c820cfb 100644 --- a/YACReaderLibrary/db/comic_model.cpp +++ b/YACReaderLibrary/db/comic_model.cpp @@ -1208,9 +1208,10 @@ void ComicModel::notifyCoverChange(const ComicDB &comic) // this doesn't work in QML -> emit dataChanged(index(itemIndex, 0), index(itemIndex, 0), QVector() << CoverPathRole); } +// ???? QUrl ComicModel::getCoverUrlPathForComicHash(const QString &hash) const { - return QUrl("file:" + _databasePath + "/covers/" + hash + ".jpg"); + return QUrl::fromLocalFile(_databasePath + "/covers/" + hash + ".jpg"); } void ComicModel::addComicsToFavorites(const QList &comicIds) diff --git a/YACReaderLibrary/db/folder_model.cpp b/YACReaderLibrary/db/folder_model.cpp index 801b9899..ba7fdcce 100644 --- a/YACReaderLibrary/db/folder_model.cpp +++ b/YACReaderLibrary/db/folder_model.cpp @@ -784,7 +784,7 @@ QModelIndex FolderModel::addFolderAtParent(const QString &folderName, const QMod QUrl FolderModel::getCoverUrlPathForComicHash(const QString &hash) const { - return QUrl("file:" + _databasePath + "/covers/" + hash + ".jpg"); + return QUrl::fromLocalFile(_databasePath + "/covers/" + hash + ".jpg"); } void FolderModel::setShowRecent(bool showRecent)