[Kst] branches/work/kst/portto4/kst/src/libkstapp

Barth Netterfield netterfield at astro.utoronto.ca
Sat Feb 26 22:01:20 CET 2011


SVN commit 1222872 by netterfield:

BUG: 267196
Fix crash case when units, etc of new file are not picked up in 'duplicate file'.

This exposes another bug: why aren't the units properly picked up?



 M  +3 -1      changefiledialog.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/changefiledialog.cpp #1222871:1222872
@@ -320,11 +320,13 @@
           PrimitiveList output_prims = prim->outputPrimitives();
           PrimitiveList dup_output_prims = newPrim->outputPrimitives();
           // add output primitives to list of primitives that have been duplicated.
-          int n = output_prims.count();
+          int n = qMin(output_prims.count(), dup_output_prims.count());
           for (int i_output=0; i_output<n; i_output++) {
+            if (output_prims.at(i_output)->descriptiveName() == dup_output_prims.at(i_output)->descriptiveName()) {
             duplicatedPrimitiveList.append(output_prims.at(i_output));
             duplicatedPrimitiveMap[output_prims.at(i_output)] = dup_output_prims.at(i_output);
           }
+          }
         } else {
           prim->readLock();
           if (!oldSources.contains(dp->dataSource())) {


More information about the Kst mailing list