[Kst] branches/work/kst/kst1kde4/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Tue Mar 23 21:58:56 CET 2010


SVN commit 1106748 by arwalker:

continue kst1kde4

 M  +1 -1      emailthread.cpp  
 M  +3 -3      kstborderedviewobject.cpp  
 M  +1 -1      ksteventmonitorentry.cpp  
 M  +2 -0      kstgfxmousehandler.h  
 M  +20 -20    kstgfxmousehandlerutils.cpp  
 M  +8 -8      ksttoplevelview.cpp  
 M  +2 -2      kstviewarrow.cpp  
 M  +1 -1      kstviewbox.cpp  
 M  +1 -1      kstviewellipse.cpp  
 M  +2 -2      kstviewobject.cpp  
 M  +1 -1      kstviewpicture.cpp  


--- branches/work/kst/kst1kde4/kst/src/libkstapp/emailthread.cpp #1106747:1106748
@@ -174,7 +174,7 @@
 {
   Q_UNUSED(job)
 
-  int chunkSize = kMin(_bodyLength - _bodyOffset, uint(0x8000));
+  int chunkSize = qMin(_bodyLength - _bodyOffset, uint(0x8000));
 
   if (chunkSize > 0) {
     array.duplicate(_strBody.data() + _bodyOffset, chunkSize);
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstborderedviewobject.cpp #1106747:1106748
@@ -123,7 +123,7 @@
 
 
 void KstBorderedViewObject::setBorderWidth(int w) {
-  int mw = kMax(0, w);
+  int mw = qMax(0, w);
   if (_borderWidth != mw) {
     _borderWidth = mw;
     setDirty();
@@ -137,7 +137,7 @@
 
 
 void KstBorderedViewObject::setMargin(int w) {
-  int mm = kMax(0, w);
+  int mm = qMax(0, w);
   if (_margin != mm) {
     _margin = mm;
     setDirty();
@@ -151,7 +151,7 @@
 
 
 void KstBorderedViewObject::setPadding(int p) {
-  int mp = kMax(0, p);
+  int mp = qMax(0, p);
   if (_padding != mp) {
     _padding = mp;
     setDirty();
--- branches/work/kst/kst1kde4/kst/src/libkstapp/ksteventmonitorentry.cpp #1106747:1106748
@@ -195,7 +195,7 @@
     int ns = 1;
 
     for (KstVectorMap::ConstIterator i = _vectorsUsed.begin(); i != _vectorsUsed.end(); ++i) {
-      ns = kMax(ns, i.data()->length());
+      ns = qMax(ns, i.data()->length());
     }
 
     double *rawValuesX = 0L;
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstgfxmousehandler.h #1106747:1106748
@@ -18,7 +18,9 @@
 #ifndef KSTGFXMOUSEHANDLER_H
 #define KSTGFXMOUSEHANDLER_H
 
+#include <QPoint>
 #include <QPointer>
+#include <QRect>
 
 #include "kstobject.h"
 
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstgfxmousehandlerutils.cpp #1106747:1106748
@@ -31,24 +31,24 @@
 
   if (fromPoint.y() == toPoint.y()) {
     npos.setY(fromPoint.y());
-    npos.setX(kMax(npos.x(), bounds.left()));
-    npos.setX(kMin(npos.x(), bounds.right()));
+    npos.setX(qMax(npos.x(), bounds.left()));
+    npos.setX(qMin(npos.x(), bounds.right()));
   } else if (fromPoint.x() == toPoint.x()) {
     npos.setX(fromPoint.x());
-    npos.setY(kMax(npos.y(), bounds.top()));
-    npos.setY(kMin(npos.y(), bounds.bottom()));
+    npos.setY(qMax(npos.y(), bounds.top()));
+    npos.setY(qMin(npos.y(), bounds.bottom()));
   } else {
     double newxpos, newypos;
     double slope = double(toPoint.y() - fromPoint.y()) / double(toPoint.x() - fromPoint.x());
 
     newxpos = (double(pos.y()) + slope*double(fromPoint.x()) + double(pos.x())/slope -double(fromPoint.y())) / (slope + 1.0/slope); //we want the tip of our new line to be as close as possible to the original line (while still maintaining aspect). 
 
-    newxpos = kMin(newxpos, double(bounds.right())); //ensure that our x is inside the bounds.
-    newxpos = kMax(newxpos, double(bounds.left())); // ""
+    newxpos = qMin(newxpos, double(bounds.right())); //ensure that our x is inside the bounds.
+    newxpos = qMax(newxpos, double(bounds.left())); // ""
     newypos = slope*(newxpos - double(fromPoint.x())) + double(fromPoint.y()); //consistency w/ x.
 
-    newypos = kMin(newypos, double(bounds.bottom())); //ensure that our y is inside the bounds.
-    newypos = kMax(newypos, double(bounds.top())); // ""*/
+    newypos = qMin(newypos, double(bounds.bottom())); //ensure that our y is inside the bounds.
+    newypos = qMax(newypos, double(bounds.top())); // ""*/
     newxpos = double(fromPoint.x()) + (newypos - double(fromPoint.y()))/slope; // x will still be inside the bounds because we have just moved newypos closer to fromPoint.y(), which will send newxpos closer to fromPoint.x(), ie. in the direction further 'into' the bounds.
 
     npos.setX(int(newxpos));
@@ -85,11 +85,11 @@
   newHalfHeight = abs((pos - anchorPoint).y());
 
   if (maintainAspect) {
-    newHalfWidth = kMin(newHalfWidth,anchorPoint.x() - bounds.left());
-    newHalfWidth = kMin(newHalfWidth,bounds.right() - anchorPoint.x());
+    newHalfWidth = qMin(newHalfWidth,anchorPoint.x() - bounds.left());
+    newHalfWidth = qMin(newHalfWidth,bounds.right() - anchorPoint.x());
 
-    newHalfHeight = kMin(newHalfHeight,anchorPoint.y() - bounds.top());
-    newHalfHeight = kMin(newHalfHeight,bounds.bottom() - anchorPoint.y());
+    newHalfHeight = qMin(newHalfHeight,anchorPoint.y() - bounds.top());
+    newHalfHeight = qMin(newHalfHeight,bounds.bottom() - anchorPoint.y());
 
     QSize newSize(originalRect.size());
     newSize.scale(2*newHalfWidth, 2*newHalfHeight, QSize::ScaleMin);
@@ -115,8 +115,8 @@
     if (maintainAspect) {
       double newHalfHeight = originalSize.height() * (abs(newWidth) + 1) / originalSize.width() / 2.0; //defined with the QRect convention (height = bot - top + 1)
 
-      newHalfHeight = kMin(double(movePoint.y() - bounds.top()) + 1, newHalfHeight); // ensure we are still within the bounds.
-      newHalfHeight = kMin(double(bounds.bottom() - movePoint.y()) + 1, newHalfHeight);
+      newHalfHeight = qMin(double(movePoint.y() - bounds.top()) + 1, newHalfHeight); // ensure we are still within the bounds.
+      newHalfHeight = qMin(double(bounds.bottom() - movePoint.y()) + 1, newHalfHeight);
 
       if (newWidth == 0) { // anything better to be done?
         newWidth = 1;
@@ -137,8 +137,8 @@
     if (maintainAspect) {
       double newHalfWidth = originalSize.width() * (abs(newHeight) + 1) / originalSize.height() / 2.0;
 
-      newHalfWidth = kMin(double(movePoint.x() - bounds.left() + 1), newHalfWidth);
-      newHalfWidth = kMin(double(bounds.right() - movePoint.x() + 1), newHalfWidth);
+      newHalfWidth = qMin(double(movePoint.x() - bounds.left() + 1), newHalfWidth);
+      newHalfWidth = qMin(double(bounds.right() - movePoint.x() + 1), newHalfWidth);
 
       if (newHeight == 0) {
         newHeight = 1;
@@ -173,16 +173,16 @@
     QSize newSize(originalRect.size());
 
     if (vertical) {
-      newHalfHeight = kMin(newHalfHeight, anchorPoint.y() - bounds.top());
-      newHalfHeight = kMin(newHalfHeight, bounds.bottom() - anchorPoint.y());
+      newHalfHeight = qMin(newHalfHeight, anchorPoint.y() - bounds.top());
+      newHalfHeight = qMin(newHalfHeight, bounds.bottom() - anchorPoint.y());
       if (newHalfHeight > originalRect.height()/2) {
         newSize.scale(originalRect.width(), 2*newHalfHeight, QSize::ScaleMax);
       } else {
         newSize.scale(originalRect.width(), 2*newHalfHeight, QSize::ScaleMin);
       }
     } else {
-      newHalfWidth = kMin(newHalfWidth, anchorPoint.x() - bounds.left());
-      newHalfWidth = kMin(newHalfWidth, bounds.right() - anchorPoint.x());
+      newHalfWidth = qMin(newHalfWidth, anchorPoint.x() - bounds.left());
+      newHalfWidth = qMin(newHalfWidth, bounds.right() - anchorPoint.x());
       if (newHalfWidth > originalRect.width()/2) {
         newSize.scale(2*newHalfWidth, originalRect.height(), QSize::ScaleMax);
       } else {
--- branches/work/kst/kst1kde4/kst/src/libkstapp/ksttoplevelview.cpp #1106747:1106748
@@ -482,10 +482,10 @@
 
   anchor_pt = move_pt = originalSize.center();
 
-  npos.setX(kMax(npos.x(), bounds.left()));
-  npos.setX(kMin(npos.x(), bounds.right()));
-  npos.setY(kMin(npos.y(), bounds.bottom()));
-  npos.setY(kMax(npos.y(), bounds.top()));
+  npos.setX(qMax(npos.x(), bounds.left()));
+  npos.setX(qMin(npos.x(), bounds.right()));
+  npos.setY(qMin(npos.y(), bounds.bottom()));
+  npos.setY(qMax(npos.y(), bounds.top()));
 
   if ((direction & UP) != 0) {
     move_pt.setY(originalSize.top());
@@ -515,10 +515,10 @@
   QPoint anchor_pt, move_pt;
   QPoint npos = pos;
 
-  npos.setX(kMax(npos.x(), bounds.left()));
-  npos.setX(kMin(npos.x(), bounds.right()));
-  npos.setY(kMin(npos.y(), bounds.bottom()));
-  npos.setY(kMax(npos.y(), bounds.top()));
+  npos.setX(qMax(npos.x(), bounds.left()));
+  npos.setX(qMin(npos.x(), bounds.right()));
+  npos.setY(qMin(npos.y(), bounds.bottom()));
+  npos.setY(qMax(npos.y(), bounds.top()));
 
   anchor_pt = move_pt = originalSize.center();
 
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstviewarrow.cpp #1106747:1106748
@@ -125,7 +125,7 @@
 
 QRegion KstViewArrow::clipRegion() {
   if (_clipMask.isNull()) {
-    double scaling = kMax(_fromArrowScaling, _toArrowScaling);
+    double scaling = qMax(_fromArrowScaling, _toArrowScaling);
     int w = int(ceil(SIZE_ARROW * scaling * double(width())));
     QRect rect(0, 0, _geom.bottomRight().x() + w + 1, _geom.bottomRight().y() + w + 1);
 
@@ -293,7 +293,7 @@
   if (_hasFromArrow || _hasToArrow) {
     double scaling;
     if (_hasFromArrow && _hasToArrow) {
-      scaling = kMax(_fromArrowScaling, _toArrowScaling);
+      scaling = qMax(_fromArrowScaling, _toArrowScaling);
     } else if (_hasFromArrow) {
       scaling = _fromArrowScaling;
     } else {
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstviewbox.cpp #1106747:1106748
@@ -257,7 +257,7 @@
 
 
 void KstViewBox::setBorderWidth(int w) {
-  int mw = kMax(0, w);
+  int mw = qMax(0, w);
   if (_borderWidth != mw) {
     _borderWidth = mw;
     setDirty();
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstviewellipse.cpp #1106747:1106748
@@ -188,7 +188,7 @@
 
 void KstViewEllipse::setBorderWidth(int width) {
   if (_borderWidth != width) {
-    _borderWidth = kMax(0, width);
+    _borderWidth = qMax(0, width);
     setDirty();
   }
 }
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstviewobject.cpp #1106747:1106748
@@ -752,13 +752,13 @@
 
     if (!_onGrid) {
       _onGrid = true;
-      _columns = kMax(1, cols);
+      _columns = qMax(1, cols);
       cleanupRandomLayout(_columns, childrenCopy);
     } else {
       if (cols > 0) {
         _columns = cols;
       } else if (cols <= 0) {
-        _columns = kMax(1, int(sqrt(cnt)));
+        _columns = qMax(1, int(sqrt(cnt)));
       }
       cleanupGridLayout(_columns, childrenCopy);
     }
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstviewpicture.cpp #1106747:1106748
@@ -278,7 +278,7 @@
 
 
 void KstViewPicture::setRefreshTimer(int seconds) {
-  _refresh = kMax(0, seconds);
+  _refresh = qMax(0, seconds);
   if (_refresh) {
     if (!_timer) {
       _timer = new QTimer(this);


More information about the Kst mailing list