[Kst] kdeextragear-2/kst

George Staikos staikos at kde.org
Fri Jul 9 23:54:08 CEST 2004


CVS commit by staikos: 

update the data manager in realtime, efficiently
note: usage count is still really broken


  M +0 -1      devel-docs/RELEASE_PLAN-0.98   1.30
  M +6 -3      kst/kst.cpp   1.183
  M +1 -1      kst/kst.h   1.85
  M +12 -0     kst/kstdatamanager_i.cpp   1.60
  M +1 -0      kst/kstdatamanager_i.h   1.17
  M +3 -2      kst/kstviewwidget.cpp   1.47


--- kdeextragear-2/kst/devel-docs/RELEASE_PLAN-0.98  #1.29:1.30
@@ -12,5 +12,4 @@
 - fits should store the stat variables as scalars, not as a vector
 - locking is missing in places - especially dialogs (plugin, etc)
-- data manager update doesn't work (ex if vector grows)
 - impossible to create data objects without plotting now
 

--- kdeextragear-2/kst/kst/kst.cpp  #1.182:1.183
@@ -1221,5 +1221,5 @@ void KstApp::samplesDown() {
 
 
-void KstApp::updateDataDialogs() {
+void KstApp::updateDataDialogs(bool dm) {
   if (!viewScalarsDialog->isHidden()) {
     viewScalarsDialog->updateViewScalarsDialog();
@@ -1231,4 +1231,7 @@ void KstApp::updateDataDialogs() {
     viewFitsDialog->updateViewFitsDialog();
   }
+  if (dm) {
+    dataManager->updateContents();
+  }
 }
 
@@ -1247,8 +1250,8 @@ void KstApp::updateDialogs() {
     changeFileDialog->updateChangeFileDialog();
     changeNptsDialog->updateChangeNptsDialog();
-    dataManager->update();
     filterListEditor->update();
-    updateDataDialogs();
+    updateDataDialogs(false);
     vectorSaveDialog->init();
+    dataManager->update();
   }
 }

--- kdeextragear-2/kst/kst/kst.h  #1.84:1.85
@@ -288,5 +288,5 @@ class KstApp : public KMdiMainFrm {
     /** calls update on all the dialogs */
     void updateDialogs();
-    void updateDataDialogs();
+    void updateDataDialogs(bool dataManager = true);
     void updateDialogsForWindow();
     

--- kdeextragear-2/kst/kst/kstdatamanager_i.cpp  #1.59:1.60
@@ -306,4 +306,16 @@ void KstDataManagerI::show_I() {
 
 
+void KstDataManagerI::updateContents() {
+  if (!isShown()) {
+    return;
+  }
+
+  for (QListViewItem *i = DataView->firstChild(); i; i = i->nextSibling()) {
+    KstObjectItem *oi = static_cast<KstObjectItem*>(i);
+    oi->update();
+  }
+}
+
+
 void KstDataManagerI::update() {
   if (!isShown()) {

--- kdeextragear-2/kst/kst/kstdatamanager_i.h  #1.16:1.17
@@ -39,4 +39,5 @@ public:
 public slots:
   void update();
+  void updateContents();
   void show_I();
   void edit_I();

--- kdeextragear-2/kst/kst/kstviewwidget.cpp  #1.46:1.47
@@ -19,8 +19,9 @@
 #include <stdlib.h>
 
+#include <qapplication.h>
 #include <qdragobject.h>
 #include <qevent.h>
-#include <qapplication.h>
 #include <qmessagebox.h>
+#include <qtimer.h>
 
 #include <kdebug.h>
@@ -258,5 +259,5 @@ void KstViewWidget::contextMenuEvent(QCo
     }
     // for convenience, let's update the dialogs
-    KstApp::inst()->updateDialogs();
+    QTimer::singleShot(0, KstApp::inst(), SLOT(updateDialogs()));
   } else {
     delete _menu;





More information about the Kst mailing list