Fix #3501 (No longer opening PDF files)

This commit is contained in:
Kovid Goyal 2009-09-15 19:18:28 -06:00
parent 3a43ab6992
commit 5d20546302
2 changed files with 11 additions and 1 deletions

View File

@ -338,6 +338,7 @@ from calibre.ebooks.rb.input import RBInput
from calibre.web.feeds.input import RecipeInput
from calibre.ebooks.rtf.input import RTFInput
from calibre.ebooks.txt.input import TXTInput
from calibre.ebooks.lrf.input import LRFInput
from calibre.ebooks.epub.output import EPUBOutput
from calibre.ebooks.fb2.output import FB2Output
@ -385,6 +386,7 @@ plugins += [
RecipeInput,
RTFInput,
TXTInput,
LRFInput,
]
plugins += [
EPUBOutput,

View File

@ -15,7 +15,7 @@ from PyQt4.Qt import Qt, SIGNAL, QObject, QCoreApplication, QUrl, QTimer, \
from PyQt4.QtSvg import QSvgRenderer
from calibre import prints, patheq
from calibre.constants import __version__, __appname__, \
from calibre.constants import __version__, __appname__, isfrozen, islinux, \
iswindows, isosx, filesystem_encoding
from calibre.utils.filenames import ascii_filename
from calibre.ptempfile import PersistentTemporaryFile
@ -1290,7 +1290,15 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
self.job_manager.launch_gui_app(viewer,
kwargs=dict(args=args))
else:
paths = os.environ.get('LD_LIBRARY_PATH',
'').split(os.pathsep)
paths = [x for x in paths if x]
if isfrozen and islinux and paths:
npaths = [x for x in paths if x != sys.frozen_path]
os.environ['LD_LIBRARY_PATH'] = os.pathsep.join(npaths)
QDesktopServices.openUrl(QUrl.fromLocalFile(name))#launch(name)
if isfrozen and islinux and paths:
os.environ['LD_LIBRARY_PATH'] = os.pathsep.join(paths)
time.sleep(2) # User feedback
finally:
self.unsetCursor()