From a11356bb992bbe3070594c33af082f967c1c90c5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 3 Apr 2017 08:32:39 +0200 Subject: [PATCH] Don't require working icon to start --- qutebrowser/app.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 3fe15ff46..6bea00f31 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -170,12 +170,15 @@ def _init_icon(): for size in [16, 24, 32, 48, 64, 96, 128, 256, 512]: filename = ':/icons/qutebrowser-{}x{}.png'.format(size, size) pixmap = QPixmap(filename) - qtutils.ensure_not_null(pixmap) - fallback_icon.addPixmap(pixmap) - qtutils.ensure_not_null(fallback_icon) + if pixmap.isNull(): + log.init.warn("Failed to load {}".format(filename)) + else: + fallback_icon.addPixmap(pixmap) icon = QIcon.fromTheme('qutebrowser', fallback_icon) - qtutils.ensure_not_null(icon) - qApp.setWindowIcon(icon) + if icon.isNull(): + log.init.warn("Failed to load icon") + else: + qApp.setWindowIcon(icon) def _process_args(args):