Bug 51014

Summary: kghostview (as konqueror part) opening next document breaks paper orientation
Product: [Unmaintained] kghostview Reporter: frank.dekervel
Component: generalAssignee: Wilco Greven <greven>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Proposed fix against CVS HEAD

Description frank.dekervel 2002-11-21 20:11:52 UTC
Version:           0.13.2 (using KDE 3.1.0 (KDE 3.1 RC4))
Installed from:    compiled sources
Compiler:          gcc version 2.95.4 20011002 (Debian prerelease)
OS:          Linux (i686) release 2.4.19

when i change the paper orientation for a .ps document in konqueror, and i open another ps document in the same konqueror, the menu 'paper orientation' is inconsistent with the real paper orientation.
i did this:
	-> opened landscape ps, was rendered upside down, so i chose seascape
	-> open next ps document. its rendered landscape again (upside down) but there is still
	     a 'v' next to 'seascape' in the view->paper orientation menu.
	-> i have to select something else and then seascape again to get it right
Comment 1 Luís Pedro Coelho 2002-12-04 20:30:35 UTC
Hi, 
 
The bug report is about kghostview used as a part, but it affects kghostview 
as an app as well. The attached patch seems to fixed it. 
 
It changes the behaviour slightly to be, IMHO, more correct. Before, none of 
the options were checked by default. Now, "Auto" (which is default behaviour) 
is checked until you select something else. So this reflects the state of the 
program better. 
 
HTH 
-- 
Luis Pedro Coelho 
 
check out my game of hearts for the KDE at 
 
http://hearts.sf.net 
 
Comment 2 Luís Pedro Coelho 2002-12-04 20:32:58 UTC
Created attachment 573 [details]
Proposed fix against CVS HEAD
Comment 3 Luís Pedro Coelho 2003-04-05 14:31:57 UTC
Subject: KDE_3_1_BRANCH: kdegraphics/kghostview

CVS commit by luis_pedro: 

Apply my own patch from when I didn't have a CVS account.

This goes towards fixing bug 51014.
It works in BRANCH, but HEAD has been changed since my patch and needs porting.

CCMAIL: 51014@bugs.kde.org


  M +11 -1     kgv_view.cpp   1.110.2.2
  M +5 -0      kgv_view.h   1.54.2.1


--- kdegraphics/kghostview/kgv_view.h  #1.54:1.54.2.1
@@ -135,4 +135,9 @@ protected:
     void writeSettings();
 
+    /**
+     * Resets the menu settings, i.e. sets View->Orientation to "Auto", etc.
+     */
+    void resetMenu();
+
 private:
     KGVBrowserExtension* _extension;

--- kdegraphics/kghostview/kgv_view.cpp  #1.110.2.1:1.110.2.2
@@ -474,4 +474,5 @@ bool KGVPart::openURL( const KURL& url )
              SLOT( slotMimetypeError() ) );
    
+    resetMenu();
     return true;
 }
@@ -601,5 +602,8 @@ void KGVPart::slotJobFinished( KIO::Job*
         emit canceled( job->errorString() );
     else 
+    {
         _docManager->openFile( m_file, _mimetype );
+        resetMenu();
+    }
 }
 
@@ -612,4 +616,5 @@ void KGVPart::slotFileDirty( const QStri
         _currentPage = _docManager->currentPage();
         _docManager->openFile( m_file, _mimetype );
+        resetMenu();
     }
 }
@@ -687,4 +692,9 @@ void KGVPart::slotZoomOut()
 }
 
+void KGVPart::resetMenu()
+{
+    _selectOrientation->setCurrentItem( 0 ); // Auto
+    _selectMedia->setCurrentItem( 0 ); // Auto
+}
 
 KGVBrowserExtension::KGVBrowserExtension( KGVPart *parent ) :


Comment 4 Luís Pedro Coelho 2003-04-16 00:58:42 UTC
Subject: kdegraphics/kghostview

CVS commit by luis_pedro: 

Forward porting of fix to Bug 51014: opening next document breaks paper orientation.

We need to restore the display options to their default settings on opening a new document.
Note that we shouldn't do that if we are reloading a document which changed.

CCMAIL: 51014-done@bugs.kde.org


  M +1 -0      kgv_view.cpp   1.129


--- kdegraphics/kghostview/kgv_view.cpp  #1.128:1.129
@@ -554,4 +554,5 @@ void KGVPart::slotOpenFileCompleted()
     else        
     {
+        setOptions( DisplayOptions() );
         _docManager->goToPage( _currentPage );
         stateChanged( "documentState" );