From 41f2ca9864824bd9ec9aa6f5828fd2ef9cbf7690 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Fri, 20 May 2022 07:44:00 +0800 Subject: [PATCH] clean code: remove outdated code xorg xrecord detection logic --- broken_xrecord.cc | 34 ---------------------------------- broken_xrecord.hh | 13 ------------- goldendict.pro | 2 -- preferences.cc | 4 ---- preferences.ui | 20 -------------------- 5 files changed, 73 deletions(-) delete mode 100644 broken_xrecord.cc delete mode 100644 broken_xrecord.hh diff --git a/broken_xrecord.cc b/broken_xrecord.cc deleted file mode 100644 index bf95eca4..00000000 --- a/broken_xrecord.cc +++ /dev/null @@ -1,34 +0,0 @@ -/* This file is (c) 2008-2012 Konstantin Isakov - * Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */ - -#include "broken_xrecord.hh" - -#include - -#ifdef HAVE_X11 -#include -#include -#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include -#else -#include -#endif -#endif - -bool isRECORDBroken() -{ -#ifdef HAVE_X11 - - char const * vendor = ServerVendor( QX11Info::display() ); - - if ( vendor && strstr( vendor, "X.Org" ) ) - { - int release = VendorRelease( QX11Info::display() ); - - return release >= 10600000 && release < 10701000; - } - -#endif - - return false; -} diff --git a/broken_xrecord.hh b/broken_xrecord.hh deleted file mode 100644 index 976e1033..00000000 --- a/broken_xrecord.hh +++ /dev/null @@ -1,13 +0,0 @@ -/* This file is (c) 2008-2012 Konstantin Isakov - * Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */ - -#ifndef __BROKEN_XRECORD_HH_INCLUDED__ -#define __BROKEN_XRECORD_HH_INCLUDED__ - -/// Returns true if the RECORD extension is likely to be broken. Under Windows -/// it always returns false. -/// This function is to be removed once the RECORD extension is working again -/// on all the major distributions. -bool isRECORDBroken(); - -#endif diff --git a/goldendict.pro b/goldendict.pro index 02d69efe..98d7c7b8 100644 --- a/goldendict.pro +++ b/goldendict.pro @@ -295,7 +295,6 @@ HEADERS += folding.hh \ orderandprops.hh \ language.hh \ dictionarybar.hh \ - broken_xrecord.hh \ history.hh \ atomic_rename.hh \ articlewebview.hh \ @@ -429,7 +428,6 @@ SOURCES += folding.cc \ orderandprops.cc \ language.cc \ dictionarybar.cc \ - broken_xrecord.cc \ history.cc \ atomic_rename.cc \ articlewebview.cc \ diff --git a/preferences.cc b/preferences.cc index 357e652a..6bafa8b7 100644 --- a/preferences.cc +++ b/preferences.cc @@ -3,7 +3,6 @@ #include "language.hh" #include "langcoder.hh" #include -#include "broken_xrecord.hh" #include "mainwindow.hh" #include #include @@ -297,9 +296,6 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ): ui.audioPlaybackProgram->setText( p.audioPlaybackProgram ); - if ( !isRECORDBroken() ) - ui.brokenXRECORD->hide(); - // Proxy server ui.useProxyServer->setChecked( p.proxyServer.enabled ); diff --git a/preferences.ui b/preferences.ui index 45da2155..8ce260f2 100644 --- a/preferences.ui +++ b/preferences.ui @@ -844,26 +844,6 @@ seconds, which is specified here. - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#ff0000;">Note: You appear to be running an X.Org XServer release which has the RECORD extension broken. Hotkeys in GoldenDict will probably not work. This must be fixed in the server itself. Please refer to the following </span><a href="https://bugs.freedesktop.org/show_bug.cgi?id=20500"><span style=" text-decoration: underline; color:#0000ff;">bug entry</span></a><span style=" color:#ff0000;"> and leave a comment there if you like.</span></p></body></html> - - - Qt::RichText - - - true - - - true - - -