From 1ccb71738b0edaba9055fc464138af80d3ea5140 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 13 Nov 2014 08:31:41 +0530 Subject: [PATCH] E-book viewer: Fix popup footnotes not working on windows I forgot that QUrl.toLocalFile() uses the forward slash as the path separator on windows. --- src/calibre/gui2/viewer/footnote.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/viewer/footnote.py b/src/calibre/gui2/viewer/footnote.py index d5aaf3d832..3fd33f8dda 100644 --- a/src/calibre/gui2/viewer/footnote.py +++ b/src/calibre/gui2/viewer/footnote.py @@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import, __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal ' -import json +import json, os from collections import defaultdict from PyQt5.Qt import ( @@ -123,10 +123,10 @@ class Footnotes(object): pass def get_footnote_data(self, a, qurl): - current_path = unicode(self.view.document.mainFrame().baseUrl().toLocalFile()) + current_path = os.path.abspath(unicode(self.view.document.mainFrame().baseUrl().toLocalFile())) if not current_path: return # Not viewing a local file - dest_path = self.spine_path(qurl.toLocalFile()) + dest_path = self.spine_path(os.path.abspath(unicode(qurl.toLocalFile()))) if dest_path is not None: if dest_path == current_path: # We deliberately ignore linked to anchors if the destination is