[Kst] [Bug 91692] new tool: compare with file...

Rick Chern rchern at interchange.ubc.ca
Tue Jun 28 23:11:19 CEST 2005


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=91692         
rchern interchange ubc ca changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From rchern interchange ubc ca  2005-06-28 23:11 -------
SVN commit 429788 by rchern:

Add duplicated curves to plots as well

CCMAIL: 91692-done bugs kde org


 M  +28 -1     kstchangefiledialog_i.cpp  
 M  +2 -1      kstvcurve.cpp  


--- trunk/extragear/graphics/kst/kst/kstchangefiledialog_i.cpp #429787:429788
 @ -32,6 +32,7  @
 #include "kstdatacollection.h"
 #include "kstrvector.h"
 #include "kstvectordefaults.h"
+#include "kstviewwindow.h"
 
 KstChangeFileDialogI::KstChangeFileDialogI(QWidget* parent,
                                            const char* name,
 @ -200,13 +201,39  @
       app->slotUpdateProgress(selected, ++handled, i18n("Updating vectors..."));
     }
   }
-
+  
   app->slotUpdateProgress(0, 0, QString::null);
 
 
   file->writeUnlock();
   file = 0L;
   
+  // now add any curves to plots if they were duplicated
+  if (_duplicateSelected->isChecked() && _duplicateDependents->isChecked()) {
+    for (QMap<KstDataObjectPtr, KstDataObjectPtr>::Iterator iter = duplicatedMap.begin(); iter != duplicatedMap.end(); ++iter) {
+      if (KstBaseCurvePtr curve = kst_cast<KstBaseCurve>(iter.data())) {
+        KstApp *app = KstApp::inst();
+        KMdiIterator<KMdiChildView*> *it = app->createIterator();
+        while (it->currentItem()) {
+          KstViewWindow *w = dynamic_cast<KstViewWindow*>(it->currentItem());
+          if (w) {
+            KstTopLevelViewPtr view = kst_cast<KstTopLevelView>(w->view());
+            if (view) {
+              Kst2DPlotList plots = view->findChildrenType<Kst2DPlot>(true);
+              for (Kst2DPlotList::Iterator plotIter = plots.begin(); plotIter != plots.end(); ++plotIter) {
+                if ((*plotIter)->Curves.contains(kst_cast<KstBaseCurve>(iter.key()))) {
+                  (*plotIter)->addCurve(curve);
+                }
+              }     
+            }
+          }
+          it->next();
+        }
+        app->deleteIterator(it);
+      }  
+    }
+  }
+  
   if (!invalidSources.isEmpty()) {
     if (invalid == 1) {
       KMessageBox::sorry(this, i18n("The following field is not defined for the requested file:\n%1").arg(invalidSources));
--- trunk/extragear/graphics/kst/kst/kstvcurve.cpp #429787:429788
 @ -567,8 +567,9  @
   vcurve->setLineStyle(LineStyle);
   vcurve->setPointDensity(PointDensity);
   
-  duplicatedMap.insert(this, KstDataObjectPtr(vcurve));  
+  duplicatedMap.insert(this, KstDataObjectPtr(vcurve));
   return KstDataObjectPtr(vcurve);
 }
 
+
 // vim: ts=2 sw=2 et


More information about the Kst mailing list