[calligra] krita: Added an option to enable/disable progress reporting
Boudewijn Rempt
boud at valdyas.org
Thu Sep 3 14:29:34 UTC 2015
Git commit efd44d5141641f9d194cafff04c71b7d93e8efb7 by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 03/09/2015 at 14:29.
Pushed by rempt into branch 'master'.
Added an option to enable/disable progress reporting
Now you can edit it in
Preferences->Performance->Advanced->Enable Progress Reporting
CC:kimageshop at kde.org
Conflicts:
krita/image/kis_image.cc
M +5 -1 krita/image/kis_image.cc
M +11 -0 krita/image/kis_image_config.cpp
M +3 -0 krita/image/kis_image_config.h
M +2 -0 krita/ui/dialogs/kis_dlg_preferences.cc
M +9 -2 krita/ui/forms/wdgperformancesettings.ui
http://commits.kde.org/calligra/efd44d5141641f9d194cafff04c71b7d93e8efb7
diff --git a/krita/image/kis_image.cc b/krita/image/kis_image.cc
index 2652b1d..b8bc888 100644
--- a/krita/image/kis_image.cc
+++ b/krita/image/kis_image.cc
@@ -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);
diff --git a/krita/image/kis_image_config.cpp b/krita/image/kis_image_config.cpp
index e38b779..846100e 100644
--- a/krita/image/kis_image_config.cpp
+++ b/krita/image/kis_image_config.cpp
@@ -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 ?
diff --git a/krita/image/kis_image_config.h b/krita/image/kis_image_config.h
index 4a022d1..7e8a2ee 100644
--- a/krita/image/kis_image_config.h
+++ b/krita/image/kis_image_config.h
@@ -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);
diff --git a/krita/ui/dialogs/kis_dlg_preferences.cc b/krita/ui/dialogs/kis_dlg_preferences.cc
index 37fc1ff..1d3e5e9 100644
--- a/krita/ui/dialogs/kis_dlg_preferences.cc
+++ b/krita/ui/dialogs/kis_dlg_preferences.cc
@@ -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);
diff --git a/krita/ui/forms/wdgperformancesettings.ui b/krita/ui/forms/wdgperformancesettings.ui
index 226aaf9..08c8b5f 100644
--- a/krita/ui/forms/wdgperformancesettings.ui
+++ b/krita/ui/forms/wdgperformancesettings.ui
@@ -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>
More information about the kimageshop
mailing list