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

Mike Fenton mike at staikos.net
Thu May 28 18:10:53 CEST 2009


SVN commit 974166 by fenton:

Warning cleanup.


 M  +1 -1      document.cpp  
 M  +5 -5      plotrenderitem.cpp  
 M  +1 -1      viewgridlayout.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/document.cpp #974165:974166
@@ -223,7 +223,7 @@
                   int idx = _win->tabWidget()->indexOf(currentView);
                   _win->tabWidget()->setTabText(idx, nm.toString());
                 }
-                qreal width, height;
+                qreal width = 1.0, height = 1.0;
                 QStringRef string = attrs.value("width");
                 if (!string.isNull()) {
                    width = string.toString().toDouble();
--- branches/work/kst/portto4/kst/src/libkstapp/plotrenderitem.cpp #974165:974166
@@ -427,7 +427,7 @@
 void PlotRenderItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
   const QPointF point = plotItem()->mapToProjection(event->pos());
   qreal range = qMax(plotItem()->xMax() - plotItem()->xMin(), plotItem()->yMax() - plotItem()->yMin());
-  double distance;
+  double distance = 1000;
   bool first = true;
   RelationPtr closestRelation = 0;
   foreach (RelationPtr relation, _relationList) {
@@ -875,11 +875,11 @@
 void PlotRenderItem::computeNoSpike(Qt::Orientation orientation, qreal *min, qreal *max) const {
   //The previous values are of no consequence as this algorithm does not depend
   //on the previous values.  So start over so that first active relation initializes.
-  qreal minimum;
-  qreal maximum;
   bool unInitialized = true;
 
   bool axisLog = orientation == Qt::Horizontal ? plotItem()->xAxis()->axisLog() : plotItem()->yAxis()->axisLog();
+  qreal minimum = axisLog ? 0.0 : -0.1;
+  qreal maximum = 0.2;
 
   foreach (RelationPtr relation, relationList()) {
       if (relation->ignoreAutoScale())
@@ -901,9 +901,9 @@
       unInitialized = false;
   }
 
-  if (unInitialized || maximum <= minimum) {
+  if (maximum <= minimum) {
     minimum = axisLog ? 0.0 : -0.1;
-    minimum = 0.2;
+    maximum = 0.2;
   }
 
   if (axisLog && minimum < 0.0) {
--- branches/work/kst/portto4/kst/src/libkstapp/viewgridlayout.cpp #974165:974166
@@ -692,7 +692,7 @@
 
   qreal xStart = 0.0, xStop = 0.0;
   qreal yStart = 0.0, yStop = 0.0;
-  qreal xMin, xMax, yMin, yMax;
+  qreal xMin = 0.0, xMax = 0.0, yMin = 0.0, yMax = 0.0;
 
   QList<ViewItem*> viewItems;
   QList<QGraphicsItem*> list = item->QGraphicsItem::children();


More information about the Kst mailing list