Commit a5908c1f authored by Allen Winter's avatar Allen Winter
Browse files

incidencedialog.cpp - default collection for initial calendar

forget about using the last selected calendar and always start
a new incidence with the default calendar.

this gives us consistent behavior and reduces the chances of
creating incidences in the wrong calendar.

CCBUG: 369570

Differential Revision: https://phabricator.kde.org/D27762
parent 729c12d2
......@@ -182,8 +182,8 @@ IncidenceDialogPrivate::IncidenceDialogPrivate(Akonadi::IncidenceChanger *change
mIeResource = new IncidenceResource(mIeAttendee, mIeDateTime, mUi);
mEditor->combine(mIeResource);
// Select calendar to last collection used, if valid; else select the default collection
const qint64 colId = IncidenceEditorNG::IncidenceEditorSettings::self()->lastSelectedFolder();
// Set the default collection
const qint64 colId = CalendarSupport::KCalPrefs::instance()->defaultCalendarId();
const Akonadi::Collection col(colId);
setCalendarCollection(col);
......@@ -226,15 +226,7 @@ void IncidenceDialogPrivate::setCalendarCollection(const Akonadi::Collection &co
if (collection.isValid()) {
mCalSelector->setDefaultCollection(collection);
} else {
// fallback to default collection
const qint64 defColId = CalendarSupport::KCalPrefs::instance()->defaultCalendarId();
const Akonadi::Collection defCol(defColId);
if (defCol.isValid()) {
mCalSelector->setDefaultCollection(defCol);
} else {
// Give up and use the first item in the selector
mCalSelector->setCurrentIndex(0);
}
mCalSelector->setCurrentIndex(0);
}
}
......
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