From 557805c8b2d7ec79729cd02b87f6aa636cb90a94 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 6 May 2014 18:31:08 +0200 Subject: [PATCH] Don't pass an empty QPrinter to QPrintDialog. This was garbage collected on Linux when the dialog was opened, leading to segfaults when the printer was changed in the dialog. But actually we don't need it at all, so we just drop it. --- TODO | 3 --- qutebrowser/browser/curcommand.py | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index d1e9468c7..628be2306 100644 --- a/TODO +++ b/TODO @@ -11,9 +11,6 @@ Before 0.1 Crashes ======= -- Chosing printer in :print gives us a segfault on Linux, but :printpreview - works... - - When following a hint: QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once. diff --git a/qutebrowser/browser/curcommand.py b/qutebrowser/browser/curcommand.py index 0afdb216d..72a0e24d3 100644 --- a/qutebrowser/browser/curcommand.py +++ b/qutebrowser/browser/curcommand.py @@ -26,7 +26,7 @@ from functools import partial from PyQt5.QtWidgets import QApplication from PyQt5.QtCore import pyqtSlot, Qt, QObject, QProcess from PyQt5.QtGui import QClipboard -from PyQt5.QtPrintSupport import QPrinter, QPrintDialog, QPrintPreviewDialog +from PyQt5.QtPrintSupport import QPrintDialog, QPrintPreviewDialog import qutebrowser.utils.url as urlutils import qutebrowser.utils.message as message @@ -180,8 +180,7 @@ class CurCommandDispatcher(QObject): # If this isn't fixed in Qt 5.3, bug should be reopened. tab = self._tabs.cntwidget(count) if tab is not None: - printer = QPrinter() - printdiag = QPrintDialog(printer, tab) + printdiag = QPrintDialog(tab) printdiag.open(lambda: tab.print(printdiag.printer())) @cmdutils.register(instance='mainwindow.tabs.cur')