[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Fri Jun 25 21:54:50 CEST 2004


CVS commit by arwalker: 

Fixed several actual and potential crashes.


  M +35 -30    curveplacementwidget.ui.h   1.7
  M +27 -26    kst.cpp   1.163
  M +14 -11    kstcurvedialog_i.cpp   1.46
  M +29 -21    ksteqdialog_i.cpp   1.46
  M +10 -2     kstvcurve.cpp   1.35
  M +5 -1      kstviewwindow.cpp   1.16


--- kdeextragear-2/kst/kst/curveplacementwidget.ui.h  #1.6:1.7
@@ -60,4 +60,6 @@ void CurvePlacementWidget::update()
 {
     KstApp *app = KstApp::inst();
+
+    if (app) {
     _plotWindow->clear();
     KMdiIterator<KMdiChildView*> *it = app->createIterator();
@@ -75,4 +77,5 @@ void CurvePlacementWidget::update()
     
     updateEnabled();
+    }
 }
 
@@ -80,4 +83,5 @@ void CurvePlacementWidget::updatePlotLis
 {
   KstApp *app = KstApp::inst();
+  if (app) {
   KMdiChildView *c = app->findWindow(_plotWindow->currentText());
 
@@ -102,4 +106,5 @@ void CurvePlacementWidget::updatePlotLis
     }
   }
+  }
 }
 

--- kdeextragear-2/kst/kst/kst.cpp  #1.162:1.163
@@ -1265,4 +1265,5 @@ void KstApp::samplesDown() {
 
 void KstApp::updateDialogs() {
+  if (!stopping && ::inst) {
   KstVectorDialogI::globalInstance()->update();
   KstPluginDialogI::globalInstance()->update();
@@ -1291,5 +1292,5 @@ void KstApp::updateDialogs() {
 
   vectorSaveDialog->init();
-  //view->update();
+  }
 }
 

--- kdeextragear-2/kst/kst/kstcurvedialog_i.cpp  #1.45:1.46
@@ -26,4 +26,5 @@
 #include <qstring.h>
 #include <qwidget.h>
+#include <qmessagebox.h>
 
 // include files for KDE
@@ -212,7 +212,8 @@ void KstCurveDialogI::update(int new_ind
   /* set the vector pull downs to the correct vectors */
   if (n_c > 0 && !isNew) {
+    if (Select->count() > 0) {
     i_curve = Select->currentItem();
     curve = curves[i_curve];
-
+      if (curve) {
     _xVector->setSelection(curve->getXVTag());
     _yVector->setSelection(curve->getYVTag());
@@ -222,4 +223,6 @@ void KstCurveDialogI::update(int new_ind
     _curveAppearance->setValue(curve->hasLines(), curve->hasPoints(), curve->getColor(), curve->Point.getType(), curve->lineWidth(), curve->lineStyle());
     Delete->setEnabled(curve->getUsage() == 2);
+      }
+    }
   } else { /* no curves defined - initialize what we can to vector 0 */
     _curveAppearance->reset();

--- kdeextragear-2/kst/kst/ksteqdialog_i.cpp  #1.45:1.46
@@ -27,4 +27,5 @@
 #include <qstring.h>
 #include <qwidget.h>
+#include <qmessagebox.h>
 
 // include files for KDE
@@ -189,7 +189,9 @@ void KstEqDialogI::update(int new_index)
   /* Fill fields with the correct values */
   if (n_c > 0 && !isNew) {
+    if (Select->count() > 0) {
     i_eq = Select->currentItem();
     eq = curves[i_eq];
 
+      if (eq) {
     Equation->setText(eq->equation());
 
@@ -201,12 +203,18 @@ void KstEqDialogI::update(int new_index)
       UseExistingVector->setChecked(true);
       DoInterpolation->setChecked(eq->doInterp());
+          if (eq->vX()) {
       _xVectors->setSelection(eq->vX()->tagName());
     }
+        }
+
+        if (eq->vX()) {
     N->setValue(eq->vX()->sampleCount());
     XMin->setText(QString::number(eq->vX()->min()));
     XMax->setText(QString::number(eq->vX()->max()));
-
+        }
     _curveAppearance->setValue(eq->hasLines(), eq->hasPoints(), eq->getColor(), eq->Point.getType(), eq->lineWidth(), eq->lineStyle());
     Delete->setEnabled(eq->getUsage() == 2);
+      }
+    }
   } else {
     Equation->clear();

--- kdeextragear-2/kst/kst/kstvcurve.cpp  #1.34:1.35
@@ -216,9 +216,17 @@ void KstVCurve::getEYPoint(int i, double
 
 QString KstVCurve::getXVTag() const{
+  if (!VX.data()) {
+    return QString::null;
+  } else {
   return VX->tagName();
+  }
 }
 
 QString KstVCurve::getYVTag() const{
+  if (!VY.data()) {
+    return QString::null;
+  } else {
   return VY->tagName();
+  }
 }
 

--- kdeextragear-2/kst/kst/kstviewwindow.cpp  #1.15:1.16
@@ -125,5 +125,9 @@ void KstViewWindow::updateActions() {
 
 KstViewWindow::~KstViewWindow() {
-  KstApp::inst()->updateDialogs();
+  KstApp* pApp = KstApp::inst();
+
+  if (pApp) {
+    pApp->updateDialogs();
+  }
 }
 





More information about the Kst mailing list