Akonadi Calendar
collectioncalendar.cpp
95 connect(m_model, &QAbstractItemModel::rowsInserted, this, [this](const QModelIndex &parent, int first, int last) {
108 // If rows are about to be moved from collection we monitor, it's like removal from our point of view.
116 connect(m_model, &QAbstractItemModel::rowsMoved, this, [this](const QModelIndex &parent, int start, int end, const QModelIndex &newParent, int row) {
119 // Rows being moved from the collection we monitor is handled in rowsAboutToBeRemoved signal handler.
126 connect(m_model, &QAbstractItemModel::rowsAboutToBeRemoved, this, [this](const QModelIndex &parent, int first, int last) {
133 connect(m_model, &QAbstractItemModel::dataChanged, this, [this](const QModelIndex &topLeft, const QModelIndex &bottomRight) {
154 connect(m_model, &QAbstractItemModel::layoutChanged, this, &CollectionCalendarPrivate::populateFromETM);
193 IncidenceBase::Ptr existingIncidence = q->incidence(newIncidence->uid(), newIncidence->recurrenceId());
212 qCDebug(AKONADICALENDAR_LOG) << "CollectionCalendar not populating from ETM - already populated";
218 qCDebug(AKONADICALENDAR_LOG) << "CollectionCalendar not populating from ETM - collection tree not fetched";
223 qCDebug(AKONADICALENDAR_LOG) << "CollectionCalendar not populating from ETM - target collection not populated yet";
233 qCDebug(AKONADICALENDAR_LOG) << "CollectionCalendar failed to populate from ETM - couldn't find model index for our Collection"
253 qCDebug(AKONADICALENDAR_LOG) << "CollectionCalendar for Collection" << m_collection.id() << "populated from ETM with" << itemCount << "incidences";
287CollectionCalendar::CollectionCalendar(QAbstractItemModel *model, const Akonadi::Collection &col, QObject *parent)
311 qCWarning(AKONADICALENDAR_LOG) << "Cannot change collection of CollectionCalendar at runtime yet, sorry.";
316 setAccessMode((c.rights() & (Akonadi::Collection::CanCreateItem | Akonadi::Collection::CanChangeItem)) ? KCalendarCore::ReadWrite
331 if (d->m_collection.contentMimeTypes().contains(event->mimeType()) || d->m_collection.contentMimeTypes().contains("text/calendar"_L1)) {
341 if (d->m_collection.contentMimeTypes().contains(todo->mimeType()) || d->m_collection.contentMimeTypes().contains("text/calendar"_L1)) {
351 if (d->m_collection.contentMimeTypes().contains(journal->mimeType()) || d->m_collection.contentMimeTypes().contains("text/calendar"_L1)) {
360 const auto fullCollection = Akonadi::EntityTreeModel::updatedCollection(d->m_model, d->m_collection);
bool addEvent(const KCalendarCore::Event::Ptr &event) override
Adds an Event to the calendar.
Definition calendarbase.cpp:543
bool addTodo(const KCalendarCore::Todo::Ptr &todo) override
Adds a Todo to the calendar.
Definition calendarbase.cpp:553
bool addJournal(const KCalendarCore::Journal::Ptr &journal) override
Adds a Journal to the calendar.
Definition calendarbase.cpp:563
void endBatchAdding() override
Tells the Calendar that you stopped adding a batch of incidences.
Definition calendarbase.cpp:644
Akonadi::Item::List items(Akonadi::Collection::Id=-1) const
Returns the list of items contained in this calendar that belong to the specified collection.
Definition calendarbase.cpp:437
void startBatchAdding() override
Call this to tell the calendar that you're adding a batch of incidences.
Definition calendarbase.cpp:639
Calendar representing a single Akonadi::Collection.
Definition collectioncalendar.h:23
bool addJournal(const KCalendarCore::Journal::Ptr &journal) override
Adds a Journal to the calendar.
Definition collectioncalendar.cpp:347
bool addEvent(const KCalendarCore::Event::Ptr &event) override
Adds an Event to the calendar.
Definition collectioncalendar.cpp:327
bool addTodo(const KCalendarCore::Todo::Ptr &todo) override
Adds a Todo to the calendar.
Definition collectioncalendar.cpp:337
bool isValid() const
Rights rights() const
CanCreateItem
CanChangeItem
Id id() const
bool isCollectionPopulated(Akonadi::Collection::Id) const
static Collection updatedCollection(const QAbstractItemModel *model, qint64 collectionId)
static QModelIndex modelIndexForCollection(const QAbstractItemModel *model, const Collection &collection)
bool isCollectionTreeFetched() const
CollectionIdRole
void setCacheOnly(bool cacheOnly)
void setAncestorRetrieval(AncestorRetrieval ancestorDepth)
void fetchFullPayload(bool fetch=true)
void setMimeTypeMonitored(const QString &mimetype, bool monitored=true)
ItemFetchScope & itemFetchScope()
void setCollectionMonitored(const Collection &collection, bool monitored=true)
Incidence::Ptr incidence(const QString &uid, const QDateTime &recurrenceId={}) const
void setIsLoading(bool isLoading)
void setAccessMode(const AccessMode mode)
void setName(const QString &name)
static QStringList mimeTypes()
Todo::Ptr todo(const QString &uid, const QDateTime &recurrenceId={}) const override
Event::Ptr event(const QString &uid, const QDateTime &recurrenceId={}) const override
Journal::Ptr journal(const QString &uid, const QDateTime &recurrenceId={}) const override
Q_SCRIPTABLE Q_NOREPLY void start()
AKONADI_CALENDAR_EXPORT KCalendarCore::Incidence::Ptr incidence(const Akonadi::Item &item)
Returns the incidence from an Akonadi item, or a null pointer if the item has no such payload.
Definition calendarutils.cpp:28
AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection)
Returns a suitable display name for the calendar (or calendar folder) collection.
Definition calendarutils.cpp:206
FreeBusyManager::Singleton.
virtual QVariant data(const QModelIndex &index, int role) const const=0
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
void layoutChanged(const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
void modelReset()
void rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
void rowsInserted(const QModelIndex &parent, int first, int last)
void rowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
iterator insert(const Key &key, const T &value)
bool remove(const Key &key)
T value(const Key &key) const const
QModelIndex parent() const const
int row() const const
QString number(double n, char format, int precision)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
qlonglong toLongLong(bool *ok) const const
T value() const const
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.