[pim/kalarm] src/resources: Add debug output for resource migration

David Jarvie <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit f01d7e4a935d416b70e5cf8b0c0233412acb4c00 by David Jarvie.
Committed on 13/08/2026 at 18:23.
Pushed by djarvie into branch 'master'.

Add debug output for resource migration

M  +3    -1    src/resources/calendarupdater.cpp
M  +8    -4    src/resources/migration/fileresourcemigrator.cpp
M  +2    -2    src/resources/migration/fileresourcemigrator.h

https://invent.kde.org/pim/kalarm/-/commit/f01d7e4a935d416b70e5cf8b0c0233412acb4c00

diff --git a/src/resources/calendarupdater.cpp b/src/resources/calendarupdater.cpp
index 00e86f8b0..7235ca5d5 100644
--- a/src/resources/calendarupdater.cpp
+++ b/src/resources/calendarupdater.cpp
@@ -1,7 +1,7 @@
 /*
  *  calendarupdater.cpp  -  base class to update a calendar to current KAlarm format
  *  Program:  kalarm
- *  SPDX-FileCopyrightText: 2020-2025 David Jarvie <[email protected]>
+ *  SPDX-FileCopyrightText: 2020-2026 David Jarvie <[email protected]>
  *
  *  SPDX-License-Identifier: GPL-2.0-or-later
  */
@@ -10,6 +10,7 @@
 
 #include "lib/desktop.h"
 #include "lib/i18n.h"
+#include "kalarm_debug.h"
 
 #include <KLocalizedString>
 
@@ -72,6 +73,7 @@ void CalendarUpdater::waitForCompletion()
 */
 void CalendarUpdater::setCompleted()
 {
+    qCDebug(KALARM_LOG) << "CalendarUpdater::setCompleted";
     mCompleted = true;
     deleteLater();
 }
diff --git a/src/resources/migration/fileresourcemigrator.cpp b/src/resources/migration/fileresourcemigrator.cpp
index 1aa7fe389..836588af4 100644
--- a/src/resources/migration/fileresourcemigrator.cpp
+++ b/src/resources/migration/fileresourcemigrator.cpp
@@ -1,7 +1,7 @@
 /*
  *  fileresourcemigrator.cpp  -  migrates or creates KAlarm file system resources
  *  Program:  kalarm
- *  SPDX-FileCopyrightText: 2011-2023 David Jarvie <[email protected]>
+ *  SPDX-FileCopyrightText: 2011-2026 David Jarvie <[email protected]>
  *
  *  SPDX-License-Identifier: GPL-2.0-or-later
  */
@@ -100,16 +100,17 @@ void FileResourceMigrator::start()
     {
         // Some file system resources already exist, so no migration is
         // required. Create any missing default file system resources.
-        akonadiMigrationComplete();
+        akonadiMigrationComplete(false);
     }
     else
     {
         // There are no file system resources, so migrate any Akonadi resources.
         mAkonadiPlugin = Preferences::akonadiPlugin();
         if (!mAkonadiPlugin)
-            akonadiMigrationComplete();   // Akonadi plugin is not available
+            akonadiMigrationComplete(false);   // Akonadi plugin is not available
         else
         {
+            qCDebug(KALARM_LOG) << "FileResourceMigrator::start: migrate Akonadi";
             connect(mAkonadiPlugin, &AkonadiPlugin::akonadiMigrationComplete, this, &FileResourceMigrator::akonadiMigrationComplete);
             connect(mAkonadiPlugin, &AkonadiPlugin::migrateFileResource, this, &FileResourceMigrator::migrateFileResource);
             connect(mAkonadiPlugin, &AkonadiPlugin::migrateDirResource, this, &FileResourceMigrator::migrateDirResource);
@@ -129,6 +130,7 @@ void FileResourceMigrator::migrateFileResource(const QString& resourceName,
                       CalEvent::Types enabledTypes, CalEvent::Types standardTypes,
                       bool readOnly)
 {
+    qCDebug(KALARM_LOG) << "FileResourceMigrator::migrateFileResource" << location.toString(QUrl::PreferLocalFile | QUrl::PrettyDecoded);
     FileResourceSettings::Ptr settings(new FileResourceSettings(
                   FileResourceSettings::File, location, alarmTypes, displayName,
                   backgroundColour, enabledTypes, standardTypes, readOnly));
@@ -161,6 +163,7 @@ void FileResourceMigrator::migrateDirResource(const QString& resourceName,
                       CalEvent::Types enabledTypes, CalEvent::Types standardTypes,
                       bool readOnly)
 {
+    qCDebug(KALARM_LOG) << "FileResourceMigrator::migrateDirResource" << path;
     // Use AutoQPointer to guard against crash on application exit while
     // the dialogue is still open. It prevents double deletion (both on
     // deletion of parent, and on return from this function).
@@ -223,8 +226,9 @@ void FileResourceMigrator::migrateDirResource(const QString& resourceName,
 /******************************************************************************
 * Called when Akonadi migration is complete or is known not to be possible.
 */
-void FileResourceMigrator::akonadiMigrationComplete()
+void FileResourceMigrator::akonadiMigrationComplete(bool migrated)
 {
+    qCDebug(KALARM_LOG) << "FileResourceMigrator::akonadiMigrationComplete" << migrated;
     // Create any necessary additional default file system resources.
     createDefaultResources();
 
diff --git a/src/resources/migration/fileresourcemigrator.h b/src/resources/migration/fileresourcemigrator.h
index d66c72059..66d5b780d 100644
--- a/src/resources/migration/fileresourcemigrator.h
+++ b/src/resources/migration/fileresourcemigrator.h
@@ -1,7 +1,7 @@
 /*
  *  fileresourcemigrator.h  -  migrates or creates KAlarm file system resources
  *  Program:  kalarm
- *  SPDX-FileCopyrightText: 2020-2023 David Jarvie <[email protected]>
+ *  SPDX-FileCopyrightText: 2020-2026 David Jarvie <[email protected]>
  *
  *  SPDX-License-Identifier: GPL-2.0-or-later
  */
@@ -39,7 +39,7 @@ public:
     static bool completed()    { return mCompleted; }
 
 private Q_SLOTS:
-    void akonadiMigrationComplete();
+    void akonadiMigrationComplete(bool migrated);
     void checkIfComplete();
 
 private:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.