Bug 115988 - "INDEX" overwrites first field name in datawizard/X axis dialog when no kstrc is present
Summary: "INDEX" overwrites first field name in datawizard/X axis dialog when no kstrc...
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Solaris
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-09 11:54 UTC by Nicolas Brisset
Modified: 2005-12-07 19:39 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 Nicolas Brisset 2005-11-09 11:54:40 UTC
Version:           1.2.0_devel (using KDE 3.4.0, compiled sources)
Compiler:          gcc version 3.4.3
OS:                SunOS (sun4u) release 5.8

To reproduce:
- move your ~/.kde/share/config/kstrc to some other name
- "kst -w geocpi0.cdf"
- "Next"
- the list of field names for X starts with "INDEX", which is *wrong*. The first field returned by the current CDF datasource is "Epoch" and it is overwritten somehow

Removing the defaultWizardXVector=... line has the same effect. INDEX is however not used even when the default X vector indicated is not in the list, so that it actually seems to be a problem in the handling of the default name for that vector.
Comment 1 Nicolas Brisset 2005-11-09 11:56:35 UTC
I forgot to mention it, but this is pretty bad and irritating as the first vector is often the most important one :-)
For now, the workaround is to load anything as a function of anything else from the list, and then come back to the wizard, which will show the correct list the second time.
Comment 2 George Staikos 2005-11-09 13:37:20 UTC
On Wednesday 09 November 2005 05:56, Nicolas Brisset wrote:
> 11:56 ------- I forgot to mention it, but this is pretty bad and irritating
> as the first vector is often the most important one :-) For now, the
> workaround is to load anything as a function of anything else from the
> list, and then come back to the wizard, which will show the correct list
> the second time. _______________________________________________


  Is it the case that the CDF source is not returning any field named "INDEX" 
in its list?  That could definitely indicate why this happens.
Comment 3 Nicolas Brisset 2005-11-09 13:48:38 UTC
Yes, it is the case that CDF does not return any field named INDEX. I have done it in this way since CDF files can contain variables with different numbers of samples (which is by the way the case with the files we handle) and I did not think it was worth the trouble trying to handle a virtual INDEX vector with no easy correspondence with the data...
Comment 4 Andrew Walker 2005-12-07 19:39:33 UTC
SVN commit 486401 by arwalker:

BUG:115988 Do not assume that a datasource is going to provide and INDEX vector

 M  +4 -2      datawizard.ui.h  


--- trunk/extragear/graphics/kst/kst/datawizard.ui.h #486400:486401
@@ -217,9 +217,11 @@
 
 	KST::vectorDefaults.sync();
 	QString defaultX = KST::vectorDefaults.wizardXVector();
-	if (defaultX == "INDEX" || fl.contains(defaultX)) {
+	if (fl.contains(defaultX)) {
 	    _xVector->setCurrentText(defaultX);
-	}
+	} else {
+	    _xVector->setCurrentItem(0);
+	}                
 	_file = file;
     } else {
 	_fileType->setText(QString::null);