|
Krita Source Code Documentation
|
#include <KisRecentDocumentsModelWrapper.h>
Inheritance diagram for KisRecentDocumentsModelWrapper:Signals | |
| void | sigModelIsUpToDate () |
Public Member Functions | |
| QStandardItemModel & | model () |
Static Public Member Functions | |
| static KisRecentDocumentsModelWrapper * | instance () |
Static Public Attributes | |
| static constexpr const int | ICON_SIZE_LENGTH = 200 |
Private Slots | |
| void | fileAdded (const QUrl &url) |
| void | fileRemoved (const QUrl &url) |
| void | listRenewed () |
| void | slotFileIconChanged (const QUrl &url, const QIcon &icon) |
Private Member Functions | |
| KisRecentDocumentsModelWrapper () | |
| void | setFiles (const QList< QUrl > &urls) |
| ~KisRecentDocumentsModelWrapper () | |
Private Attributes | |
| QStandardItemModel | m_filesAndThumbnailsModel |
This singleton class provides a QStandardItemModel representing the recent files list and also supports lazy-loading of the file thumbnail icons. Each recent file entry is represented as a QStandardItem. When QStandardItem::icon() is called for the first time, it fetches the icon via KisRecentFileIconCache, which triggers loading the file icon in background if it hasn't already been loaded and cached.
See also KisRecentFilesManager.
Definition at line 26 of file KisRecentDocumentsModelWrapper.h.
|
private |
Definition at line 113 of file KisRecentDocumentsModelWrapper.cpp.
References connect(), fileAdded(), fileRemoved(), KisRecentFileIconCache::instance(), KisRecentFilesManager::instance(), listRenewed(), and slotFileIconChanged().
|
private |
Definition at line 132 of file KisRecentDocumentsModelWrapper.cpp.
|
privateslot |
Definition at line 169 of file KisRecentDocumentsModelWrapper.cpp.
References m_filesAndThumbnailsModel, and sigModelIsUpToDate().
|
privateslot |
Definition at line 175 of file KisRecentDocumentsModelWrapper.cpp.
References m_filesAndThumbnailsModel, and sigModelIsUpToDate().
|
static |
Definition at line 134 of file KisRecentDocumentsModelWrapper.cpp.
|
privateslot |
Definition at line 188 of file KisRecentDocumentsModelWrapper.cpp.
References KisRecentFilesManager::instance(), and setFiles().
| QStandardItemModel & KisRecentDocumentsModelWrapper::model | ( | ) |
Get underlying model
No need for any extra setup. This will hold the provided files
Definition at line 193 of file KisRecentDocumentsModelWrapper.cpp.
References m_filesAndThumbnailsModel.
Update m_filesAndThumbnailsModel and launch worker thread to fetch icons in background
Definition at line 144 of file KisRecentDocumentsModelWrapper.cpp.
References m_filesAndThumbnailsModel, and sigModelIsUpToDate().
|
signal |
Report when the model has been updated with the latest recent file list.
|
privateslot |
Definition at line 157 of file KisRecentDocumentsModelWrapper.cpp.
References m_filesAndThumbnailsModel.
|
staticconstexpr |
Definition at line 30 of file KisRecentDocumentsModelWrapper.h.
|
private |
Definition at line 52 of file KisRecentDocumentsModelWrapper.h.