Commit 47b26d96 authored by Tusooa Zhu's avatar Tusooa Zhu 🔼

Use KisSignalAutoConnectionsStore to (dis)connect signals

parent 778ac4fc
......@@ -203,7 +203,7 @@ void PaletteDockerDock::setCanvas(KoCanvasBase *canvas)
}
if (m_activeDocument) {
m_activeDocument->disconnect(this);
m_connections.clear();
for (KoColorSet * &cs : m_activeDocument->paletteList()) {
KoColorSet *tmpAddr = cs;
cs = new KoColorSet(*cs);
......@@ -218,7 +218,7 @@ void PaletteDockerDock::setCanvas(KoCanvasBase *canvas)
for (KoColorSet *cs : m_activeDocument->paletteList()) {
m_rServer->addResource(cs);
}
connect(m_activeDocument, &KisDocument::sigPaletteListChanged, this, &PaletteDockerDock::slotUpdatePaletteList);
m_connections.addConnection(m_activeDocument, SIGNAL(sigPaletteListChanged), this, SLOT(slotUpdatePaletteList));
}
if (!m_currentColorSet) {
......
......@@ -36,6 +36,7 @@
#include <kis_canvas2.h>
#include <kis_mainwindow_observer.h>
#include <KisView.h>
#include <kis_signal_auto_connection.h>
class KisViewManager;
class KisCanvasResourceProvider;
......@@ -110,6 +111,8 @@ private /* member variables */:
QMenu m_viewContextMenu;
bool m_colorSelfUpdate;
KisSignalAutoConnectionsStore m_connections;
};
......
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