|
Krita Source Code Documentation
|
#include <KisStorageModel.h>
Inheritance diagram for KisStorageModel:Classes | |
| struct | Private |
Public Types | |
| enum | Columns { Id = 0 , StorageType , Location , TimeStamp , PreInstalled , Active , Thumbnail , DisplayName , MetaData } |
| enum | StorageImportOption { None , Overwrite , Rename } |
Signals | |
| void | storageDisabled (const QString &storage) |
| void | storageEnabled (const QString &storage) |
| void | storageResynchronized (const QString &storage, bool isBulkResynchronization) |
| Emitted when an individual storage is initialized. | |
| void | storagesBulkSynchronizationFinished () |
| Emitted on loading when all the storages are finished initialization. | |
Public Member Functions | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role) const override |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| bool | importStorage (QString filename, StorageImportOption importOption) const |
| KisStorageModel (QObject *parent=0) | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
| Enable and disable the storage represented by index. | |
| KisResourceStorageSP | storageForId (const int storageId) const |
| KisResourceStorageSP | storageForIndex (const QModelIndex &index) const |
| ~KisStorageModel () override | |
Static Public Member Functions | |
| static KisStorageModel * | instance () |
Private Slots | |
| void | addStorage (const QString &location) |
| Called whenever a storage is added. | |
| void | removeStorage (const QString &location) |
| This is called when a storage really is deleted both from database and anywhere else. | |
| void | slotStoragesBulkSynchronizationFinished () |
| called when storages finished synchronization process | |
Private Member Functions | |
| void | resetQuery () |
Static Private Member Functions | |
| static QImage | getThumbnailFromQuery (const QSqlQuery &query) |
Private Attributes | |
| QScopedPointer< Private > | d |
KisStorageModel provides a model of all registered storages, like the folder storages, the bundle storages or the memory storages. Note that inactive storages are also part of this model.
Definition at line 24 of file KisStorageModel.h.
| Enumerator | |
|---|---|
| Id | |
| StorageType | |
| Location | |
| TimeStamp | |
| PreInstalled | |
| Active | |
| Thumbnail | |
| DisplayName | |
| MetaData | |
Definition at line 29 of file KisStorageModel.h.
| Enumerator | |
|---|---|
| None | |
| Overwrite | |
| Rename | |
Definition at line 41 of file KisStorageModel.h.
| KisStorageModel::KisStorageModel | ( | QObject * | parent = 0 | ) |
Definition at line 33 of file KisStorageModel.cpp.
References addStorage(), connect(), KisResourceLocator::instance(), removeStorage(), resetQuery(), slotStoragesBulkSynchronizationFinished(), KisResourceLocator::storageAdded(), KisResourceLocator::storageRemoved(), KisResourceLocator::storageResynchronized(), storageResynchronized(), and KisResourceLocator::storagesBulkSynchronizationFinished().
|
override |
Definition at line 50 of file KisStorageModel.cpp.
|
privateslot |
Called whenever a storage is added.
Definition at line 486 of file KisStorageModel.cpp.
References d, and rowCount().
|
override |
Definition at line 63 of file KisStorageModel.cpp.
References MetaData.
|
override |
Definition at line 116 of file KisStorageModel.cpp.
References Active, d, DisplayName, getThumbnailFromQuery(), Id, KisResourceLocator::instance(), Location, MetaData, KisResourceLocator::metaDataForStorage(), PreInstalled, rowCount(), KisResourceStorage::s_meta_name, KisResourceStorage::s_meta_title, StorageType, Thumbnail, TimeStamp, and v.
|
override |
Definition at line 310 of file KisStorageModel.cpp.
|
staticprivate |
Definition at line 72 of file KisStorageModel.cpp.
References KisResourceThumbnailCache::insert(), KisResourceThumbnailCache::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and KisResourceThumbnailCache::originalImage().
|
override |
Definition at line 454 of file KisStorageModel.cpp.
References Active, DisplayName, Id, Location, PreInstalled, StorageType, Thumbnail, TimeStamp, and v.
| bool KisStorageModel::importStorage | ( | QString | filename, |
| StorageImportOption | importOption ) const |
Definition at line 420 of file KisStorageModel.cpp.
References addStorage(), findUnusedName(), KoResourcePaths::getAppDataLocation(), KisResourceLocator::instance(), KIS_ASSERT, Overwrite, and Rename.
|
static |
Definition at line 45 of file KisStorageModel.cpp.
|
privateslot |
This is called when a storage really is deleted both from database and anywhere else.
Definition at line 493 of file KisStorageModel.cpp.
References d.
|
private |
Definition at line 510 of file KisStorageModel.cpp.
References d.
|
override |
Definition at line 54 of file KisStorageModel.cpp.
References d.
|
override |
Enable and disable the storage represented by index.
Definition at line 271 of file KisStorageModel.cpp.
References data(), Id, Location, storageDisabled(), storageEnabled(), and value().
|
privateslot |
called when storages finished synchronization process
Definition at line 501 of file KisStorageModel.cpp.
References resetQuery(), and storagesBulkSynchronizationFinished().
|
signal |
|
signal |
| KisResourceStorageSP KisStorageModel::storageForId | ( | const int | storageId | ) | const |
Definition at line 330 of file KisStorageModel.cpp.
References KisResourceLocator::instance(), and KisResourceLocator::storageByLocation().
| KisResourceStorageSP KisStorageModel::storageForIndex | ( | const QModelIndex & | index | ) | const |
Definition at line 318 of file KisStorageModel.cpp.
References d, KisResourceLocator::instance(), MetaData, rowCount(), and KisResourceLocator::storageByLocation().
|
signal |
Emitted when an individual storage is initialized.
|
signal |
Emitted on loading when all the storages are finished initialization.
|
private |
Definition at line 95 of file KisStorageModel.h.