[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Mon Mar 28 06:21:31 CEST 2005
CVS commit by staikos:
- add const
- update providers and properly signify change in strings and scalars
M +11 -4 kstscalar.cpp 1.39
M +11 -3 kststring.cpp 1.7
M +14 -1 kstvector.cpp 1.105
M +1 -1 kstvector.h 1.68
--- kdeextragear-2/kst/kst/kstvector.cpp #1.104:1.105
@@ -552,5 +565,5 @@ bool KstVector::deleteDependents() {
-void KstVector::setLabel(QString label_in) {
+void KstVector::setLabel(const QString& label_in) {
_label = label_in;
}
--- kdeextragear-2/kst/kst/kstvector.h #1.67:1.68
@@ -135,5 +135,5 @@ class KstVector : public KstObject {
virtual bool deleteDependents();
- void setLabel(QString label_in);
+ void setLabel(const QString& label_in);
bool saveable() {return _saveable;}
--- kdeextragear-2/kst/kst/kststring.cpp #1.6:1.7
@@ -85,9 +85,17 @@ void KstString::save(QTextStream &ts, co
KstObject::UpdateType KstString::update(int updateCounter) {
- if (KstObject::checkUpdateCounter(updateCounter)) {
+ bool force = dirty();
+ setDirty(false);
+
+ if (KstObject::checkUpdateCounter(updateCounter) && !force) {
return lastUpdateResult();
}
- // FIXME: we need to update our provider if we have one
- return setLastUpdateResult(NO_CHANGE);
+
+ QString v = value();
+ if (_provider) {
+ _provider->update(updateCounter);
+ }
+
+ return setLastUpdateResult(v == value() ? NO_CHANGE : UPDATE);
}
--- kdeextragear-2/kst/kst/kstscalar.cpp #1.38:1.39
@@ -86,10 +86,17 @@ KstScalar::~KstScalar() {
KstObject::UpdateType KstScalar::update(int updateCounter) {
- if (KstObject::checkUpdateCounter(updateCounter)) {
+ bool force = dirty();
+ setDirty(false);
+
+ if (KstObject::checkUpdateCounter(updateCounter) && !force) {
return lastUpdateResult();
}
- // FIXME: if we're provided by a vector, we need to propagate upward.
- // also clean up the flags like "orphan".
- return setLastUpdateResult(NO_CHANGE);
+
+ double v = value();
+ if (_provider) {
+ _provider->update(updateCounter);
+ }
+
+ return setLastUpdateResult(v == value() ? NO_CHANGE : UPDATE);
}
More information about the Kst
mailing list