[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Wed Jun 16 22:07:50 CEST 2004


CVS commit by staikos: 

implement tie voting and tieing across plots


  M +24 -4     kst.cpp   1.154


--- kdeextragear-2/kst/kst/kst.cpp  #1.153:1.154
@@ -1165,8 +1165,28 @@ void KstApp::slotTimer() {
 
 void KstApp::tieAll() {
-  KstViewWindow *w = dynamic_cast<KstViewWindow*>(activeWindow());
-  if (w) {
-    KstTopLevelViewPtr vp = w->view();
-    vp->forEachChild(&Kst2DPlot::setTied, true);
+  int tied = 0;
+  Kst2DPlotList pl = Kst2DPlot::globalPlotList();
+  for (Kst2DPlotList::Iterator i = pl.begin(); i != pl.end(); ++i) {
+    if ((*i)->isTied()) {
+      ++tied;
+    } else {
+      --tied;
+    }
+  }
+
+  for (Kst2DPlotList::Iterator i = pl.begin(); i != pl.end(); ++i) {
+    (*i)->setTied(tied <= 0);
+  }
+
+  KMdiIterator<KMdiChildView*> *pIterator = createIterator();
+  if (pIterator) {
+    while (pIterator->currentItem()) {
+      KstViewWindow *pView = dynamic_cast<KstViewWindow*>(pIterator->currentItem());
+      if (pView) {
+        pView->view()->paint();
+      }
+      pIterator->next();
+    }
+    deleteIterator(pIterator);
   }
 }





More information about the Kst mailing list