Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KAlarm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
KAlarm
Commits
69737270
Commit
69737270
authored
Oct 06, 2011
by
David Jarvie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Purge archived calendar if needed, after setting new default calendar
parent
dcf71d34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
kalarmapp.cpp
kalarmapp.cpp
+4
-6
kalarmapp.h
kalarmapp.h
+1
-1
resourceselector.cpp
resourceselector.cpp
+7
-1
No files found.
kalarmapp.cpp
View file @
69737270
...
...
@@ -157,7 +157,7 @@ KAlarmApp::KAlarmApp()
#ifdef USE_AKONADI
connect
(
AlarmCalendar
::
resources
(),
SIGNAL
(
atLoginEventAdded
(
KAEvent
)),
SLOT
(
atLoginEventAdded
(
KAEvent
)));
connect
(
AkonadiModel
::
instance
(),
SIGNAL
(
collectionAdded
(
Akonadi
::
Collection
)),
SLOT
(
slotCollectionAdded
(
Akonadi
::
Collection
)));
SLOT
(
purgeNewArchivedDefault
(
Akonadi
::
Collection
)));
#endif
KConfigGroup
config
(
KGlobal
::
config
(),
"General"
);
...
...
@@ -1033,10 +1033,11 @@ bool KAlarmApp::wantShowInSystemTray() const
#ifdef USE_AKONADI
/******************************************************************************
* Called when a new collection has been added.
* Called when a new collection has been added, or when a collection has been
* set as the standard collection for its type.
* If it is the default archived calendar, purge its old alarms if necessary.
*/
void
KAlarmApp
::
slotCollectionAdded
(
const
Akonadi
::
Collection
&
collection
)
void
KAlarmApp
::
purgeNewArchivedDefault
(
const
Akonadi
::
Collection
&
collection
)
{
Akonadi
::
Collection
col
(
collection
);
if
(
CollectionControlModel
::
isStandard
(
col
,
KAlarm
::
CalEvent
::
ARCHIVED
))
...
...
@@ -1055,9 +1056,6 @@ void KAlarmApp::slotCollectionAdded(const Akonadi::Collection& collection)
*/
void
KAlarmApp
::
purgeAfterDelay
()
{
#ifdef __GNUC__
#warning Purge after selecting a new default archived calendar
#endif
if
(
mArchivedPurgeDays
>=
0
)
purge
(
mArchivedPurgeDays
);
else
...
...
kalarmapp.h
View file @
69737270
...
...
@@ -101,6 +101,7 @@ class KAlarmApp : public KUniqueApplication
void
processQueue
();
void
setAlarmsEnabled
(
bool
);
#ifdef USE_AKONADI
void
purgeNewArchivedDefault
(
const
Akonadi
::
Collection
&
);
void
atLoginEventAdded
(
const
KAEvent
&
);
#endif
void
stopAudio
();
...
...
@@ -133,7 +134,6 @@ class KAlarmApp : public KUniqueApplication
void
setArchivePurgeDays
();
void
slotPurge
()
{
purge
(
mArchivedPurgeDays
);
}
#ifdef USE_AKONADI
void
slotCollectionAdded
(
const
Akonadi
::
Collection
&
);
void
purgeAfterDelay
();
#endif
void
slotCommandExited
(
ShellProcess
*
);
...
...
resourceselector.cpp
View file @
69737270
...
...
@@ -30,6 +30,7 @@
#ifdef USE_AKONADI
#include "akonadiresourcecreator.h"
#include "calendarmigrator.h"
#include "kalarmapp.h"
#else
#include "alarmresources.h"
#include "eventlistmodel.h"
...
...
@@ -677,7 +678,10 @@ void ResourceSelector::archiveDaysChanged(int days)
{
Collection
::
List
cols
=
CollectionControlModel
::
enabledCollections
(
KAlarm
::
CalEvent
::
ARCHIVED
,
true
);
if
(
cols
.
count
()
==
1
)
CollectionControlModel
::
setStandard
(
cols
[
1
],
KAlarm
::
CalEvent
::
ARCHIVED
);
{
CollectionControlModel
::
setStandard
(
cols
[
0
],
KAlarm
::
CalEvent
::
ARCHIVED
);
theApp
()
->
purgeNewArchivedDefault
(
cols
[
0
]);
}
}
#else
AlarmResources
*
resources
=
AlarmResources
::
instance
();
...
...
@@ -703,6 +707,8 @@ void ResourceSelector::setStandard()
if
(
standard
)
CollectionControlModel
::
setEnabled
(
collection
,
alarmType
,
true
);
CollectionControlModel
::
setStandard
(
collection
,
alarmType
,
standard
);
if
(
alarmType
==
KAlarm
::
CalEvent
::
ARCHIVED
)
theApp
()
->
purgeNewArchivedDefault
(
collection
);
}
#else
AlarmResource
*
resource
=
currentResource
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment