Fix url creation for local files

This commit is contained in:
Luis Ángel San Martín 2023-11-29 18:02:56 +01:00
parent e005f5b26d
commit 16924eea38
2 changed files with 3 additions and 2 deletions

View File

@ -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<int>() << 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<qulonglong> &comicIds)

View File

@ -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)