akonadi
#include <favoritecollectionsmodel.h>
Public Slots | |
void | addCollection (const Collection &collection) |
void | removeCollection (const Collection &collection) |
void | setCollections (const Collection::List &collections) |
void | setFavoriteLabel (const Collection &collection, const QString &label) |
Public Member Functions | |
FavoriteCollectionsModel (QAbstractItemModel *model, const KConfigGroup &group, QObject *parent=0) | |
virtual | ~FavoriteCollectionsModel () |
QList< Collection::Id > | collectionIds () const |
Collection::List | collections () const |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
virtual bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
QString | favoriteLabel (const Akonadi::Collection &col) |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
virtual QStringList | mimeTypes () const |
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
Public Member Functions inherited from Akonadi::SelectionProxyModel | |
SelectionProxyModel (QItemSelectionModel *selectionModel, QObject *parent=0) | |
Detailed Description
A model that lists a set of favorite collections.
In some applications you want to provide fast access to a list of often used collections (e.g. Inboxes from different email accounts in a mail application). Therefor you can use the FavoriteCollectionsModel which stores the list of favorite collections in a given configuration file.
Example:
- Since
- 4.4
Definition at line 66 of file favoritecollectionsmodel.h.
Constructor & Destructor Documentation
FavoriteCollectionsModel::FavoriteCollectionsModel | ( | QAbstractItemModel * | model, |
const KConfigGroup & | group, | ||
QObject * | parent = 0 |
||
) |
Creates a new favorite collections model.
- Parameters
-
model The source model where the favorite collections come from. group The config group that shall be used to save the selection of favorite collections. parent The parent object.
Definition at line 256 of file favoritecollectionsmodel.cpp.
|
virtual |
Destroys the favorite collections model.
Definition at line 275 of file favoritecollectionsmodel.cpp.
Member Function Documentation
|
slot |
Adds a collection
to the list of favorite collections.
Definition at line 286 of file favoritecollectionsmodel.cpp.
QList< Collection::Id > FavoriteCollectionsModel::collectionIds | ( | ) | const |
Returns the list of ids of favorite collections set on the FavoriteCollectionsModel.
Note that if you want Collections with actual data you should use something like this instead:
Note that due to the asynchronous nature of the model, this method returns collection ids of collections which may not be in the model yet. If you want the ids of the collections that are actually in the model, use a loop similar to above with the CollectionIdRole.
Definition at line 309 of file favoritecollectionsmodel.cpp.
Akonadi::Collection::List FavoriteCollectionsModel::collections | ( | ) | const |
Returns the list of favorite collections.
- Deprecated:
- Use collectionIds instead.
Definition at line 298 of file favoritecollectionsmodel.cpp.
QString Akonadi::FavoriteCollectionsModel::favoriteLabel | ( | const Akonadi::Collection & | col | ) |
Return associate label for collection.
Definition at line 360 of file favoritecollectionsmodel.cpp.
|
slot |
Removes a collection
from the list of favorite collections.
Definition at line 292 of file favoritecollectionsmodel.cpp.
|
slot |
Sets the collections
as favorite collections.
Definition at line 280 of file favoritecollectionsmodel.cpp.
|
slot |
Sets a custom label
that will be used when showing the favorite collection
.
Definition at line 314 of file favoritecollectionsmodel.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:04 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.