|
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 | |
| bool | canImportStorage (const QString &filename) const |
| 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 (const QString &filename, StorageImportOption importOption) const |
| bool | importStorageData (const QString &filename, StorageImportOption importOption, const QByteArray &data) 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) |
| static bool | importStorageInternal (const QString &filename, StorageImportOption importOption, bool dryRun, const QByteArray &data) |
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 34 of file KisStorageModel.cpp.
References addStorage(), KisResourceLocator::instance(), removeStorage(), resetQuery(), slotStoragesBulkSynchronizationFinished(), KisResourceLocator::storageAdded(), KisResourceLocator::storageRemoved(), KisResourceLocator::storageResynchronized(), storageResynchronized(), and KisResourceLocator::storagesBulkSynchronizationFinished().
|
override |
Definition at line 51 of file KisStorageModel.cpp.
|
privateslot |
Called whenever a storage is added.
Definition at line 525 of file KisStorageModel.cpp.
References d, and rowCount().
| bool KisStorageModel::canImportStorage | ( | const QString & | filename | ) | const |
Definition at line 433 of file KisStorageModel.cpp.
References importStorageInternal(), and None.
|
override |
Definition at line 64 of file KisStorageModel.cpp.
References MetaData.
|
override |
Definition at line 117 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 311 of file KisStorageModel.cpp.
|
staticprivate |
Definition at line 73 of file KisStorageModel.cpp.
References KisResourceThumbnailCache::insert(), KisResourceThumbnailCache::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and KisResourceThumbnailCache::originalImage().
|
override |
Definition at line 493 of file KisStorageModel.cpp.
References Active, DisplayName, Id, Location, PreInstalled, StorageType, Thumbnail, TimeStamp, and v.
| bool KisStorageModel::importStorage | ( | const QString & | filename, |
| StorageImportOption | importOption ) const |
Definition at line 421 of file KisStorageModel.cpp.
References importStorageInternal().
| bool KisStorageModel::importStorageData | ( | const QString & | filename, |
| StorageImportOption | importOption, | ||
| const QByteArray & | data ) const |
Definition at line 426 of file KisStorageModel.cpp.
References data(), and importStorageInternal().
|
staticprivate |
Definition at line 438 of file KisStorageModel.cpp.
References addStorage(), data(), findUnusedName(), KoResourcePaths::getAppDataLocation(), KisResourceLocator::instance(), KIS_ASSERT, Overwrite, and Rename.
|
static |
Definition at line 46 of file KisStorageModel.cpp.
|
privateslot |
This is called when a storage really is deleted both from database and anywhere else.
Definition at line 532 of file KisStorageModel.cpp.
References d.
|
private |
Definition at line 549 of file KisStorageModel.cpp.
References d.
|
override |
Definition at line 55 of file KisStorageModel.cpp.
References d.
|
override |
Enable and disable the storage represented by index.
Definition at line 272 of file KisStorageModel.cpp.
References data(), Id, Location, storageDisabled(), storageEnabled(), and value().
|
privateslot |
called when storages finished synchronization process
Definition at line 540 of file KisStorageModel.cpp.
References resetQuery(), and storagesBulkSynchronizationFinished().
|
signal |
|
signal |
| KisResourceStorageSP KisStorageModel::storageForId | ( | const int | storageId | ) | const |
Definition at line 331 of file KisStorageModel.cpp.
References KisResourceLocator::instance(), and KisResourceLocator::storageByLocation().
| KisResourceStorageSP KisStorageModel::storageForIndex | ( | const QModelIndex & | index | ) | const |
Definition at line 319 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 102 of file KisStorageModel.h.