[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Thu Sep 9 03:57:32 CEST 2004
CVS commit by staikos:
- remove unused variables
- fix indent (detabify, =)
- remove redundant if()s
M +6 -17 kstcolorsequence.cpp 1.9
M +13 -19 kstdatamanager_i.cpp 1.83
M +144 -144 kstiface_impl.h 1.26
--- kdeextragear-2/kst/kst/kstcolorsequence.cpp #1.8:1.9
@@ -59,5 +59,5 @@ KstColorSequence::~KstColorSequence() {
-KstColorSequence* KstColorSequence::_self = 0L;
+KstColorSequence *KstColorSequence::_self = 0L;
@@ -69,5 +69,5 @@ QColor KstColorSequence::next(const KstB
int start;
- for (int i=0; i<_self->_count; i++) {
+ for (int i = 0; i < _self->_count; i++) {
usage[i] = 0;
}
@@ -145,7 +145,4 @@ QColor KstColorSequence::next(const KstB
QColor KstColorSequence::next() {
- QColor color;
- int dark_factor;
-
if (!_self) {
_self = sdColorSequence.setObject(_self, new KstColorSequence);
@@ -156,8 +153,6 @@ QColor KstColorSequence::next() {
}
- dark_factor = 100 + ( 50 * ( _self->_ptr / _self->_count ) );
- color = _self->_pal->color( _self->_ptr++ % _self->_count).dark(dark_factor);
-
- return color;
+ int dark_factor = 100 + ( 50 * ( _self->_ptr / _self->_count ) );
+ return _self->_pal->color( _self->_ptr++ % _self->_count).dark(dark_factor);
}
@@ -166,5 +161,4 @@ QColor KstColorSequence::next(const QCol
QColor color;
int dark_factor;
- int start;
if (!_self) {
@@ -172,5 +166,5 @@ QColor KstColorSequence::next(const QCol
}
- start = _self->_ptr;
+ int start = _self->_ptr;
//
@@ -206,5 +200,4 @@ bool KstColorSequence::colorsTooClose(co
double r2, h2, f2, x2, y2, z2;
double dc;
- bool rc = false;
int sugH, sugS, sugV;
int badH, badS, badV;
@@ -236,9 +229,5 @@ bool KstColorSequence::colorsTooClose(co
dc = sqrt( ( x1-x2 )*( x1-x2 ) + ( y1-y2 )*( y1-y2 ) + ( z1-z2 )*( z1-z2 ) );
- if (dc < 0.3) {
- rc = true;
- }
-
- return rc;
+ return dc < 0.3;
}
--- kdeextragear-2/kst/kst/kstdatamanager_i.cpp #1.82:1.83
@@ -92,15 +92,9 @@ void KstObjectItem::update(bool recursiv
case RTTI_OBJ_DATA_VECTOR:
{
- KstVectorPtr px = *KST::vectorList.findTag(_name);
- if (px) {
- KstRVectorPtr x = static_cast<KstRVector*>(px.data());
+ KstRVectorPtr x = static_cast<KstRVector*>((*KST::vectorList.findTag(_name)).data());
if (x) {
x->readLock();
- //
- // getUsage:
- // subtract 1 for KstVectorPtr px
- // subtract 1 for KstRVectorPtr x
- //
- setText(2, QString::number(x->getUsage() - 2 - localUseCount));
+ // getUsage: subtract 1 for KstRVectorPtr x
+ setText(2, QString::number(x->getUsage() - 1 - localUseCount));
setText(3, QString::number(x->sampleCount()));
setText(4, i18n("%3: %4 [%1..%2]").arg(x->reqStartFrame())
@@ -111,5 +105,5 @@ void KstObjectItem::update(bool recursiv
x->readUnlock();
}
- }
+ // Hmmm what happens if this if() fails?? We become inconsistent?
break;
}
--- kdeextragear-2/kst/kst/kstiface_impl.h #1.25:1.26
@@ -26,5 +26,5 @@ class KstApp;
class KstIfaceImpl : virtual public KstIface {
-public:
+ public:
KstIfaceImpl(KstDoc *doc, KstApp *app);
virtual ~KstIfaceImpl();
@@ -167,5 +167,5 @@ public:
virtual bool addPlotMarker(const QString &plotName, double markerValue); //create plotmarker
-private:
+ private:
KstDoc *_doc;
KstApp *_app;
More information about the Kst
mailing list