Bug 66303

Summary: kst causes X to consume mucho resources when an invalid vector is being displayed
Product: [Applications] kst Reporter: Matthew Truch <matt>
Component: generalAssignee: George Staikos <staikos>
Status: RESOLVED FIXED    
Severity: major    
Priority: HI    
Version: 1.x   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Matthew Truch 2003-10-21 01:18:35 UTC
Version:           0.92 (using KDE KDE 3.1)
Installed from:    SuSE RPMs
OS:          Linux

When kst trys to display a curve which contains a vector with an invalid field, the refresh of kst races, and X consumes alot of CPU (and/or bogs down the graphics card).  

To reproduce:  Open a new kst, click on quickly create a new curve.  Choose a valid filename and valid X vector (ie "INDEX"), but a nonexistant Y vector (eg "IJGLKSDNLKFSAJD").  Click OK.  A dialog will pop up saying you have choosen an invalid vector, but kst will refresh repeatadly anyways.  Clicking pause temporarily fixes the problem (until you run again), and removing the vector (through the data manager) fixes the problem until another bunk vector is added.  

Expected behavior:  kst should not race when an invalid vector is loaded.
Comment 1 George Staikos 2003-10-21 01:24:52 UTC
Haven't reproduced it yet, but this has to be investigated before 0.93.
Comment 2 George Staikos 2003-10-21 03:19:28 UTC
Subject: kdeextragear-2/kst/kst

CVS commit by staikos: 

Don't leave invalid vectors in the list to be updated from.

CCMAIL: 66303-done@bugs.kde.org


  M +6 -2      kstquickcurvesdialog_i.cpp   1.24


--- kdeextragear-2/kst/kst/kstquickcurvesdialog_i.cpp  #1.23:1.24
@@ -246,4 +246,6 @@ bool KstQuickCurvesDialogI::apply(bool a
   if (x_is_new) {
     if (!vx->isValid()) {
+      KST::vectorList.remove(vx.data());
+      KST::vectorList.remove(vy.data());
       KMessageBox::sorry(0L, i18n("The requested X vector is not in the file."));
       return false;
@@ -252,4 +254,6 @@ bool KstQuickCurvesDialogI::apply(bool a
   if (y_is_new) {
     if (!vy->isValid()) {
+      KST::vectorList.remove(vx.data());
+      KST::vectorList.remove(vy.data());
       KMessageBox::sorry(0L, i18n("The requested Y vector is not in the file."));
       return false;
@@ -288,8 +292,8 @@ bool KstQuickCurvesDialogI::addPlot() {
   KstPlot *plot = KST::plotList.addPlot(QString::null, PlotCols->value());
   PlotList->insertItem(plot->tagName());
-  PlotList->setCurrentItem(PlotList->count()-1);
+  PlotList->setCurrentItem(PlotList->count() - 1);
 
   if (!apply(true)) {
-    PlotList->removeItem(PlotList->count()-1);
+    PlotList->removeItem(PlotList->count() - 1);
     KST::plotList.remove(plot);
     return false;