Bug 137971 - advance time not constant in presentation mode
Summary: advance time not constant in presentation mode
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Applications
Component: general (show other bugs)
Version: 0.5.5
Platform: Debian testing Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-27 15:05 UTC by Stefan Lienesch
Modified: 2006-11-27 20:20 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Lienesch 2006-11-27 15:05:55 UTC
Version:           0.5.5 (using KDE KDE 3.5.5)
Installed from:    Debian testing/unstable Packages
OS:                Linux

The automatic page switching in presentation mode works all right, even the advance time can be set correctly.

But after first time using a key/mousebutton to switch the pages manually, the automatic mode does not work any longer. The advane time is extremly short and irregular.
Comment 1 Albert Astals Cid 2006-11-27 20:20:34 UTC
SVN commit 608521 by aacid:

Using a singleshot timer to start the auto page change is bad because if the user changes the page manually you get more than one timer active at once and then next pages change in what seems a random time.
BUGS: 137971


 M  +7 -5      presentationwidget.cpp  
 M  +1 -0      presentationwidget.h  


--- branches/KDE/3.5/kdegraphics/kpdf/ui/presentationwidget.cpp #608520:608521
@@ -67,6 +67,8 @@
     connect( m_transitionTimer, SIGNAL( timeout() ), this, SLOT( slotTransitionStep() ) );
     m_overlayHideTimer = new QTimer( this );
     connect( m_overlayHideTimer, SIGNAL( timeout() ), this, SLOT( slotHideOverlay() ) );
+    m_nextPageTimer = new QTimer( this );
+    connect( m_nextPageTimer, SIGNAL( timeout() ), this, SLOT( slotNextPage() ) );
 
     // handle cursor appearance as specified in configuration
     if ( KpdfSettings::slidesCursor() == KpdfSettings::EnumSlidesCursor::HiddenDelay )
@@ -149,7 +151,7 @@
 
     // auto advance to the next page if set
     if ( KpdfSettings::slidesAdvance() )
-        QTimer::singleShot( KpdfSettings::slidesAdvanceTime() * 1000, this, SLOT( slotNextPage() ) );
+        m_nextPageTimer->start( KpdfSettings::slidesAdvanceTime() * 1000 );
 }
 
 void PresentationWidget::notifyPageChanged( int pageNumber, int changedFlags )
@@ -707,7 +709,7 @@
     
         // auto advance to the next page if set
         if ( KpdfSettings::slidesAdvance() )
-            QTimer::singleShot( KpdfSettings::slidesAdvanceTime() * 1000, this, SLOT( slotNextPage() ) );
+            m_nextPageTimer->start( KpdfSettings::slidesAdvanceTime() * 1000 );
     }
     else
     {
@@ -719,7 +721,7 @@
         {
             m_transitionTimer->stop();
             update();
-	}
+        }
     }
 
     // we need the setFocus() call here to let KCursor::autoHide() work correctly
@@ -732,10 +734,10 @@
     {
         // go to previous page
         changePage( m_frameIndex - 1 );
-    
+
         // auto advance to the next page if set
         if ( KpdfSettings::slidesAdvance() )
-            QTimer::singleShot( KpdfSettings::slidesAdvanceTime() * 1000, this, SLOT( slotNextPage() ) );
+            m_nextPageTimer->start( KpdfSettings::slidesAdvanceTime() * 1000 );
     }
     else
     {
--- branches/KDE/3.5/kdegraphics/kpdf/ui/presentationwidget.h #608520:608521
@@ -79,6 +79,7 @@
         // transition related
         QTimer * m_transitionTimer;
         QTimer * m_overlayHideTimer;
+        QTimer * m_nextPageTimer;
         int m_transitionDelay;
         int m_transitionMul;
         QValueList< QRect > m_transitionRects;