[pim/kmail] src: Add class base

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 4397559a8bedff2d69e5b38774bea8a0a79b21a3 by Laurent Montel.
Committed on 28/07/2026 at 06:07.
Pushed by mlaurent into branch 'master'.

Add class base

M  +12   -2    src/kmundoredomanager.cpp
M  +16   -2    src/kmundoredomanager.h

https://invent.kde.org/pim/kmail/-/commit/4397559a8bedff2d69e5b38774bea8a0a79b21a3

diff --git a/src/kmundoredomanager.cpp b/src/kmundoredomanager.cpp
index 445d295f0..1b32143b1 100644
--- a/src/kmundoredomanager.cpp
+++ b/src/kmundoredomanager.cpp
@@ -56,8 +56,7 @@ void KMUndoRedoManager::addMsgToMoveAction(QUndoCommand *command, const Akonadi:
 }
 
 KMUndoInfoMoveItems::KMUndoInfoMoveItems(KMUndoRedoManager *manager, QUndoCommand *parent)
-    : QUndoCommand(parent)
-    , mManager(manager)
+    : KMUndoBase(manager, parent)
 {
 }
 
@@ -120,3 +119,14 @@ QString KMUndoInfoMoveItems::actionText() const
 {
     return i18n("Move messages");
 }
+
+KMUndoBase::KMUndoBase(KMUndoRedoManager *manager, QUndoCommand *parent)
+    : QUndoCommand(parent)
+    , mManager(manager)
+{
+}
+
+KMUndoInfoChangeStatusItems::KMUndoInfoChangeStatusItems(KMUndoRedoManager *manager, QUndoCommand *parent)
+    : KMUndoBase(manager, parent)
+{
+}
diff --git a/src/kmundoredomanager.h b/src/kmundoredomanager.h
index 05b368b51..643750903 100644
--- a/src/kmundoredomanager.h
+++ b/src/kmundoredomanager.h
@@ -31,7 +31,22 @@ private:
     QUndoStack *const mUndoStack;
 };
 
-class KMUndoInfoMoveItems : public QUndoCommand
+class KMUndoBase : public QUndoCommand
+{
+public:
+    explicit KMUndoBase(KMUndoRedoManager *manager, QUndoCommand *parent = nullptr);
+
+protected:
+    KMUndoRedoManager *const mManager;
+};
+
+class KMUndoInfoChangeStatusItems : public KMUndoBase
+{
+public:
+    explicit KMUndoInfoChangeStatusItems(KMUndoRedoManager *manager, QUndoCommand *parent = nullptr);
+};
+
+class KMUndoInfoMoveItems : public KMUndoBase
 {
 public:
     explicit KMUndoInfoMoveItems(KMUndoRedoManager *manager, QUndoCommand *parent = nullptr);
@@ -54,7 +69,6 @@ public:
     void setMoveToTrash(bool newMoveToTrash);
 
 private:
-    KMUndoRedoManager *const mManager;
     Akonadi::Item::List mItems;
     Akonadi::Collection mSrcFolder;
     Akonadi::Collection mDestFolder;
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.