clean code: remove outdated code

xorg xrecord detection logic
This commit is contained in:
Xiao YiFang 2022-05-20 07:44:00 +08:00
parent b47004aba0
commit 41f2ca9864
5 changed files with 0 additions and 73 deletions

View file

@ -1,34 +0,0 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#include "broken_xrecord.hh"
#include <QtGui>
#ifdef HAVE_X11
#include <X11/Xlib.h>
#include <X11/extensions/record.h>
#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
#include <QtGui/private/qtx11extras_p.h>
#else
#include <QX11Info>
#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;
}

View file

@ -1,13 +0,0 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* 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

View file

@ -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 \

View file

@ -3,7 +3,6 @@
#include "language.hh"
#include "langcoder.hh"
#include <QMessageBox>
#include "broken_xrecord.hh"
#include "mainwindow.hh"
#include <QWebEngineSettings>
#include <QWebEngineProfile>
@ -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 );

View file

@ -844,26 +844,6 @@ seconds, which is specified here.</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="brokenXRECORD">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;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 &lt;/span&gt;&lt;a href=&quot;https://bugs.freedesktop.org/show_bug.cgi?id=20500&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;bug entry&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt; and leave a comment there if you like.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_12">
<property name="orientation">