Bug 52389 - Wrong file name in Document Information when viewing PDFs
Summary: Wrong file name in Document Information when viewing PDFs
Status: RESOLVED FIXED
Alias: None
Product: kghostview
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Wilco Greven
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-29 18:45 UTC by Hans Petter Bieker
Modified: 2003-04-05 17:53 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 Hans Petter Bieker 2002-12-29 18:45:42 UTC
Version:           0.13.2 (using KDE 3.1.9)
Compiler:          gcc version 3.2
OS:          Linux (i686) release 2.4.18-4GB

Open a PDF file with KGhostview. Select File->Document Information. Then, "File Name:" will show the temporary name of the Post Script file created, and not the name of the PDF file.
Comment 1 Luís Pedro Coelho 2003-04-05 17:53:42 UTC
Subject: kdegraphics/kghostview

CVS commit by luis_pedro: 

Gets rid of bug 52389 (file name was shown as /tmp/kde-*/.... instead of useful name).

Wilco: this is your code, but the change looks simple enough, so I just commited to HEAD. Feel free to disagree.

CCMAIL: 52389-close@bugs.kde.org, greven@kde.org


  M +1 -1      kgv_miniwidget.cpp   1.163
  M +6 -0      kgvdocument.cpp   1.5
  M +1 -0      kgvdocument.h   1.3


--- kdegraphics/kghostview/kgv_miniwidget.cpp  #1.162:1.163
@@ -138,5 +138,5 @@ void KGVMiniWidget::info()
 
     _infoDialog = new InfoDialog( _part->widget(), "info", true );
-    _infoDialog->setup( document()->fileName(),
+    _infoDialog->setup( document()->userFileName(),
                         dsc()->dsc_title(), dsc()->dsc_date() );
     _infoDialog->exec();

--- kdegraphics/kghostview/kgvdocument.cpp  #1.4:1.5
@@ -163,4 +163,10 @@ void KGVDocument::doOpenFile()
 }
 
+const QString& KGVDocument::userFileName() const
+{
+    if ( _pdfFileName.isNull() || _format == PS) return _fileName;
+    return _pdfFileName;
+}
+
 void KGVDocument::uncompressFile()
 {

--- kdegraphics/kghostview/kgvdocument.h  #1.2:1.3
@@ -61,4 +61,5 @@ public:
 
     const QString& fileName() const { return _fileName; }
+    const QString& userFileName() const;
     FILE* psFile() { return _psFile; }