Replace Q_WS_X11 -> HAVE_X11

This commit is contained in:
Timon Wong 2013-05-31 13:28:36 +08:00
parent d057752c74
commit 8015841a1a
10 changed files with 22 additions and 21 deletions

View file

@ -5,7 +5,7 @@
#include <QtGui>
#ifdef Q_WS_X11
#ifdef HAVE_X11
#include <X11/Xlib.h>
#include <X11/extensions/record.h>
#include <QX11Info>
@ -13,7 +13,7 @@
bool isRECORDBroken()
{
#ifdef Q_WS_X11
#ifdef HAVE_X11
char const * vendor = ServerVendor( QX11Info::display() );

View file

@ -82,6 +82,7 @@ win32 {
}
unix:!mac {
DEFINES += HAVE_X11
# This is to keep symbols for backtraces
QMAKE_CXXFLAGS += -rdynamic
QMAKE_LFLAGS += -rdynamic

View file

@ -10,7 +10,7 @@
#include "dprintf.hh"
#ifdef Q_WS_X11
#ifdef HAVE_X11
#include <X11/Xlibint.h>
#endif
@ -97,7 +97,7 @@ void HotkeyWrapper::waitKey2()
{
state2 = false;
#ifdef Q_WS_X11
#ifdef HAVE_X11
if ( keyToUngrab != grabbedKeys.end() )
{
@ -185,7 +185,7 @@ bool HotkeyWrapper::checkState(quint32 vk, quint32 mod)
state2waiter = hs;
QTimer::singleShot(500, this, SLOT(waitKey2()));
#ifdef Q_WS_X11
#ifdef HAVE_X11
// Grab the second key, unless it's grabbed already
// Note that we only grab the clipboard key only if

View file

@ -3,7 +3,7 @@
#include <QtGui>
#ifdef Q_WS_X11
#ifdef HAVE_X11
#include <set>

View file

@ -6,7 +6,7 @@
#ifdef Q_OS_WIN32
#include <windows.h>
#elif defined(Q_WS_X11)
#elif defined(HAVE_X11)
#include <QX11Info>
#include <X11/X.h>
#include <X11/XKBlib.h>
@ -19,7 +19,7 @@ bool KeyboardState::checkModifiersPressed( int mask )
{
#if defined(Q_WS_QWS)
return false;
#elif defined Q_OS_WIN32
#elif defined(Q_OS_WIN32)
return !(
( mask & Alt && !( GetAsyncKeyState( VK_MENU ) & 0x8000 ) ) ||

View file

@ -47,7 +47,7 @@
#include "wstring_qt.hh"
#endif
#ifdef Q_WS_X11
#ifdef HAVE_X11
#include <QX11Info>
#include <X11/Xlib.h>
#endif
@ -2395,7 +2395,7 @@ void MainWindow::showTranslationFor( QString const & inWord,
//ui.tabWidget->setTabText( ui.tabWidget->indexOf(ui.tab), inWord.trimmed() );
}
#ifdef Q_WS_X11
#ifdef HAVE_X11
void MainWindow::toggleMainWindow( bool onlyShow, bool byIconClick )
#else
void MainWindow::toggleMainWindow( bool onlyShow )
@ -2441,7 +2441,7 @@ void MainWindow::toggleMainWindow( bool onlyShow )
if ( shown )
{
focusTranslateLine();
#ifdef Q_WS_X11
#ifdef HAVE_X11
Window wh = 0;
int rev = 0;
XGetInputFocus( QX11Info::display(), &wh, &rev );
@ -2554,7 +2554,7 @@ void MainWindow::checkForNewRelease()
QNetworkRequest req(
QUrl( "http://goldendict.org/latest_release.php?current="
PROGRAM_VERSION "&platform="
#ifdef Q_WS_X11
#ifdef HAVE_X11
"x11"
#endif
#ifdef Q_OS_MAC
@ -2649,7 +2649,7 @@ void MainWindow::trayIconActivated( QSystemTrayIcon::ActivationReason r )
switch(r) {
case QSystemTrayIcon::Trigger:
// Left click toggles the visibility of main window
#ifdef Q_WS_X11
#ifdef HAVE_X11
toggleMainWindow( false, true );
#else
toggleMainWindow();

View file

@ -28,7 +28,7 @@
#include "translatebox.hh"
#include "wordlist.hh"
#ifdef Q_WS_X11
#ifdef HAVE_X11
#include <fixx11h.h>
#endif
@ -195,7 +195,7 @@ private:
/// Brings the main window to front if it's not currently, or hides it
/// otherwise. The hiding part is omitted if onlyShow is true.
#ifdef Q_WS_X11
#ifdef HAVE_X11
void toggleMainWindow( bool onlyShow = false, bool byIconClick = false );
#else
void toggleMainWindow( bool onlyShow = false );

View file

@ -184,7 +184,7 @@ QtSingleApplication::QtSingleApplication(int &argc, char **argv, Type type)
}
# if defined(Q_WS_X11)
# if defined(HAVE_X11)
/*!
Special constructor for X11, ref. the documentation of
QApplication's corresponding constructor. The application identifier
@ -222,7 +222,7 @@ QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, int
{
sysInit(appId);
}
# endif // Q_WS_X11
# endif // HAVE_X11
#endif // QT_VERSION < 0x050000

View file

@ -70,11 +70,11 @@ public:
QtSingleApplication(const QString &id, int &argc, char **argv);
#if QT_VERSION < 0x050000
QtSingleApplication(int &argc, char **argv, Type type);
# if defined(Q_WS_X11)
# if defined(HAVE_X11)
QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0);
QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
# endif // Q_WS_X11
# endif // HAVE_X11
#endif // QT_VERSION < 0x050000
bool isRunning();

View file

@ -207,7 +207,7 @@ ScanPopup::ScanPopup( QWidget * parent,
connect( definition, SIGNAL( statusBarMessage( QString const &, int, QPixmap const & ) ),
this, SLOT( showStatusBarMessage( QString const &, int, QPixmap const & ) ) );
#ifdef Q_WS_X11
#ifdef HAVE_X11
connect( QApplication::clipboard(), SIGNAL( changed( QClipboard::Mode ) ),
this, SLOT( clipboardChanged( QClipboard::Mode ) ) );
#endif
@ -765,7 +765,7 @@ void ScanPopup::requestWindowFocus()
// One of the rare, actually working workarounds for requesting a user keyboard focus on X11,
// works for Qt::Popup windows, exactly like our Scan Popup (in unpinned state).
// Modern window managers actively resist to automatically focus pop-up windows.
#ifdef Q_WS_X11
#ifdef HAVE_X11
if ( !ui.pinButton->isChecked() )
{
QMenu m( this );