[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Mar 11 21:25:44 CET 2005


Sorry, this goes to prove the point.  The commit changed the form of the code 
entirely, making the diff very hard to review.  Reversing all the if () 
branches in code when adding or removing a line is unnecessary.  It again 
destroys annotations, and in this case, nests code deeper making it more 
confusing to work with.

I put the editable() check back in.


On Friday 11 March 2005 15:05, Andrew Walker wrote:
> This reversion now allows the user (via DCOP) to change
> the value of a non-editable scalar. Was this the intent?
>
> On Friday 11 March 2005 11:45, George Staikos wrote:
> > CVS commit by staikos:
> >
> > revertlast, re-apply relevant portion of patch
> >
> >
> >   M +14 -17    kstiface_impl.cpp   1.64
> >
> >
> > --- kdeextragear-2/kst/kst/kstiface_impl.cpp  #1.63:1.64
> > @@ -436,12 +436,12 @@ double KstIfaceImpl::scalar(const QStrin
> >    KstReadLocker ml(&KST::scalarList.lock());
> >    KstScalarList::Iterator it = KST::scalarList.findTag(name);
> > -  double rc = 0.0;
> >
> > -  if (it != KST::scalarList.end()) {
> > -    KstReadLocker l2(*it);
> > -    rc = (*it)->value();
> > +  if (it == KST::scalarList.end()) {
> > +    return 0.0;
> >    }
> >
> > -  return rc;
> > +  KstReadLocker l2(*it);
> > +
> > +  return (*it)->value();
> >  }
> >
> > @@ -450,15 +450,12 @@ bool KstIfaceImpl::setScalar(const QStri
> >    KstReadLocker ml(&KST::scalarList.lock());
> >    KstScalarList::Iterator it = KST::scalarList.findTag(name);
> > -  bool rc = false;
> >
> > -  if (it != KST::scalarList.end()) {
> > -    if ((*it)->editable()) {
> > -      KstWriteLocker l2(*it);
> > -      *(*it) = value;
> > -      rc = true;
> > -    }
> > +  if (it == KST::scalarList.end()) {
> > +    return false;
> >    }
> >
> > -  return rc;
> > +  KstWriteLocker l2(*it);
> > +  *(*it) = value;
> > +  return true;
> >  }
> >
> >
> >
> > _______________________________________________
> > Kst mailing list
> > Kst at kde.org
> > https://mail.kde.org/mailman/listinfo/kst

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/


More information about the Kst mailing list