[pim/kmail] src: Add undoRedoManager

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 75b708c5ea2a02ded6168a8ac4b289adac811bc9 by Laurent Montel.
Committed on 27/07/2026 at 05:50.
Pushed by mlaurent into branch 'master'.

Add undoRedoManager

M  +7    -0    src/kmkernel.cpp
M  +4    -0    src/kmkernel.h

https://invent.kde.org/pim/kmail/-/commit/75b708c5ea2a02ded6168a8ac4b289adac811bc9

diff --git a/src/kmkernel.cpp b/src/kmkernel.cpp
index a4fce6fe2..17f86d334 100644
--- a/src/kmkernel.cpp
+++ b/src/kmkernel.cpp
@@ -13,6 +13,7 @@ using PimCommon::BroadcastStatus;
 #include "kmmainwidget.h"
 #include "kmmainwin.h"
 #include "kmreadermainwin.h"
+#include "kmundoredomanager.h"
 #include "undostack.h"
 
 #if !KMAIL_FORCE_DISABLE_AKONADI_SEARCH
@@ -126,6 +127,7 @@ static bool s_askingToGoOnline = false;
 /********************************************************************/
 KMKernel::KMKernel(QObject *parent)
     : QObject(parent)
+    , mUndoRedoManager(new KMail::KMUndoRedoManager(this))
     , mJobScheduler(new JobScheduler(this))
     , mFolderArchiveManager(new FolderArchiveManager(this))
 {
@@ -1150,6 +1152,11 @@ void KMKernel::saveConfig()
     KMailSettings::self()->save();
 }
 
+KMail::KMUndoRedoManager *KMKernel::undoRedoManager() const
+{
+    return mUndoRedoManager;
+}
+
 void KMKernel::updateConfig()
 {
     slotConfigChanged();
diff --git a/src/kmkernel.h b/src/kmkernel.h
index d6075058c..7eeb2c8b8 100644
--- a/src/kmkernel.h
+++ b/src/kmkernel.h
@@ -64,6 +64,7 @@ namespace KMail
 class MailServiceImpl;
 class UndoStack;
 class UnityServiceManager;
+class KMUndoRedoManager;
 }
 namespace MessageComposer
 {
@@ -501,6 +502,8 @@ public:
 #if KMAIL_WITH_KUSERFEEDBACK
     KUserFeedback::Provider *userFeedbackProvider() const;
 #endif
+    [[nodiscard]] KMail::KMUndoRedoManager *undoRedoManager() const;
+
 protected:
     void agentInstanceBroken(const Akonadi::AgentInstance &instance);
 
@@ -595,6 +598,7 @@ private:
     KMAIL_NO_EXPORT void saveConfig();
 
     KMail::UndoStack *the_undoStack = nullptr;
+    KMail::KMUndoRedoManager *const mUndoRedoManager;
     MessageComposer::AkonadiSender *the_msgSender = nullptr;
     /** is this the first start?  read from config */
     bool the_firstStart = false;
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.