Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Fix an assert when trying to activate an image snapshot
Dmitry Kazakov60c5dcaf3769
diff --git a/plugins/dockers/snapshotdocker/KisSnapshotModel.cpp b/plugins/dockers/snapshotdocker/KisSnapshotModel.cppindex 7a86ee59be..0954f5f546 100644--- a/plugins/dockers/snapshotdocker/KisSnapshotModel.cpp+++ b/plugins/dockers/snapshotdocker/KisSnapshotModel.cpp@@ -17,6 +17,7 @@#include <KisViewManager.h>#include <kis_node_manager.h>#include <kis_name_server.h>+#include <kis_image_signal_router.h>struct KisSnapshotModel::Private{@@ -59,7 +60,12 @@ bool KisSnapshotModel::Private::switchToDocument(QPointer<KisDocument> doc)KisDocument *curDoc = curDocument();if (curDoc && doc) {curDoc->copyFromDocument(*doc);- view->viewManager()->nodeManager()->slotNonUiActivatedNode(curDoc->preActivatedNode());+ /**+ * Node activation should happen not directly via the GUI,+ * but via KisImage signal, since this signal gets synchronized+ * via KisSynchronizedConnection in the node model+ */+ curDoc->image()->signalRouter()->emitNotification(ComplexNodeReselectionSignal(curDoc->preActivatedNode(), {}));}// FIXME: more things need to be donereturn true;