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
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
static Collection updatedCollection(const QAbstractItemModel *model, qint64 collectionId)
static QModelIndex modelIndexForCollection(const QAbstractItemModel *model, const Collection &collection)
CollectionIdRole
void setAccessMode(const AccessMode mode)
void setName(const QString &name)
QSharedPointer< Event > Ptr
QSharedPointer< IncidenceBase > Ptr
static QStringList mimeTypes()
QSharedPointer< Incidence > Ptr
QSharedPointer< Journal > Ptr
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
QSharedPointer< Todo > Ptr
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.
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
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)
QModelIndex parent() const const
int row() const const
QString number(double n, char format, int precision)
QTextStream & right(QTextStream &stream)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:53:46 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:53:46 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.