[Kst] kdeextragear-2/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Wed Dec 15 20:01:02 CET 2004


CVS commit by netterfield: 

On loading from a kst file we were getting three re-draws of the plots:
1) empty plots - really fast and makes loading seem more friendly
2) an explicit re-draw in  KstDoc::newDocument
3) a third one triggered (I think) by the update system (it is after we
exit  KstDoc::newDocument and is delayed if update timer is set really long.

#2 didn't seem to show, and doesn't seem to accomplish anything, since #3 
happens anyway. #2 doesn't work anyway, because it doesn't appear to deal 
correctly with axis allignment (it works plot by plot, and not on the whole
tlv, so if a redraw is not required, it is by luck.)  But I could be wrong here.

This patch gets rid of #2, and does not appear to have any negative side
side effects, but speeds things up in loading a long plot.


  M +21 -17    kstdoc.cpp   1.143


--- kdeextragear-2/kst/kst/kstdoc.cpp  #1.142:1.143
@@ -436,17 +436,21 @@ bool KstDoc::openDocument(const KURL& ur
   // update plots now that lazy loading is done
   //
-  KMdiIterator<KMdiChildView*> *it = KstApp::inst()->createIterator();
-  while (it->currentItem()) {
-    KstViewWindow *c = dynamic_cast<KstViewWindow*>(it->currentItem());
-    if (c) {
-      Kst2DPlotList allplots = c->view()->findChildrenType<Kst2DPlot>(true);
-      for (Kst2DPlotList::Iterator i = allplots.begin(); i != allplots.end(); ++i) {
-        (*i)->draw();
-        kapp->eventLoop()->processEvents(QEventLoop::ExcludeSocketNotifiers, 10);
-      }
-    }
-    it->next();
-  }
-  KstApp::inst()->deleteIterator(it);
+  // the updating happens anyway, so it appears that this is significantly
+  // redundant
+  //
+//   KMdiIterator<KMdiChildView*> *it = KstApp::inst()->createIterator();
+//   while (it->currentItem()) {
+//     KstViewWindow *c = dynamic_cast<KstViewWindow*>(it->currentItem());
+//     if (c) {
+//       Kst2DPlotList allplots = c->view()->findChildrenType<Kst2DPlot>(true);
+//       for (Kst2DPlotList::Iterator i = allplots.begin(); i != allplots.end(); ++i) {
+//         (*i)->draw();
+//         kapp->eventLoop()->processEvents(QEventLoop::ExcludeSocketNotifiers, 10);
+//       }
+//     }
+//     it->next();
+//   }
+
+  //KstApp::inst()->deleteIterator(it);
   kapp->dcopClient()->setAcceptCalls(true);
 





More information about the Kst mailing list