[Kst] branches/work/kst/hierarchy/kst/src/libkst

Eli Fidler eli at staikos.net
Wed Dec 20 17:25:32 CET 2006


SVN commit 615201 by fidler:

save full tag in .kst file for matrices and vectors
  - this makes .kst files produced by the hierarchy branch loadable in
    old kst


 M  +1 -1      kstamatrix.cpp  
 M  +5 -4      kstrmatrix.cpp  
 M  +1 -1      kstsmatrix.cpp  
 M  +1 -1      kstvector.cpp  


--- branches/work/kst/hierarchy/kst/src/libkst/kstamatrix.cpp #615200:615201
@@ -107,7 +107,7 @@
   }
 
   ts << indent << "<amatrix>" << endl;
-  ts << indent << indent2 << "<tag>" << QStyleSheet::escape(tagName()) << "</tag>" << endl;
+  ts << indent << indent2 << "<tag>" << QStyleSheet::escape(tag().tagString()) << "</tag>" << endl;
   ts << indent << indent2 << "<xmin>" << minX() << "</xmin>" << endl;
   ts << indent << indent2 << "<ymin>" << minY() << "</ymin>" << endl;
   ts << indent << indent2 << "<nx>" << xNumSteps() << "</nx>" << endl;
--- branches/work/kst/hierarchy/kst/src/libkst/kstrmatrix.cpp #615200:615201
@@ -93,11 +93,12 @@
     // provider overrides filename
     in_file = in_provider;
   }
+
+  KstObjectTag tag = KstObjectTag::fromString(in_tag);
   if (in_file) {
-    setTagName(KstObjectTag::fromString(in_file->tag().tagString() + KstObjectTag::tagSeparator + in_tag));
-  } else {
-    setTagName(KstObjectTag::fromString(in_tag));
+    tag.setContext(in_file->tag().fullTag());
   }
+  setTagName(tag);
 
   // call common constructor
   commonConstructor(in_file, in_field, in_xStart, in_yStart, in_xNumSteps, in_yNumSteps, in_doAve, in_doSkip, in_skip);
@@ -110,7 +111,7 @@
     QString indent2 = "  ";
 
     ts << indent << "<rmatrix>" << endl;
-    ts << indent << indent2 << "<tag>" << QStyleSheet::escape(tagName()) << "</tag>" << endl;
+    ts << indent << indent2 << "<tag>" << QStyleSheet::escape(tag().tagString()) << "</tag>" << endl;
     _file->readLock();
     ts << indent << indent2 << "<provider>" << QStyleSheet::escape(_file->tag().tagString()) << "</provider>" << endl;
     ts << indent << indent2 << "<file>" << QStyleSheet::escape(_file->fileName()) << "</file>" << endl;
--- branches/work/kst/hierarchy/kst/src/libkst/kstsmatrix.cpp #615200:615201
@@ -77,7 +77,7 @@
   QString indent2 = "  ";
   
   ts << indent << "<smatrix>" << endl;
-  ts << indent << indent2 << "<tag>" << QStyleSheet::escape(tagName()) << "</tag>" << endl;
+  ts << indent << indent2 << "<tag>" << QStyleSheet::escape(tag().tagString()) << "</tag>" << endl;
   ts << indent << indent2 << "<xmin>" << minX() << "</xmin>" << endl;
   ts << indent << indent2 << "<ymin>" << minY() << "</ymin>" << endl;
   ts << indent << indent2 << "<nx>" << xNumSteps() << "</nx>" << endl;
--- branches/work/kst/hierarchy/kst/src/libkst/kstvector.cpp #615200:615201
@@ -577,7 +577,7 @@
 
 void KstVector::save(QTextStream &ts, const QString& indent, bool saveAbsolutePosition) {
   Q_UNUSED(saveAbsolutePosition)
-  ts << indent << "<tag>" << QStyleSheet::escape(tagName()) << "</tag>" << endl;
+  ts << indent << "<tag>" << QStyleSheet::escape(tag().tagString()) << "</tag>" << endl;
   if (_saveData) {
     QByteArray qba(length()*sizeof(double));
     QDataStream qds(qba, IO_WriteOnly);


More information about the Kst mailing list