[-]
[+]
|
Changed |
_service:tar_git:openrepos-books.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-books.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://github.com/monich/harbour-books.git</param>
<param name="branch">master</param>
- <param name="revision">74b666e</param>
+ <param name="revision">06ff22f</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-books-1.1.5.tar.gz/app/qml/Books.js
^
|
@@ -1,6 +1,6 @@
.pragma library
-var version = "1.1.4"
+var version = "1.1.5"
function contentOpacity(brightness) {
return 0.4 + brightness * 0.6
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-books-1.1.5.tar.gz/app/qml/BooksCoverPage.qml
^
|
@@ -1,6 +1,6 @@
/*
- Copyright (C) 2015-2021 Jolla Ltd.
- Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
+ Copyright (C) 2015-2022 Jolla Ltd.
+ Copyright (C) 2015-2022 Slava Monich <slava.monich@jolla.com>
You may use this file under the terms of the BSD license as follows:
@@ -38,10 +38,10 @@
id: root
transparent: !_haveBook || grid.count < 6
- property variant book
- property variant shelf
+ property var book
+ property var shelf
- property bool _haveBook: book ? true : false
+ readonly property bool _haveBook: book ? true : false
CoverModel {
id: coverModel
@@ -105,7 +105,7 @@
fill: parent
}
text: book ? book.title : ""
- visible: bookCover.empty
- color: "#FFE898"
+ visible: book && !book.hasCover
+ color: "#ffe898" // Derived from the default cover image
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-books-1.1.5.tar.gz/app/src/BooksBook.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2015-2021 Jolla Ltd.
- * Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2015-2022 Jolla Ltd.
+ * Copyright (C) 2015-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -71,9 +71,9 @@
public:
CoverPaintContext();
- void drawImage(int x, int y, const ZLImageData& image);
- void drawImage(int x, int y, const ZLImageData& image, int width, int height, ScalingType type);
- void handleImage(const ZLImageData& image);
+ void drawImage(int, int, const ZLImageData&) Q_DECL_OVERRIDE;
+ void drawImage(int, int, const ZLImageData&, int, int, ScalingType) Q_DECL_OVERRIDE;
+ void handleImage(const ZLImageData&);
bool gotIt() const;
public:
@@ -532,11 +532,15 @@
return iCoverImage.width() > 0 && iCoverImage.height() > 0;
}
-void BooksBook::setCoverImage(QImage aImage)
+void BooksBook::setCoverImage(const QImage aImage)
{
if (iCoverImage != aImage) {
+ const bool hadCover = hasCoverImage();
iCoverImage = aImage;
Q_EMIT coverImageChanged();
+ if (hadCover != hasCoverImage()) {
+ Q_EMIT hasCoverChanged();
+ }
}
}
@@ -568,8 +572,7 @@
HDEBUG(iTitle << iCoverTask->hasImage());
const bool gotCover = iCoverTask->hasImage();
if (gotCover) {
- iCoverImage = iCoverTask->iCoverImage;
- Q_EMIT coverImageChanged();
+ setCoverImage(iCoverTask->iCoverImage);
}
iCoverTask->release(this);
iCoverTask = NULL;
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-books-1.1.5.tar.gz/app/src/BooksBook.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2015-2021 Jolla Ltd.
- * Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2015-2022 Jolla Ltd.
+ * Copyright (C) 2015-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -47,7 +47,9 @@
#include <QImage>
#include <QtQml>
-class BooksBook : public QObject, public BooksItem
+class BooksBook :
+ public QObject,
+ public BooksItem
{
class HashTask;
class CoverTask;
@@ -63,6 +65,7 @@
Q_PROPERTY(BooksBook* book READ book CONSTANT)
Q_PROPERTY(bool accessible READ accessible NOTIFY accessibleChanged)
Q_PROPERTY(bool loadingCover READ loadingCover NOTIFY loadingCoverChanged)
+ Q_PROPERTY(bool hasCover READ hasCoverImage NOTIFY hasCoverChanged)
Q_PROPERTY(bool copyingOut READ copyingOut NOTIFY copyingOutChanged)
Q_PROPERTY(bool fontSizeAdjust READ fontSizeAdjust WRITE setFontSizeAdjust NOTIFY fontSizeAdjustChanged)
@@ -80,7 +83,7 @@
QString authors() const;
QByteArray hash() const;
int fontSizeAdjust() const;
- bool setFontSizeAdjust(int aFontSizeAdjust);
+ bool setFontSizeAdjust(int);
int pageStackPos() const;
BooksPos::List pageStack() const;
void setPageStack(BooksPos::List aStack, int aStackPos);
@@ -92,25 +95,25 @@
bool hasCoverImage() const;
bool requestCoverImage();
void cancelCoverRequest();
- void setCoverImage(QImage aImage);
+ void setCoverImage(const QImage);
QImage coverImage() const;
- void setCopyingOut(bool aValue);
+ void setCopyingOut(bool);
// BooksItem
- virtual BooksItem* retain();
- virtual void release();
- virtual QObject* object();
- virtual BooksShelf* shelf();
- virtual BooksBook* book();
- virtual QString name() const;
- virtual QString fileName() const;
- virtual QString path() const;
- virtual bool accessible() const;
- virtual void deleteFiles();
- virtual BooksItem* copyTo(const BooksStorage& aStorage, QString aRelPath,
- CopyOperation* aObserver);
+ BooksItem* retain() Q_DECL_OVERRIDE;
+ void release() Q_DECL_OVERRIDE;
+ QObject* object() Q_DECL_OVERRIDE;
+ BooksShelf* shelf() Q_DECL_OVERRIDE;
+ BooksBook* book() Q_DECL_OVERRIDE;
+ QString name() const Q_DECL_OVERRIDE;
+ QString fileName() const Q_DECL_OVERRIDE;
+ QString path() const Q_DECL_OVERRIDE;
+ bool accessible() const Q_DECL_OVERRIDE;
+ void deleteFiles() Q_DECL_OVERRIDE;
+ BooksItem* copyTo(const BooksStorage&, QString, CopyOperation*) Q_DECL_OVERRIDE;
Q_SIGNALS:
+ void hasCoverChanged();
void coverImageChanged();
void loadingCoverChanged();
void accessibleChanged();
@@ -128,10 +131,10 @@
private:
void init();
bool coverTaskDone();
- bool makeLink(QString aDestPath);
+ bool makeLink(QString);
void requestSave();
QString cachedImagePath() const;
- static bool isCanceled(CopyOperation* aOperation);
+ static bool isCanceled(CopyOperation*);
private:
QAtomicInt iRef;
|