Commit e3215b87 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix marking the initial preset as "dirty" on Krita loading

The fix is twofold:

1) Cut the KisConfigWidget::sigConfigurationUpdated() before the
   compression happens if the widget's signals are blocked.

2) Block the signals when we are filling the widgets explicitly
parent 975e13b7
......@@ -24,8 +24,8 @@ KisConfigWidget::KisConfigWidget(QWidget * parent, Qt::WFlags f, int delay)
: QWidget(parent, f)
, m_compressor(delay, KisSignalCompressor::FIRST_ACTIVE)
{
connect(&m_compressor, SIGNAL(timeout()), SLOT(slotConfigChanged()));
connect(this, SIGNAL(sigConfigurationItemChanged()), &m_compressor, SLOT(start()));
connect(this, SIGNAL(sigConfigurationItemChanged()), SLOT(slotConfigChanged()));
connect(&m_compressor, SIGNAL(timeout()), SIGNAL(sigConfigurationUpdated()));
}
KisConfigWidget::~KisConfigWidget()
......@@ -34,7 +34,9 @@ KisConfigWidget::~KisConfigWidget()
void KisConfigWidget::slotConfigChanged()
{
emit sigConfigurationUpdated();
if (!signalsBlocked()) {
m_compressor.start();
}
}
void KisConfigWidget::setView(KisViewManager *view)
......@@ -43,4 +45,3 @@ void KisConfigWidget::setView(KisViewManager *view)
warnKrita << "KisConfigWidget::setView has got view == 0. That's a bug! Please report it!";
}
}
......@@ -86,7 +86,6 @@ private Q_SLOTS:
private:
KisSignalCompressor m_compressor;
int m_delay;
};
......
......@@ -576,6 +576,8 @@ void KisPaintopBox::setCurrentPaintop(const KoID& paintop, KisPaintOpPresetSP pr
m_optionWidget = m_paintopOptionWidgets[paintop];
KisSignalsBlocker b(m_optionWidget);
preset->setOptionsWidget(m_optionWidget);
m_optionWidget->setImage(m_viewManager->image());
......@@ -622,7 +624,9 @@ void KisPaintopBox::slotUpdateOptionsWidget()
KIS_SAFE_ASSERT_RECOVER_RETURN(preset);
KIS_SAFE_ASSERT_RECOVER_RETURN(m_optionWidget);
KisSignalsBlocker b(m_optionWidget);
m_optionWidget->setConfigurationSafe(preset->settings().data());
m_presetsPopup->resourceSelected(preset.data());
m_presetsPopup->updateViewSettings();
......
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