Ticket #3597: 0001-Fix-for-displaying-filename-in-untitled-PDFs-SL-3597.patch

File 0001-Fix-for-displaying-filename-in-untitled-PDFs-SL-3597.patch, 1.6 KB (added by manuq, 12 years ago)

Fix for PDF files without title

  • pdfviewer.py

    From 34481157443e97171e02a225a2f99543ea3b53b3 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Mon, 21 May 2012 12:37:27 -0300
    Subject: [PATCH 1/2] Fix for displaying filename in untitled PDFs SL #3597
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    This patch moves the line that sets the title to the
    filename of the PDF, so we display "Loading..." until we
    know the title, and if title is None, we show the filename.
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     pdfviewer.py |    4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/pdfviewer.py b/pdfviewer.py
    index ef6a6ea..cf435d6 100644
    a b class PDFTabPage(Gtk.HBox): 
    289289        # The title may be given from the Journal:
    290290        if title is not None:
    291291            self._browser.props.title = title
    292         else:
    293             self._browser.props.title = os.path.basename(requested_uri)
    294292
    295293        self._browser.props.uri = requested_uri
    296294        self._browser.props.load_status = WebKit.LoadStatus.PROVISIONAL
    class PDFTabPage(Gtk.HBox): 
    335333        pdf_title = self._evince_viewer.get_pdf_title()
    336334        if pdf_title is not None:
    337335            self._browser.props.title = pdf_title
     336        else:
     337            self._browser.props.title = os.path.basename(self._requested_uri)
    338338
    339339    def _get_path_from_journal(self, journal_uri):
    340340        """Get the system tree URI of the file for the Journal object."""