Commit e0396847 authored by Mathias Wein's avatar Mathias Wein
Browse files

Fix connections piling up in channels docker

Finally investigated the cause of mysterious cursor freezes whenever krita
becomes idle; it was the channels docker creating additional connections
on each canvas change.

While at it, move the connection of overview docker too, the endpoints
are static for the lifetime of the docker.
parent b9eed7ba
Pipeline #80848 skipped with stage
......@@ -47,6 +47,7 @@ ChannelDockerDock::ChannelDockerDock( ) :
setWidget(m_channelTable);
connect(m_channelTable,&QTableView::activated, m_model, &ChannelModel::rowActivated);
connect(m_imageIdleWatcher, &KisIdleWatcher::startedIdleMode, this, &ChannelDockerDock::updateChannelTable);
}
void ChannelDockerDock::setCanvas(KoCanvasBase * canvas)
......@@ -73,7 +74,6 @@ void ChannelDockerDock::setCanvas(KoCanvasBase * canvas)
KisPaintDeviceSP dev = m_canvas->image()->projection();
m_imageIdleWatcher->setTrackedImage(m_canvas->image());
connect(m_imageIdleWatcher, &KisIdleWatcher::startedIdleMode, this, &ChannelDockerDock::updateChannelTable);
connect(m_canvas->image(), SIGNAL(sigImageUpdated(QRect)), this, SLOT(startUpdateCanvasProjection()), Qt::UniqueConnection);
......
......@@ -35,6 +35,8 @@ OverviewWidget::OverviewWidget(QWidget * parent)
KisConfig cfg(true);
slotThemeChanged();
recalculatePreviewDimensions();
connect(&m_imageIdleWatcher, &KisIdleWatcher::startedIdleMode, this, &OverviewWidget::generateThumbnail);
}
OverviewWidget::~OverviewWidget()
......@@ -53,8 +55,6 @@ void OverviewWidget::setCanvas(KoCanvasBase * canvas)
if (m_canvas) {
m_imageIdleWatcher.setTrackedImage(m_canvas->image());
connect(&m_imageIdleWatcher, &KisIdleWatcher::startedIdleMode, this, &OverviewWidget::generateThumbnail, Qt::UniqueConnection);
connect(m_canvas->image(), SIGNAL(sigImageUpdated(QRect)),SLOT(startUpdateCanvasProjection()));
connect(m_canvas->image(), SIGNAL(sigSizeChanged(QPointF,QPointF)),SLOT(startUpdateCanvasProjection()));
connect(m_canvas->displayColorConverter(), SIGNAL(displayConfigurationChanged()), SLOT(startUpdateCanvasProjection()));
......
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