[calligra/krita-animation-pentikainen] krita: Added an option to enable/disable progress reporting

Dmitry Kazakov dimula73 at gmail.com
Thu Sep 3 12:55:09 UTC 2015


Git commit d4f981269c3097226e7f1475d7158f469c420569 by Dmitry Kazakov.
Committed on 03/09/2015 at 12:54.
Pushed by dkazakov into branch 'krita-animation-pentikainen'.

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

M  +7    -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/d4f981269c3097226e7f1475d7158f469c420569

diff --git a/krita/image/kis_image.cc b/krita/image/kis_image.cc
index db7eecd..2de9f96 100644
--- a/krita/image/kis_image.cc
+++ b/krita/image/kis_image.cc
@@ -189,8 +189,14 @@ 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->scheduler->setLod0ToNStrokeStrategyFactory(
             boost::bind(boost::factory<KisSyncLodCacheStrokeStrategy*>(), KisImageWSP(this)));
         m_d->scheduler->setSuspendUpdatesStrokeStrategyFactory(
diff --git a/krita/image/kis_image_config.cpp b/krita/image/kis_image_config.cpp
index 56247b1..23b84d7 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 1cf9039..d19ba15 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 dd2a53e..528b3df 100644
--- a/krita/ui/dialogs/kis_dlg_preferences.cc
+++ b/krita/ui/dialogs/kis_dlg_preferences.cc
@@ -593,6 +593,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));
@@ -607,6 +608,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