Commit ecfc956d authored by Dmitry Kazakov's avatar Dmitry Kazakov

Avoid a crash when merging layers in isolated mode

This patch fixes the crash, bit doesn't fix the entire
problem. Now after the merge the isolated mode may either
stay activated or not depending on random conditions.

parent cf035350
......@@ -383,7 +383,7 @@ void KisNodeManager::setup(KActionCollection * actionCollection, KisActionManage
connect(action, SIGNAL(triggered()), this, SLOT(slotSplitAlphaSaveMerged()));
connect(this, SIGNAL(sigNodeActivated(KisNodeSP)), SLOT(slotUpdateIsolateModeAction()));
connect(this, SIGNAL(sigNodeActivated(KisNodeSP)), SLOT(slotTryFinishIsolatedMode()));
connect(this, SIGNAL(sigNodeActivated(KisNodeSP)), SLOT(slotTryRestartIsolatedMode()));
void KisNodeManager::updateGUI()
......@@ -471,13 +471,13 @@ void KisNodeManager::toggleIsolateMode(bool checked)
KisImageWSP image = m_d->view->image();
if (checked) {
KisNodeSP activeNode = this->activeNode();
KisNodeSP activeNode = this->activeNode();
if (checked && activeNode) {
// Transform and colorize masks don't have pixel data...
if (activeNode->inherits("KisTransformMask") ||
activeNode->inherits("KisColorizeMask")) return;
if (!image->startIsolatedMode(activeNode)) {
KisAction *action = m_d->view->actionManager()->actionByName("isolate_layer");
......@@ -498,7 +498,7 @@ void KisNodeManager::slotUpdateIsolateModeAction()
action->setChecked(isolatedRootNode && isolatedRootNode == activeNode);
void KisNodeManager::slotTryFinishIsolatedMode()
void KisNodeManager::slotTryRestartIsolatedMode()
KisNodeSP isolatedRootNode = m_d->view->image()->isolatedModeRoot();
if (!isolatedRootNode) return;
......@@ -165,7 +165,7 @@ public Q_SLOTS:
void toggleIsolateActiveNode();
void toggleIsolateMode(bool checked);
void slotUpdateIsolateModeAction();
void slotTryFinishIsolatedMode();
void slotTryRestartIsolatedMode();
void moveNodeAt(KisNodeSP node, KisNodeSP parent, int index);
void createNode(const QString& nodeType, bool quiet = false, KisPaintDeviceSP copyFrom = 0);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment