Bug 86586

Summary: Change data file issues
Product: [Applications] kst Reporter: Nicolas Brisset <nicolas.brisset>
Component: generalAssignee: kst
Status: RESOLVED LATER    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Solaris   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Nicolas Brisset 2004-08-04 18:23:46 UTC
Version:           0.99-devel (using KDE 3.2.1, compiled sources)
Compiler:          gcc version 3.3.2
OS:                SunOS (sun4u) release 5.8

When using the "Data->Change data file..." menu, I had the following problems:
1) the top labels of the graphs were not updated so that I first wondered whether the operation had really been performed. Maybe they could be changed (possibly after user confirmation ?)
2) when in "paused" mode, the action is not taken. Expected behavior would be for the change to take effect, even if updates are disabled (and they should remain disabled !)
Comment 1 Netterfield 2004-08-10 16:00:11 UTC
In the future, please do not report multiple bugs in one bug report.
Comment 2 George Staikos 2004-08-13 22:10:46 UTC
Will take care of #2 shortly, part of 0.99.  I don't like the idea of updating in this case though...
Comment 3 George Staikos 2004-08-13 22:14:36 UTC
CVS commit by staikos: 

- remove undefined symbol from kst.h (don't know how that managed to hang
  around so long)
- forced updates override paused state in the update thread
- changing the data file forces an update

  -> fixes #2 in #86586
CCMAIL: 86586@bugs.kde.org


  M +1 -0      kst.cpp   1.208
  M +0 -3      kst.h   1.96
  M +3 -0      kstchangefiledialog_i.cpp   1.18
  M +11 -12    updatethread.cpp   1.25


--- kdeextragear-2/kst/kst/kst.h  #1.95:1.96
@@ -105,7 +105,4 @@ class KstApp : public KMdiMainFrm {
     bool getTieZoom();
 
-    /** Update everything */
-    void forcedUpdate();
-
     KstTopLevelViewPtr activeView();
     Kst2DPlotMap& plotHolderWhileOpeningDocument();

--- kdeextragear-2/kst/kst/kstchangefiledialog_i.cpp  #1.17:1.18
@@ -27,4 +27,5 @@
 #include <kurlrequester.h>
 
+#include "kst.h"
 #include "kstchangefiledialog_i.h"
 #include "kstdatacollection.h"
@@ -114,4 +115,6 @@ void KstChangeFileDialogI::applyFileChan
   file = 0L;
   emit docChanged();
+  // Force an update in case we're in paused mode
+  KstApp::inst()->forceUpdate();
 }
 

--- kdeextragear-2/kst/kst/updatethread.cpp  #1.24:1.25
@@ -63,5 +63,10 @@ void UpdateThread::run() {
     }
 
-    if (_paused) {
+    _statusMutex.lock();
+    force = _force;
+    _force = false;
+    _statusMutex.unlock();
+
+    if (_paused && !force) {
 #if UPDATEDEBUG > 0
       kdDebug() << "Update thread paused..." << endl;
@@ -70,10 +75,4 @@ void UpdateThread::run() {
     }
 
-
-    _statusMutex.lock();
-    force = _force;
-    _force = false;
-    _statusMutex.unlock();
-
     bool gotData = false;
     if (doUpdates(force, &gotData)) {
@@ -146,5 +145,5 @@ bool UpdateThread::doUpdates(bool force,
     dsp->update();
 
-    if (_done || _paused) {
+    if (_done || (_paused && !force)) {
       KST::dataSourceList.lock().readUnlock();
 #if UPDATEDEBUG > 1
@@ -169,5 +168,5 @@ bool UpdateThread::doUpdates(bool force,
 
       if (tU != KstObject::NO_CHANGE) {
-        if (_done || _paused) {
+        if (_done || (_paused && !force)) {
           rv->writeUnlock();
 #if UPDATEDEBUG > 1
@@ -185,5 +184,5 @@ bool UpdateThread::doUpdates(bool force,
       rv->writeUnlock();
 
-      if (_done || _paused) {
+      if (_done || (_paused && !force)) {
 #if UPDATEDEBUG > 1
         kdDebug() << "3 Returning from scan with U=" << (int)U << endl;
@@ -224,5 +223,5 @@ bool UpdateThread::doUpdates(bool force,
       }
 
-      if (_done || _paused) {
+      if (_done || (_paused && !force)) {
 #if UPDATEDEBUG > 1
         kdDebug() << "4 Returning from scan with U=" << (int)U << endl;
@@ -244,5 +243,5 @@ bool UpdateThread::doUpdates(bool force,
         bcp->writeUnlock();
 
-        if (_done || _paused) {
+        if (_done || (_paused && !force)) {
 #if UPDATEDEBUG > 1
           kdDebug() << "5 Returning from scan with U=" << (int)U << endl;


Comment 4 Andrew Walker 2004-09-02 00:09:31 UTC
In reference to 1):

the default labels are currently generated at plot creation and are never re-generated. As a result changing the curves, data files, etc. will have no effect on the labels. One possibility would be to have the concept of a default label in the plot dialog, indicated by a checkbox. Leaving this checked would disable the corresponding label edit field and update the label each time the plot is redrawn. Unchecking it would give the current behaviour.
Comment 5 Nicolas Brisset 2004-09-06 16:52:36 UTC
I like Andrew's suggestions in reference to 1). I have just had the problem again that I was not looking at what I thought due to the filename not being in sync with the data :-( His suggestion would be a nice way to fix it I think.
Comment 6 George Staikos 2004-09-13 21:56:32 UTC
On an implementation level it might make sense to have either an inherited label class or an option in the label class that says that its label text is 'provided' by a given dataobject.
Comment 7 George Staikos 2004-09-22 22:01:10 UTC
We've basically decided to implement what I suggested in #6.  This bug is misleading now, let's close it.
Comment 8 Nicolas Brisset 2004-10-13 00:37:06 UTC
I believe there is no other open bug report for part 1) now that there are hint mechanisms in place (if I've understood correctly what they mean).
Should I make a new one, as this feature (automatic update of plot labels when not specified manually) is a very common request I get from all users who really use kst ?