Commit bb8a5478 authored by David Faure's avatar David Faure
Browse files

IncidenceChanger: add getter/setter for ETM

This allows korganizer to provide an ETM, and IncidenceEditor to use it
for the Collection combobox. As a result, that combo is populated right
away when the incidence dialog shows up, rather than the user having to
wait for it to populate before being able to press Apply or OK.

Test Plan: works, together with a change in incidenceeditor and in korganizer.

Reviewers: vkrause, mlaurent, winterz

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision:
parent c3d224b5
cmake_minimum_required(VERSION 3.5)
set(PIM_VERSION "5.14.40")
set(PIM_VERSION "5.14.41")
project(Akonadi-Calendar VERSION ${PIM_VERSION})
# ECM setup
......@@ -1128,6 +1128,16 @@ IncidenceChanger::DestinationPolicy IncidenceChanger::destinationPolicy() const
return d->mDestinationPolicy;
void IncidenceChanger::setEntityTreeModel(Akonadi::EntityTreeModel *entityTreeModel)
d->mEntityTreeModel = entityTreeModel;
Akonadi::EntityTreeModel *IncidenceChanger::entityTreeModel() const
return d->mEntityTreeModel;
void IncidenceChanger::setDefaultCollection(const Akonadi::Collection &collection)
d->mDefaultCollection = collection;
......@@ -31,6 +31,7 @@
#include <QWidget>
namespace Akonadi {
class EntityTreeModel;
* @short IncidenceChanger is the preferred way to easily create, modify and delete incidences.
......@@ -241,6 +242,17 @@ public:
void endAtomicOperation();
* Sets the base ETM tree model
* Used by the editor dialog's collection combobox, for instance.
void setEntityTreeModel(Akonadi::EntityTreeModel *model);
* Returns the base ETM tree model
Akonadi::EntityTreeModel *entityTreeModel() const;
* Sets the default collection.
* @param collection The collection to be used in createIncidence() if the
......@@ -314,6 +314,7 @@ public:
QHash<const KJob *, Change::Ptr> mChangeForJob;
bool mShowDialogsOnError = false;
Akonadi::Collection mDefaultCollection;
Akonadi::EntityTreeModel *mEntityTreeModel = nullptr;
DestinationPolicy mDestinationPolicy;
QVector<Akonadi::Item::Id> mDeletedItemIds;
Change::List mPendingCreations; // Creations waiting for collections to be loaded
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment