Changeset View
Changeset View
Standalone View
Standalone View
src/qtquick/FolderBookModel.h
Show All 17 Lines | |||||
18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | * | 19 | * | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef FOLDERBOOKMODEL_H | 22 | #ifndef FOLDERBOOKMODEL_H | ||
23 | #define FOLDERBOOKMODEL_H | 23 | #define FOLDERBOOKMODEL_H | ||
24 | 24 | | |||
25 | #include "BookModel.h" | 25 | #include "BookModel.h" | ||
26 | 26 | /** | |||
27 | * \brief Class to handle a folder of images as a book. | ||||
28 | * | ||||
29 | * This class will treat a folder of images as a book, with the alphabetical | ||||
30 | * order of the files determining the page order. | ||||
31 | */ | ||||
27 | class FolderBookModel : public BookModel | 32 | class FolderBookModel : public BookModel | ||
leinir: A touch implementation-specific, there... this is how /all/ books remember the current page… | |||||
I have to admit I had trouble with this, because I couldn't figure out how to open a folder of images as a book on my device... woltherav: I have to admit I had trouble with this, because I couldn't figure out how to open a folder of… | |||||
28 | { | 33 | { | ||
29 | Q_OBJECT | 34 | Q_OBJECT | ||
30 | public: | 35 | public: | ||
31 | explicit FolderBookModel(QObject* parent = nullptr); | 36 | explicit FolderBookModel(QObject* parent = nullptr); | ||
32 | ~FolderBookModel() override; | 37 | ~FolderBookModel() override; | ||
33 | 38 | | |||
39 | /** | ||||
40 | * \brief Set the folder name of this book or a file describing | ||||
41 | * describing the images that belong to this book. | ||||
42 | */ | ||||
"or alternatively the name of a file inside the folder containing the images making up the book" (it supports both) leinir: "or alternatively the name of a file inside the folder containing the images making up the… | |||||
34 | void setFilename(QString newFilename) override; | 43 | void setFilename(QString newFilename) override; | ||
35 | }; | 44 | }; | ||
36 | 45 | | |||
37 | #endif//FOLDERBOOKMODEL_H | 46 | #endif//FOLDERBOOKMODEL_H |
A touch implementation-specific, there... this is how /all/ books remember the current page, though, so if it needs mentioning, it needs to go in the book model's setCurrentPage function (which specifically has a flag to update the filesystem, which then uses KFileMetaData to store that information using xattr)