diff --git a/include/iundo.h b/include/iundo.h index 31956dc03c..765d377847 100644 --- a/include/iundo.h +++ b/include/iundo.h @@ -82,12 +82,6 @@ class IUndoSystem // Returns true if an operation is already started virtual bool operationStarted() const = 0; - // Emitted after an undo operation is fully completed, allows objects to refresh their state - virtual sigc::signal& signal_postUndo() = 0; - - // Emitted after a redo operation is fully completed, allows objects to refresh their state - virtual sigc::signal& signal_postRedo() = 0; - // greebo: This finishes the current operation and removes // it immediately from the stack, therefore it never existed. virtual void cancel() = 0; diff --git a/radiantcore/map/Map.cpp b/radiantcore/map/Map.cpp index e109805d03..610120d3f6 100644 --- a/radiantcore/map/Map.cpp +++ b/radiantcore/map/Map.cpp @@ -91,8 +91,6 @@ void Map::clearMapResource() void Map::connectToUndoSystem() { - _postUndoListener.disconnect(); - _postRedoListener.disconnect(); _modifiedStatusListener.disconnect(); _undoEventListener.disconnect(); @@ -102,14 +100,6 @@ void Map::connectToUndoSystem() if (!_resource->getRootNode()) return; - _postUndoListener = _resource->getRootNode()->getUndoSystem().signal_postUndo().connect([this]() - { - _mapPostUndoSignal.emit(); - }); - _postRedoListener = _resource->getRootNode()->getUndoSystem().signal_postRedo().connect([this]() - { - _mapPostRedoSignal.emit(); - }); _undoEventListener = _resource->getRootNode()->getUndoSystem().signal_undoEvent().connect( sigc::mem_fun(this, &Map::onUndoEvent) ); @@ -124,10 +114,12 @@ void Map::onUndoEvent(IUndoSystem::EventType type, const std::string& operationN break; case IUndoSystem::EventType::OperationUndone: + _mapPostUndoSignal.emit(); OperationMessage::Send(fmt::format(_("Undo: {0}"), operationName)); break; case IUndoSystem::EventType::OperationRedone: + _mapPostRedoSignal.emit(); OperationMessage::Send(fmt::format(_("Redo: {0}"), operationName)); break; } @@ -1499,8 +1491,6 @@ void Map::initialiseModule(const IApplicationContext& ctx) void Map::shutdownModule() { - _postUndoListener.disconnect(); - _postRedoListener.disconnect(); _undoEventListener.disconnect(); abortMergeOperation(); diff --git a/radiantcore/map/Map.h b/radiantcore/map/Map.h index 21f96b6577..9ee84d67bf 100644 --- a/radiantcore/map/Map.h +++ b/radiantcore/map/Map.h @@ -75,8 +75,6 @@ class Map : std::list _mergeActionNodes; sigc::connection _mergeOperationListener; - sigc::connection _postUndoListener; - sigc::connection _postRedoListener; sigc::connection _modifiedStatusListener; sigc::connection _undoEventListener; diff --git a/radiantcore/undo/UndoSystem.cpp b/radiantcore/undo/UndoSystem.cpp index 4aeefc7651..e17b8453c7 100644 --- a/radiantcore/undo/UndoSystem.cpp +++ b/radiantcore/undo/UndoSystem.cpp @@ -97,8 +97,6 @@ void UndoSystem::undo() _undoStack.pop_back(); _eventSignal.emit(EventType::OperationUndone, operationName); - _signalPostUndo.emit(); - // Trigger the onPostUndo event on all scene nodes GlobalSceneGraph().foreachNode([&] (const scene::INodePtr& node)->bool { @@ -133,8 +131,6 @@ void UndoSystem::redo() _redoStack.pop_back(); _eventSignal.emit(EventType::OperationRedone, operationName); - _signalPostRedo.emit(); - // Trigger the onPostRedo event on all scene nodes GlobalSceneGraph().foreachNode([&] (const scene::INodePtr& node)->bool { @@ -156,17 +152,6 @@ void UndoSystem::clear() // there are some "persistent" observers like EntityInspector and ShaderClipboard } -sigc::signal& UndoSystem::signal_postUndo() -{ - return _signalPostUndo; -} - -// Emitted after a redo operation is fully completed, allows objects to refresh their state -sigc::signal& UndoSystem::signal_postRedo() -{ - return _signalPostRedo; -} - sigc::signal& UndoSystem::signal_undoEvent() { return _eventSignal; diff --git a/radiantcore/undo/UndoSystem.h b/radiantcore/undo/UndoSystem.h index 7d334ae892..417bd4d845 100644 --- a/radiantcore/undo/UndoSystem.h +++ b/radiantcore/undo/UndoSystem.h @@ -48,9 +48,6 @@ class UndoSystem final : registry::CachedKey _undoLevels; - sigc::signal _signalPostUndo; - sigc::signal _signalPostRedo; - sigc::signal _eventSignal; public: @@ -66,7 +63,7 @@ class UndoSystem final : bool operationStarted() const override; // greebo: This finishes the current operation and - // removes it instantly from the stack + // instantly removes it from the stack void cancel() override; void finish(const std::string& command) override; @@ -76,11 +73,6 @@ class UndoSystem final : void clear() override; - sigc::signal& signal_postUndo() override; - - // Emitted after a redo operation is fully completed, allows objects to refresh their state - sigc::signal& signal_postRedo() override; - sigc::signal& signal_undoEvent() override; private: