[pim/kmail] src: Prepare to add undo/redo

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

Prepare to add undo/redo

M  +12   -1    src/kmundoredomanager.cpp
M  +12   -0    src/kmundoredomanager.h

https://invent.kde.org/pim/kmail/-/commit/fa794f8a22d30c88105d9562e4cf2e0bf68c3e69

diff --git a/src/kmundoredomanager.cpp b/src/kmundoredomanager.cpp
index 9dc289b3c..28dd340e2 100644
--- a/src/kmundoredomanager.cpp
+++ b/src/kmundoredomanager.cpp
@@ -5,11 +5,22 @@
 */
 
 #include "kmundoredomanager.h"
-
+#include <QUndoStack>
 using namespace KMail;
 KMUndoRedoManager::KMUndoRedoManager(QObject *parent)
     : QObject{parent}
+    , mUndoStack(new QUndoStack(this))
 {
 }
 
 KMUndoRedoManager::~KMUndoRedoManager() = default;
+
+void KMUndoInfoMoveItems::undo()
+{
+    // TODO
+}
+
+void KMUndoInfoMoveItems::redo()
+{
+    // TODO
+}
diff --git a/src/kmundoredomanager.h b/src/kmundoredomanager.h
index 6132dedb4..48826f36b 100644
--- a/src/kmundoredomanager.h
+++ b/src/kmundoredomanager.h
@@ -6,6 +6,8 @@
 #pragma once
 
 #include <QObject>
+#include <QUndoCommand>
+class QUndoStack;
 namespace KMail
 {
 class KMUndoRedoManager : public QObject
@@ -14,5 +16,15 @@ class KMUndoRedoManager : public QObject
 public:
     explicit KMUndoRedoManager(QObject *parent = nullptr);
     ~KMUndoRedoManager() override;
+
+private:
+    QUndoStack *const mUndoStack;
+};
+
+class KMUndoInfoMoveItems : public QUndoCommand
+{
+public:
+    void undo() override;
+    void redo() override;
 };
 }
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.