Bug 66303 - kst causes X to consume mucho resources when an invalid vector is being displayed
Summary: kst causes X to consume mucho resources when an invalid vector is being displ...
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: openSUSE Linux
: HI major
Target Milestone: ---
Assignee: George Staikos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-21 01:18 UTC by Matthew Truch
Modified: 2003-10-21 03:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;