Commit e3580d48 authored by David Jarvie's avatar David Jarvie
Browse files

On completion, calendar migration restores previous Akonadi run state

parent 69a9ccec
Pipeline #40943 canceled with stage
KAlarm Change Log KAlarm Change Log
=== Version 3.1.0 (KDE Applications 20.12) --- 28 October 2020 === === Version 3.1.0 (KDE Applications 20.12) --- 14 November 2020 ===
+ Add option to show alarm message as a notification instead of in a window [KDE Bug 345922] + Add option to show alarm message as a notification instead of in a window [KDE Bug 345922]
+ Add option to give alarms a name. + Add option to give alarms a name.
+ Don't execute display alarms while desktop notifications are inhibited. + Don't execute display alarms while desktop notifications are inhibited.
+ Cancel any screen saver when an alarm is displayed. + Cancel any screen saver when an alarm is displayed.
+ On completion, calendar migration restores previous Akonadi run state.
=== Version 3.0.3 (KDE Applications 20.08.3) --- 25 October 2020 === === Version 3.0.3 (KDE Applications 20.08.3) --- 25 October 2020 ===
+ Prevent resources being disabled at logout [KDE Bug 427722] + Prevent resources being disabled at logout [KDE Bug 427722]
......
...@@ -143,7 +143,9 @@ void FileResourceMigrator::start() ...@@ -143,7 +143,9 @@ void FileResourceMigrator::start()
mAkonadiMigration->required = true; mAkonadiMigration->required = true;
connect(mAkonadiMigration, &FileResourceMigrator::AkonadiMigration::completed, this, &FileResourceMigrator::akonadiMigrationComplete); connect(mAkonadiMigration, &FileResourceMigrator::AkonadiMigration::completed, this, &FileResourceMigrator::akonadiMigrationComplete);
connect(Akonadi::ServerManager::self(), &Akonadi::ServerManager::stateChanged, this, &FileResourceMigrator::checkAkonadiResources); connect(Akonadi::ServerManager::self(), &Akonadi::ServerManager::stateChanged, this, &FileResourceMigrator::checkAkonadiResources);
checkAkonadiResources(Akonadi::ServerManager::state()); auto akstate = Akonadi::ServerManager::state();
mAkonadiStart = (akstate == Akonadi::ServerManager::NotRunning);
checkAkonadiResources(akstate);
// Migration of Akonadi collections has now been initiated. On // Migration of Akonadi collections has now been initiated. On
// completion, either KResource calendars will be migrated, or // completion, either KResource calendars will be migrated, or
// any missing default resources will be created. // any missing default resources will be created.
...@@ -366,6 +368,17 @@ void FileResourceMigrator::collectionFetchResult(KJob* j) ...@@ -366,6 +368,17 @@ void FileResourceMigrator::collectionFetchResult(KJob* j)
*/ */
void FileResourceMigrator::akonadiMigrationComplete() void FileResourceMigrator::akonadiMigrationComplete()
{ {
// Ignore any further Akonadi server state changes, to prevent possible
// repeated migrations.
disconnect(Akonadi::ServerManager::self(), nullptr, this, nullptr);
if (mAkonadiStart)
{
// The Akonadi server wasn't running before we started it, so stop it
// now that it's no longer needed.
Akonadi::ServerManager::stop();
}
if (!mAkonadiMigration->required) if (!mAkonadiMigration->required)
{ {
// There are no Akonadi resources, so migrate any KResources alarm // There are no Akonadi resources, so migrate any KResources alarm
......
...@@ -64,6 +64,7 @@ private: ...@@ -64,6 +64,7 @@ private:
QList<Akonadi::CollectionFetchJob*> mFetchesPending; // pending collection fetch jobs for existing resources QList<Akonadi::CollectionFetchJob*> mFetchesPending; // pending collection fetch jobs for existing resources
KAlarmCal::CalEvent::Types mExistingAlarmTypes {KAlarmCal::CalEvent::EMPTY}; // alarm types provided by existing non-Akonadi resources KAlarmCal::CalEvent::Types mExistingAlarmTypes {KAlarmCal::CalEvent::EMPTY}; // alarm types provided by existing non-Akonadi resources
bool mMigrateKResources {true}; // need to migrate KResource resources bool mMigrateKResources {true}; // need to migrate KResource resources
bool mAkonadiStart {false}; // Akonadi was started by the migrator
static bool mCompleted; // execute() has completed static bool mCompleted; // execute() has completed
}; };
......
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