From 71018c3b4673a7921fddbddc3ad9cf7cbfc4dab9 Mon Sep 17 00:00:00 2001 From: DavidLazarescu Date: Wed, 27 Sep 2023 11:47:23 +0200 Subject: [PATCH] Disabled image loading for linux --- src/adapters/controllers/free_books_controller.cpp | 4 ++++ src/presentation/freeBooksPage/MFreeBook.qml | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/adapters/controllers/free_books_controller.cpp b/src/adapters/controllers/free_books_controller.cpp index f82b8385d..f3edc37ff 100644 --- a/src/adapters/controllers/free_books_controller.cpp +++ b/src/adapters/controllers/free_books_controller.cpp @@ -92,7 +92,11 @@ void FreeBooksController::getBookMedia(const int id, const QString& url) void FreeBooksController::getBookCover(const int id) { +// There is a problem with book covers (jpegs) on linux with Qt 6.5.2, so don't +// load them for now. +#ifdef Q_OS_WIN m_freeBooksService->getBookCover(id); +#endif } void FreeBooksController::deleteBookCover(const int id) diff --git a/src/presentation/freeBooksPage/MFreeBook.qml b/src/presentation/freeBooksPage/MFreeBook.qml index 5f4e28d3e..5fbdfa205 100644 --- a/src/presentation/freeBooksPage/MFreeBook.qml +++ b/src/presentation/freeBooksPage/MFreeBook.qml @@ -71,6 +71,20 @@ Item { source: model.cover fillMode: Image.PreserveAspectFit } + + + /* + The item displaying when no book cover exists (usually a ".format" label) + */ + Label { + id: noImageLabel + Layout.alignment: Qt.AlignCenter + visible: bookCover.source == "" + text: ".jpeg" + color: Style.colorNoImageLabel + font.pointSize: 20 + font.bold: true + } } }