[Kst] extragear/graphics/kst/src

George Staikos staikos at kde.org
Sat Jun 3 18:44:36 CEST 2006


SVN commit 547871 by staikos:

somehow these QMIN and QMAX keep sneaking back in.  Please use kMin and kMax.


 M  +2 -2      libkst/ksdebug.cpp  
 M  +1 -1      libkstapp/emailthread.cpp  
 M  +1 -1      libkstapp/kst2dplot.cpp  
 M  +2 -2      libkstapp/kstdatacollection-gui.cpp  
 M  +4 -4      libkstapp/ksttoplevelview.cpp  
 M  +2 -2      libkstapp/kstviewlegend.cpp  
 M  +4 -11     libkstapp/kstviewobject.cpp  
 M  +0 -5      libkstapp/kstviewobject.h  


--- trunk/extragear/graphics/kst/src/libkst/ksdebug.cpp #547870:547871
@@ -533,7 +533,7 @@
     if (!print) return *this;
     output += '[';
     unsigned int i = 0;
-    unsigned int sz = QMIN( data.size(), 64 );
+    unsigned int sz = kMin( data.size(), uint(64) );
     for ( ; i < sz ; ++i ) {
         output += QString::number( (unsigned char) data[i], 16 ).rightJustify(2, '0');
         if ( i < sz )
@@ -557,7 +557,7 @@
     char** strings = backtrace_symbols (trace, n);
 
     if ( levels != -1 )
-        n = QMIN( n, levels );
+        n = kMin( n, levels );
     s = "[\n";
 
     for (int i = 0; i < n; ++i)
--- trunk/extragear/graphics/kst/src/libkstapp/emailthread.cpp #547870:547871
@@ -174,7 +174,7 @@
 {
   Q_UNUSED(job)
 
-  int chunkSize = QMIN(_bodyLength - _bodyOffset, 0x8000);
+  int chunkSize = kMin(_bodyLength - _bodyOffset, uint(0x8000));
 
   if (chunkSize > 0) {
     array.duplicate(_strBody.data() + _bodyOffset, chunkSize);
--- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.cpp #547870:547871
@@ -4256,7 +4256,7 @@
 
 
 QRect KstMouse::mouseRect() const {
-  QRect rc = QRect(QMIN(pressLocation.x(), lastLocation.x()), QMIN(pressLocation.y(), lastLocation.y()), QABS(pressLocation.x() - lastLocation.x()), QABS(pressLocation.y() - lastLocation.y()));
+  QRect rc = QRect(kMin(pressLocation.x(), lastLocation.x()), kMin(pressLocation.y(), lastLocation.y()), QABS(pressLocation.x() - lastLocation.x()), QABS(pressLocation.y() - lastLocation.y()));
   switch (mode) {
     case X_ZOOMBOX:
       rc.setTop(plotGeometry.top());
--- trunk/extragear/graphics/kst/src/libkstapp/kstdatacollection-gui.cpp #547870:547871
@@ -133,7 +133,7 @@
   register int modval;
   QString saving = i18n("Saving vector %1").arg(v->tagName());
 
-  modval = QMAX(vSize/100, 100);
+  modval = kMax(vSize/100, 100);
 
   QString ltxt = "; " + v->tagName() + '\n';
   f->writeBlock(ltxt.ascii(), ltxt.length());
@@ -184,7 +184,7 @@
   }
 
   QString saving = i18n("Saving vectors...");
-  register int modval = QMAX(maxlen/100, 100);
+  register int modval = kMax(maxlen/100, 100);
   app->slotUpdateProgress(maxlen, 0, QString::null);
 
   bool first = true;
--- trunk/extragear/graphics/kst/src/libkstapp/ksttoplevelview.cpp #547870:547871
@@ -825,10 +825,10 @@
   QPoint pos = pos_in;
 
   //pos must be inside the tlv
-  pos.setX(QMAX(pos.x(), geometry().left()));
-  pos.setX(QMIN(pos.x(), geometry().right()));
-  pos.setY(QMIN(pos.y(), geometry().bottom()));
-  pos.setY(QMAX(pos.y(), geometry().top()));
+  pos.setX(kMax(pos.x(), geometry().left()));
+  pos.setX(kMin(pos.x(), geometry().right()));
+  pos.setY(kMin(pos.y(), geometry().bottom()));
+  pos.setY(kMax(pos.y(), geometry().top()));
 
   if (KstViewLinePtr line = kst_cast<KstViewLine>(_pressTarget)) {
     const QRect old(_prevBand);
--- trunk/extragear/graphics/kst/src/libkstapp/kstviewlegend.cpp #547870:547871
@@ -467,13 +467,13 @@
 
   int width, height;
   if (_vertical) {
-    width = QMAX(_textWidth + 9*_ascent/2, _titleWidth);
+    width = kMax(_textWidth + 9*_ascent/2, _titleWidth);
     height = _textHeight;
     if (_titleHeight > 0) {
       height += _titleHeight;
     }
   } else {
-    height = QMAX(_textHeight, _titleHeight);
+    height = kMax(_textHeight, _titleHeight);
 
     if (_titleWidth > 0) {
       width = _titleWidth + _textWidth + 9*_ascent*_curves.count()/2;
--- trunk/extragear/graphics/kst/src/libkstapp/kstviewobject.cpp #547870:547871
@@ -720,13 +720,13 @@
 
   if (!_onGrid) {
     _onGrid = true;
-    _columns = QMAX(1, cols);
+    _columns = kMax(1, cols);
   } else {
     if (cols > 0) {
       _columns = cols;
       assert(_columns > 0);
     } else if (cols <= 0){
-      _columns = QMAX(1, int(sqrt(cnt)));
+      _columns = kMax(1, int(sqrt(cnt)));
     }
   }
 
@@ -1046,23 +1046,16 @@
 }
 
 
-QRect KstViewObject::dataRect() const {
-  return contentsRect();
-}
-
-
-void KstViewObject::setDataRect(const QRect& rect) {
-  setContentsRect(rect);
-}
-
 double KstViewObject::verticalSizeFactor() {
   return 1.0;
 }
 
+
 double KstViewObject::horizontalSizeFactor() {
   return 1.0;
 }
 
+
 QString KstViewObject::menuTitle() const {
   return tagName();
 }
--- trunk/extragear/graphics/kst/src/libkstapp/kstviewobject.h #547870:547871
@@ -96,11 +96,6 @@
     // etc)
     virtual QRect contentsRect() const;
     virtual void setContentsRect(const QRect& rect);
-    // This is, by definition, the meaningful internal contents.  It is often
-    // the contentsRect, but not always.  It is used to position things like
-    // arrows relative to the meaningful contents of the object.
-    virtual QRect dataRect() const;
-    virtual void setDataRect(const QRect& rect);
 
     // with cleanup, use this factor to decide if more space should be used
     // in the row.  1.0 means that the dataRect = geometry.  >1 means dataRect < geometry.


More information about the Kst mailing list