CalendarSupport::KCalPrefs Class

The KCalPrefs class. More...

Header: #include <CalendarSupport/KCalPrefs>
CMake: find_package(KPim6CalendarSupport REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::CalendarSupport)

Public Functions

KCalPrefs()
~KCalPrefs()
QStringList allEmails()
Akonadi::Collection::Id defaultEventCalendarId() const
(since 6.9.0) QString defaultEventCalendarPath() const
Akonadi::Collection::Id defaultTodoCalendarId() const
(since 6.9.0) QString defaultTodoCalendarPath() const
QString email()
void fillMailDefaults()
QStringList fullEmails()
QString fullName()
(since 6.8.0) void readPrefs()
(since 6.8.0) bool savePrefs()
(since 6.9.0) void setCollectionModel(QAbstractItemModel *model)
void setDefaultEventCalendarId(Akonadi::Collection::Id)
void setDefaultTodoCalendarId(Akonadi::Collection::Id)
(since 6.8.0) void setPrefsDefaults()
bool thatIsMe(const QString &email)

Static Public Members

CalendarSupport::KCalPrefs *instance()

Detailed Description

Member Function Documentation

KCalPrefs::KCalPrefs()

Constructs a KCalPrefs object. Note: Constructor is disabled for public use. Use instance() to create a KCalPrefs object.

[noexcept] KCalPrefs::~KCalPrefs()

Destroys the KCalPrefs object.

QStringList KCalPrefs::allEmails()

Returns all email addresses for the user.

Akonadi::Collection::Id KCalPrefs::defaultEventCalendarId() const

Gets the collection Id for the default events calendar.

See also setDefaultEventCalendarId().

[since 6.9.0] QString KCalPrefs::defaultEventCalendarPath() const

Returns the stable remote path persisted for the default events calendar (empty if none).

This function was introduced in 6.9.0.

Akonadi::Collection::Id KCalPrefs::defaultTodoCalendarId() const

Gets the collection Id for the default todo calendar.

See also setDefaultTodoCalendarId().

[since 6.9.0] QString KCalPrefs::defaultTodoCalendarPath() const

Returns the stable remote path persisted for the default todo calendar (empty if none).

This function was introduced in 6.9.0.

QString KCalPrefs::email()

Gets the email address from preferences. Returns The email address.

void KCalPrefs::fillMailDefaults()

Fills empty mail fields with default values.

QStringList KCalPrefs::fullEmails()

Returns all email addresses together with the full username for the user.

QString KCalPrefs::fullName()

Gets the full name from preferences. Returns The full name.

[static] CalendarSupport::KCalPrefs *KCalPrefs::instance()

Gets the singleton instance of KCalPrefs. Returns The singleton instance of KCalPrefs.

[since 6.8.0] void KCalPrefs::readPrefs()

Reads preferences from the configuration file.

This function was introduced in 6.8.0.

[since 6.8.0] bool KCalPrefs::savePrefs()

Writes preferences to the configuration file. Returns true if successful, false otherwise.

This function was introduced in 6.8.0.

[since 6.9.0] void KCalPrefs::setCollectionModel(QAbstractItemModel *model)

Sets the collection model (an EntityTreeModel or a proxy on top of one) used to resolve the default calendars, which are persisted by stable remote path rather than by numeric id.

Each application that reads the default calendars must call this once, when its calendar is available. The default-calendar ids are then resolved from the stored paths against model (and a legacy numeric id is migrated to a path). Without a model the ids resolve to -1, just as they did before the calendar was loaded.

This function was introduced in 6.9.0.

void KCalPrefs::setDefaultEventCalendarId(Akonadi::Collection::Id)

Sets the collection Id for the events calendar.

See also defaultEventCalendarId().

void KCalPrefs::setDefaultTodoCalendarId(Akonadi::Collection::Id)

Sets the collection Id for the todo calendar.

See also defaultTodoCalendarId().

[since 6.8.0] void KCalPrefs::setPrefsDefaults()

Sets preferences to their default values.

This function was introduced in 6.8.0.

bool KCalPrefs::thatIsMe(const QString &email)

fullName Returns true if the given email belongs to the user