Commit c56ffdd8 authored by Dmitry Kazakov's avatar Dmitry Kazakov Committed by Boudewijn Rempt

Added an option to enable/disable progress reporting

Now you can edit it in
Preferences->Performance->Advanced->Enable Progress Reporting

CC:kimageshop@kde.org

Conflicts:
	krita/image/kis_image.cc
parent d868d21a
......@@ -176,8 +176,12 @@ KisImage::KisImage(KisUndoStore *undoStore, qint32 width, qint32 height, const K
m_d->compositeProgressProxy = new KisCompositeProgressProxy();
{
KisImageConfig cfg;
m_d->scheduler = new KisUpdateScheduler(this);
m_d->scheduler->setProgressProxy(m_d->compositeProgressProxy);
if (cfg.enableProgressReporting()) {
m_d->scheduler->setProgressProxy(m_d->compositeProgressProxy);
}
}
m_d->signalRouter = new KisImageSignalRouter(this);
......
......@@ -44,6 +44,17 @@ KisImageConfig::~KisImageConfig()
m_config.sync();
}
bool KisImageConfig::enableProgressReporting(bool requestDefault) const
{
return !requestDefault ?
m_config.readEntry("enableProgressReporting", true) : true;
}
void KisImageConfig::setEnableProgressReporting(bool value)
{
m_config.writeEntry("enableProgressReporting", value);
}
bool KisImageConfig::enablePerfLog(bool requestDefault) const
{
return !requestDefault ?
......
......@@ -29,6 +29,9 @@ public:
KisImageConfig();
~KisImageConfig();
bool enableProgressReporting(bool requestDefault = false) const;
void setEnableProgressReporting(bool value);
bool enablePerfLog(bool requestDefault = false) const;
void setEnablePerfLog(bool value);
......
......@@ -587,6 +587,7 @@ void PerformanceTab::load(bool requestDefault)
sliderUndoLimit->setValue(cfg.memorySoftLimitPercent(requestDefault));
chkPerformanceLogging->setChecked(cfg.enablePerfLog(requestDefault));
chkProgressReporting->setChecked(cfg.enableProgressReporting(requestDefault));
sliderSwapSize->setValue(cfg.maxSwapSize(requestDefault) / 1024);
lblSwapFileLocation->setText(cfg.swapDir(requestDefault));
......@@ -601,6 +602,7 @@ void PerformanceTab::save()
cfg.setMemoryPoolLimitPercent(sliderPoolLimit->value());
cfg.setEnablePerfLog(chkPerformanceLogging->isChecked());
cfg.setEnableProgressReporting(chkProgressReporting->isChecked());
cfg.setMaxSwapSize(sliderSwapSize->value() * 1024);
......
......@@ -219,13 +219,20 @@
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Advanced</string>
<string>Advanced (needs restarting Krita)</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="chkProgressReporting">
<property name="text">
<string>Enable progress reporting (might affect performance)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkPerformanceLogging">
<property name="text">
<string>Enable performance logging (needs restarting Krita)</string>
<string>Enable performance logging</string>
</property>
</widget>
</item>
......
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