From 8aff446a303e04947dc99dada3d9d244983855fe Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 2 Jun 2014 23:07:46 +0200 Subject: [PATCH] Refine dead actute meta-warning --- qutebrowser/utils/misc.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/qutebrowser/utils/misc.py b/qutebrowser/utils/misc.py index 4e715435a..18596668b 100644 --- a/qutebrowser/utils/misc.py +++ b/qutebrowser/utils/misc.py @@ -30,8 +30,9 @@ import os.path import urllib.request from urllib.parse import urljoin, urlencode from functools import reduce +from distutils.version import StrictVersion as Version -from PyQt5.QtCore import QCoreApplication, QStandardPaths +from PyQt5.QtCore import QCoreApplication, QStandardPaths, qVersion from pkg_resources import resource_string import qutebrowser @@ -237,9 +238,18 @@ def get_standard_dir(typ): def actute_warning(): """Display a warning about the dead_actute issue if needed.""" - if not (sys.platform.startswith('linux') and - os.path.exists('/usr/share/X11/locale/en_US.UTF-8/Compose')): + # Non linux OS' aren't affected + if not sys.platform.startswith('linux'): return + # If no compose file exists for some reason, we're not affected + if not os.path.exists('/usr/share/X11/locale/en_US.UTF-8/Compose'): + return + # Qt >= 5.3 doesn't seem to be affected + try: + if Version(qVersion()) >= Version('5.3.0'): + return + except ValueError: + pass with open('/usr/share/X11/locale/en_US.UTF-8/Compose', 'r') as f: for line in f: if '' in line: