Commit 02ccc337 authored by David Jarvie's avatar David Jarvie
Browse files

Make user settings changes take effect immediately

Fixes regression introduced in version 2.10.11 by commit
7bab5d5b
parent 3ef411b1
KAlarm Change Log
=== Version 2.12.8 (KDE Applications 19.08.3) --- 15 October 2019 ===
=== Version 2.12.8 (KDE Applications 19.08.3) --- 16 October 2019 ===
+ Fix error on redo of an active alarm deletion.
+ Archive repeat-at-login alarms if previously triggered, when they are deleted.
+ Fix layout of defer alarm dialogue.
+ Make user settings changes take effect immediately (fixes regression introduced in 2.10.11).
=== Version 2.12.7 (KDE Applications 19.08.2) --- 7 October 2019 ===
+ Show correct read-only status of an alarm in its context menu.
......
......@@ -73,7 +73,6 @@ bool AlarmCalendar::initialiseCalendars()
dir.mkpath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
QString displayCal = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + displayCalendarName;
AkonadiModel::instance();
CollectionControlModel::setAskDestinationPolicy(Preferences::askResource());
Preferences::setBackend(Preferences::Akonadi);
Preferences::self()->save();
mResourcesCalendar = new AlarmCalendar();
......@@ -134,7 +133,6 @@ AlarmCalendar::AlarmCalendar()
connect(model, &AkonadiModel::eventChanged, this, &AlarmCalendar::slotEventChanged);
connect(model, &AkonadiModel::collectionStatusChanged, this, &AlarmCalendar::slotCollectionStatusChanged);
connect(model, &AkonadiModel::collectionsPopulated, this, &AlarmCalendar::slotCollectionsPopulated);
Preferences::connect(SIGNAL(askResourceChanged(bool)), this, SLOT(setAskResource(bool)));
}
/******************************************************************************
......@@ -405,16 +403,6 @@ void AlarmCalendar::close()
removeKAEvents(mResourceMap.begin().key(), true, CalEvent::ACTIVE | CalEvent::ARCHIVED | CalEvent::TEMPLATE | CalEvent::DISPLAYING);
}
/******************************************************************************
* Update whether to prompt for the resource to store new alarms in.
*/
void AlarmCalendar::setAskResource(bool ask)
{
CollectionControlModel::setAskDestinationPolicy(ask);
}
void AlarmCalendar::updateDisplayKAEvents()
{
if (mCalType == RESOURCES)
......
......@@ -97,7 +97,6 @@ class AlarmCalendar : public QObject
void calendarSaved(AlarmCalendar*);
private Q_SLOTS:
void setAskResource(bool ask);
void slotCollectionStatusChanged(const Akonadi::Collection&, AkonadiModel::Change,
const QVariant& value, bool inserted);
void slotCollectionsPopulated();
......
......@@ -671,7 +671,6 @@ bool CollectionView::viewportEvent(QEvent* e)
=============================================================================*/
CollectionControlModel* CollectionControlModel::mInstance = nullptr;
bool CollectionControlModel::mAskDestination = false;
QHash<QString, CollectionControlModel::ResourceCol> CollectionControlModel::mAgentPaths;
static QRegularExpression matchMimeType(QStringLiteral("^application/x-vnd\\.kde\\.alarm.*"),
......@@ -1231,7 +1230,8 @@ Collection CollectionControlModel::destination(CalEvent::Type type, QWidget* pro
standard = getStandard(type);
// Archived alarms are always saved in the default resource,
// else only prompt if necessary.
if (type == CalEvent::ARCHIVED || noPrompt || (!mAskDestination && standard.isValid()))
if (type == CalEvent::ARCHIVED || noPrompt
|| (!Preferences::askResource() && standard.isValid()))
return standard;
// Prompt for which collection to use
......
......@@ -242,13 +242,6 @@ class CollectionControlModel : public Akonadi::FavoriteCollectionsModel
*/
static void setStandard(Akonadi::Collection&, CalEvent::Types);
/** Set whether the user should be prompted for the destination collection
* to add alarms to.
* @param ask true = prompt for which collection to add to;
* false = add to standard collection.
*/
static void setAskDestinationPolicy(bool ask) { mAskDestination = ask; }
/** Find the collection to be used to store an event of a given type.
* This will be the standard collection for the type, but if this is not valid,
* the user will be prompted to select a collection.
......@@ -321,7 +314,6 @@ class CollectionControlModel : public Akonadi::FavoriteCollectionsModel
: resourceId(r), collectionId(c) {}
};
static QHash<QString, ResourceCol> mAgentPaths; // path, (resource identifier, collection ID) pairs
static bool mAskDestination;
QEventLoop* mPopulatedCheckLoop;
};
......
......@@ -20,9 +20,6 @@
<signal name="autoHideSystemTrayChanged">
<argument type="Int">Base_AutoHideSystemTray</argument>
</signal>
<signal name="askResourceChanged">
<argument type="Bool">AskResource</argument>
</signal>
<signal name="base_TimeZoneChanged">
<argument type="String">Base_TimeZone</argument>
</signal>
......@@ -70,12 +67,12 @@
<entry name="Base_TimeZone" key="TimeZone" type="String">
<label context="@label">Time zone</label>
<whatsthis context="@info:whatsthis">Select the time zone which KAlarm should use as its default for displaying and entering dates and times.</whatsthis>
<!-- <emit signal="base_TimeZoneChanged"/> -->
<emit signal="base_TimeZoneChanged"/>
</entry>
<entry name="Base_HolidayRegion" key="HolidayRegion" type="String">
<label context="@label">Holiday region</label>
<whatsthis context="@info:whatsthis">Select the holiday region to use.</whatsthis>
<!-- <emit signal="base_HolidayRegionChanged"/> -->
<emit signal="base_HolidayRegionChanged"/>
</entry>
<entry name="DefaultFgColour" key="MessageForegroundColour" type="Color">
<label context="@label">Foreground color</label>
......@@ -91,19 +88,19 @@
<label context="@label">Message font</label>
<whatsthis context="@info:whatsthis">Default font for displaying alarm messages.</whatsthis>
<default code="true">QFont(QFontDatabase::systemFont(QFontDatabase::GeneralFont).family(), 16, QFont::Bold)</default>
<!-- <emit signal="messageFontChanged"/> -->
<emit signal="messageFontChanged"/>
</entry>
<entry name="ShowInSystemTray" type="Bool">
<label context="@label">Show in system tray</label>
<whatsthis context="@info:whatsthis">&lt;p>Check to show KAlarm's icon in the system tray. Showing it in the system tray provides easy access and a status indication.&lt;/p></whatsthis>
<default>true</default>
<!-- <emit signal="showInSystemTrayChanged"/>-->
<emit signal="showInSystemTrayChanged"/>-->
</entry>
<entry name="Base_AutoHideSystemTray" key="AutoHideSystemTray" type="Int">
<label context="@label">Auto-hide in system tray if no alarms due within period</label>
<whatsthis context="@info:whatsthis">&lt;p>Enter -1 to auto-hide KAlarm's icon in the system tray when there are no active alarms.&lt;/p>&lt;p>To auto-hide the system tray icon when there are no alarms due within a set period of time, enter the time period in minutes.&lt;/p>&lt;p>Enter 0 to always show the system tray icon.&lt;/p></whatsthis>
<default>1440</default>
<!-- <emit signal="autoHideSystemTrayChanged"/> -->
<emit signal="autoHideSystemTrayChanged"/>
</entry>
<entry name="NoAutoHideSystemTrayDesktops" type="StringList" hidden="true">
<label context="@label">Desktops without auto-hide in system tray</label>
......@@ -128,7 +125,6 @@
<label context="@label">Prompt for which calendar to store in</label>
<whatsthis context="@info:whatsthis">&lt;p>When saving a new alarm or alarm template, prompt for which calendar to store it in, if there is more than one active calendar.&lt;/p>&lt;p>Note that archived alarms are always stored in the default archived alarm calendar.&lt;/p></whatsthis>
<default>true</default>
<!-- <emit signal="askResourceChanged"/> -->
</entry>
<entry name="ModalMessages" type="Bool">
<label context="@label">Message windows have a title bar and take keyboard focus</label>
......@@ -154,26 +150,26 @@
&lt;li>>0 to set a limit.&lt;/li>&lt;/ul>&lt;/p>
</whatsthis>
<default>5</default>
<min>-1</min>
<!-- <emit signal="tooltipPreferencesChanged"/> -->
<!-- <min>-1</min> Can't use 'min' with signal!! -->
<emit signal="tooltipPreferencesChanged"/>
</entry>
<entry name="ShowTooltipAlarmTime" type="Bool">
<label context="@label">Show alarm times in system tray tooltip</label>
<whatsthis context="@info:whatsthis">Specify whether to show in the system tray tooltip, the time at which each alarm is due.</whatsthis>
<default>true</default>
<!-- <emit signal="tooltipPreferencesChanged"/> -->
<emit signal="tooltipPreferencesChanged"/>
</entry>
<entry name="ShowTooltipTimeToAlarm" type="Bool">
<label context="@label">Show time to alarms in system tray tooltip</label>
<whatsthis context="@info:whatsthis">Specify whether to show in the system tray tooltip, how long until each alarm is due.</whatsthis>
<default>true</default>
<!-- <emit signal="tooltipPreferencesChanged"/> -->
<emit signal="tooltipPreferencesChanged"/>
</entry>
<entry name="TooltipTimeToPrefix" type="String">
<label context="@label">Time-to-alarm prefix in system tray tooltip</label>
<whatsthis context="@info:whatsthis">Enter the text to be displayed in front of the time until the alarm, in the system tray tooltip.</whatsthis>
<default code="true">QLatin1String("+")</default>
<!-- <emit signal="tooltipPreferencesChanged"/> -->
<emit signal="tooltipPreferencesChanged"/>
</entry>
<entry name="EmailClient" key="EmailClient" type="Enum">
<label context="@label">Email client</label>
......@@ -207,37 +203,37 @@
<label context="@label">Start of day for date-only alarms</label>
<whatsthis context="@info:whatsthis">The earliest time of day at which a date-only alarm will be triggered.</whatsthis>
<default>QDateTime(QDate(1900,1,1),QTime(0,0))</default>
<!-- <emit signal="base_StartOfDayChanged"/> -->
<emit signal="base_StartOfDayChanged"/>
</entry>
<entry name="Base_WorkDayStart" key="WorkDayStart" type="DateTime">
<label context="@label">Start time of working day</label>
<whatsthis context="@info:whatsthis">The start time of the working day.</whatsthis>
<default>QDateTime(QDate(1900,1,1),QTime(8,0))</default>
<!-- <emit signal="base_WorkTimeChanged"/> -->
<emit signal="base_WorkTimeChanged"/>
</entry>
<entry name="Base_WorkDayEnd" key="WorkDayEnd" type="DateTime">
<label context="@label">End time of working day</label>
<whatsthis context="@info:whatsthis">The end time of the working day.</whatsthis>
<default>QDateTime(QDate(1900,1,1),QTime(17,0))</default>
<!-- <emit signal="base_WorkTimeChanged"/> -->
<emit signal="base_WorkTimeChanged"/>
</entry>
<entry name="Base_WorkDays" key="WorkDays" type="UInt">
<label context="@label">Working days</label>
<whatsthis context="@info:whatsthis">OR'ed bits indicating which days of the week are work days, 1 = Monday ... 64 = Sunday.</whatsthis>
<default code="true">KAlarm::defaultWorkDays()</default>
<!-- <emit signal="base_WorkTimeChanged"/> -->
<emit signal="base_WorkTimeChanged"/>
</entry>
<entry name="DisabledColour" type="Color">
<label context="@label">Disabled alarm color</label>
<whatsthis context="@info:whatsthis">Choose the text color in the alarm list for disabled alarms.</whatsthis>
<default code="true">KColorScheme(QPalette::Disabled).foreground(KColorScheme::InactiveText).color()</default>
<!-- <emit signal="disabledColourChanged"/> -->
<emit signal="disabledColourChanged"/>
</entry>
<entry name="ArchivedColour" key="ExpiredColour" type="Color">
<label context="@label">Archived alarm color</label>
<whatsthis context="@info:whatsthis">Choose the text color in the alarm list for archived alarms.</whatsthis>
<default code="true">KColorScheme(QPalette::Active).foreground(KColorScheme::VisitedText).color()</default>
<!-- <emit signal="archivedColourChanged"/> -->
<emit signal="archivedColourChanged"/>
</entry>
<entry name="ArchivedKeepDays" key="ExpiredKeepDays" type="Int">
<label context="@label">Days to keep expired alarms</label>
......@@ -247,8 +243,8 @@
&lt;li>>0 number of days to keep.&lt;/li>&lt;/ul>&lt;/p>
</whatsthis>
<default>7</default>
<min>-1</min>
<!-- <emit signal="archivedKeepDaysChanged"/> -->
<!-- <min>-1</min> Can't use 'min' with signal!! -->
<emit signal="archivedKeepDaysChanged"/>
</entry>
<entry name="KOrgEventDuration" type="Int">
<label context="@label">KOrganizer event duration</label>
......@@ -357,7 +353,7 @@
<choice name="None"><label context="@option">Do not repeat</label></choice>
</choices>
<default>Mar1</default>
<!-- <emit signal="feb29TypeChanged"/> -->
<emit signal="feb29TypeChanged"/>
</entry>
<entry name="DefaultReminderUnits" key="RemindUnits" type="Enum">
<label context="@label">Reminder units</label>
......
......@@ -6,7 +6,7 @@ Mutators=true
MemberVariables=protected
GlobalEnums=false
UseEnumTypes=true
ItemAccessors=true
ItemAccessors=false
SetUserTexts=true
SourceIncludeFiles=kalarmcal/identities.h
IncludeFiles=kalarm_debug.h
......
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