Explicitly disable plugins when rendering HTML for covers. According to the Qt docs they should be disabled by default, but https://bugs.launchpad.net/bugs/1270297 implies they are not.

This commit is contained in:
Kovid Goyal 2014-01-20 22:48:42 +05:30
parent 83ac6bd846
commit 31a94acf5b

View File

@ -138,6 +138,8 @@ def render_html(path_to_html, width=590, height=750, as_xhtml=True):
path_to_html = os.path.abspath(path_to_html)
with CurrentDir(os.path.dirname(path_to_html)):
page = QWebPage()
settings = page.settings()
settings.setAttribute(settings.PluginsEnabled, False)
pal = page.palette()
pal.setBrush(QPalette.Background, Qt.white)
page.setPalette(pal)