Bug 153393

Summary: changing data file in Edit Vector dialogue corrupts kst file
Product: [Applications] kst Reporter: D. V. Wiebe <dvw>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.4.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description D. V. Wiebe 2007-12-04 01:13:23 UTC
Version:           1.5.0 (using KDE KDE 3.5.8)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 4.1.2 
OS:                Linux

Using the Edit Vector dialogue box to change the datasource of a vector, corrupts .kst files.  The problem is that the datasouce encoded into the vector's tag in the .kst file (using the "<datasource>/<field>" format) isn't properly updated.

Steps to reproduce:

1. Plot a field from a datasource.
2. Right click on the plot -> Edit -> Vector
3. In the Edit Vector dialogue, change the datasource to something else that provides the same field.
4. File -> Save -> save session to a .kst file
5. File -> Open -> open the kst file just created.

Results:

  kst will claim to be unable to load the kst file due the vector being missing.

Expected results:

  kst should be able to load the kst file.

The .kst file corruption can be undone by manually editing the .kst file and deleting all the "<datasource>/" parts from vector tag.
Comment 1 Andrew Walker 2007-12-11 21:04:36 UTC
Seems to be more problems with the hierarchical naming scheme
Comment 2 Andrew Walker 2007-12-11 23:51:42 UTC
This problem occurs because in the KstRvector constructor the specified tag name is overriden in the following code:

  if (in_file) {
    // use datasource as tag context for this RVector
    // allow unique vector names to be displayed at top-level
    setTagName(KstObjectTag(tag().tag(), in_file->tag(), false));
  }

However, the corresponding tagname in the curve attributes is not changed in the same way so the curve is left with a vector that could not be found. 

The solution is one of the following:
* not to override the vector tagname when it is loaded
* to update the curve's vector tagname similarly when loaded
* when the datasource is changed change the tagname at that point so the overriding of the vector tagname when it is loaded has no effect
Comment 3 Andrew Walker 2007-12-13 00:50:53 UTC
See also bug #141597
Comment 4 Andrew Walker 2007-12-14 21:18:36 UTC
SVN commit 748562 by arwalker:

BUG:153393 update tag name when file is changed

 M  +4 -5      libkst/kstrvector.cpp  
 M  +0 -1      libkstapp/kstvectordialog_i.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=748562