[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    [calligra] krita/plugins/paintops/libpaintop: Don't assert when storing a second deactivated sensor
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2013-09-29 12:50:09
Message-ID: E1VQGRt-00027m-0Z () scm ! kde ! org
[Download RAW message or body]

Git commit 341247845a27860976a18711d86c92230b4ddc5b by Boudewijn Rempt.
Committed on 29/09/2013 at 12:29.
Pushed by rempt into branch 'master'.

Don't assert when storing a second deactivated sensor in the cache

CCBUG:322814
CCMAIL:kimageshop@kde.org

This removes an assert that checks whether a deactivated
sensor is stored another time. This happens when you check,
modify, uncheck a sensor for one preset, then go to another
preset of the same paintop type that has that sensor activated
and you deactivate it.

The problem seems to be, afaict, that we try to remember
the settings of deactivated sensors, but do that per paintop
instance, not per preset.

There are two proper solutions:

* remove the caching of custom settings for deactivated sensors
* save customized but deactivated sensors to the presets

The question is, which one shall it be?

M  +1    -6    krita/plugins/paintops/libpaintop/kis_multi_sensors_model_p.cpp
M  +0    -1    krita/plugins/paintops/libpaintop/kis_multi_sensors_model_p.h

http://commits.kde.org/calligra/341247845a27860976a18711d86c92230b4ddc5b

diff --git a/krita/plugins/paintops/libpaintop/kis_multi_sensors_model_p.cpp \
b/krita/plugins/paintops/libpaintop/kis_multi_sensors_model_p.cpp index \
                db22ded..a8934db 100644
--- a/krita/plugins/paintops/libpaintop/kis_multi_sensors_model_p.cpp
+++ b/krita/plugins/paintops/libpaintop/kis_multi_sensors_model_p.cpp
@@ -70,7 +70,7 @@ bool KisMultiSensorsModel::setData(const QModelIndex &index, const \
QVariant &val  return true;
             } else {
                 KisDynamicSensor* sensor = \
                m_listSensor->takeSensor(KisDynamicSensor::sensorsIds()[index.row()].id());
                
-                pushSensorToCache(sensor);;
+                m_sensorCache[sensor->id()] = sensor;
                 
                 // If there is only one sensor left, remove it from the list sensor, \
and delete the list sensor  QList<QString> ids = m_listSensor->sensorIds();
@@ -148,11 +148,6 @@ KisDynamicSensor* \
KisMultiSensorsModel::takeOrCreateSensorFromCache(const QStrin  return sensor;
 }
 
-void KisMultiSensorsModel::pushSensorToCache(KisDynamicSensor* sensor)
-{
-    Q_ASSERT(!m_sensorCache.contains(sensor->id()));
-    m_sensorCache[sensor->id()] = sensor;
-}
 
 void KisMultiSensorsModel::setCurrentCurve(const QModelIndex& currentIndex, const \
KisCubicCurve& curve, bool useSameCurve)  {
diff --git a/krita/plugins/paintops/libpaintop/kis_multi_sensors_model_p.h \
b/krita/plugins/paintops/libpaintop/kis_multi_sensors_model_p.h index \
                2bef646..abb11ea 100644
--- a/krita/plugins/paintops/libpaintop/kis_multi_sensors_model_p.h
+++ b/krita/plugins/paintops/libpaintop/kis_multi_sensors_model_p.h
@@ -49,7 +49,6 @@ signals:
 private:
     KisDynamicSensor* getOrCreateSensorFromCache(const QString& id);
     KisDynamicSensor* takeOrCreateSensorFromCache(const QString& id);
-    void pushSensorToCache(KisDynamicSensor*);
 private:
     KisDynamicSensor* m_currentSensor;
     KisDynamicSensorList* m_listSensor;
_______________________________________________
Krita mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic