Bug 143602

Summary: Using Advance 1 Screen sometimes jumps to wrong position
Product: [Applications] kst Reporter: Andrew Walker <arwalker>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Proposed patch

Description Andrew Walker 2007-03-29 19:59:06 UTC
Version:           HEAD (using KDE KDE 3.5.1)
OS:                Linux

PROBLEM:

When viewing live data hitting on the Advance 1 Screen does not take the user to the anticipated position

STEPS TO REPRODUCE:

Run dirfile_maker to create a data file updating in real time
Start Kst
Start the data wizard and select a vector from the dirfile_maker data file
In the data wizard set the Data Range: Start to 0 and (after unchecking 'Read to end' if necessary) the Range to 100
In the data wizard click finish
Click on the 'Read from End' toolbar button
Click on the 'Advance 1 Screen' button

RESULTS:

The curve displays the second screen of data associated with the Curve and appears static

EXPECTED RESULTS:

We leave 'Read to end' mode and the final screen of data at the time the button is pressed is displayed
Comment 1 Andrew Walker 2007-04-06 00:35:54 UTC
Created attachment 20197 [details]
Proposed patch
Comment 2 Netterfield 2007-04-06 03:43:29 UTC
Looks good, but it makes me just a little worried for 1.4.0 given the late 
date.  The current behavior has been around for a long time, and hasn't been 
debilitating, so I reluctantly say to delay commiting this until 1.4.0 is out 
the door, and then commit for 1.4.1.


On Thursday 05 April 2007 6:35:54 pm Andrew Walker wrote:
[bugs.kde.org quoted mail]
Comment 3 Andrew Walker 2007-04-12 20:04:45 UTC
SVN commit 653144 by arwalker:

BUG:143602 Correctly handle 'advance one screen' when in 'read to end' mode

 M  +5 -1      kstdoc.cpp  


--- branches/work/kst/1.5/kst/src/libkstapp/kstdoc.cpp #653143:653144
@@ -889,7 +889,11 @@
     int fileN = V->fileLength();
 
     bool didChange = false;
-    if (f0 + 2 * n > fileN) {
+
+    if (f0 == -1) {
+      didChange = true;
+      f0 = fileN - n;
+    } else if (f0 + 2 * n > fileN) {
       didChange = f0 != fileN - n;
       changed = changed || didChange;
       f0 = fileN - n;