diff --git a/CMakeLists.txt b/CMakeLists.txt index ad63c99d4..a341b5832 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,9 +17,9 @@ if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION) set(PLASMA_NO_GLOBAL_SHORTCUTS TRUE) endif(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION) -if(NOT Q_WS_X11) +if(NOT X11_FOUND) set(PLASMA_NO_PACKAGEKIT TRUE) -endif(NOT Q_WS_X11) +endif(NOT X11_FOUND) #find_package(KdepimLibs 4.5.60) #find_package(Gpgme) diff --git a/dialog.cpp b/dialog.cpp index 4a76425ca..8c39631db 100644 --- a/dialog.cpp +++ b/dialog.cpp @@ -27,9 +27,6 @@ #include #include #include -#ifdef Q_WS_X11 -#include -#endif #include #include #include @@ -55,10 +52,6 @@ #include "plasma/widgets/scrollwidget.h" #include "plasma/private/windowshadows_p.h" -#ifdef Q_WS_X11 -#include -#endif - namespace Plasma { diff --git a/paintutils.cpp b/paintutils.cpp index 2a0cc31d8..127193ca6 100644 --- a/paintutils.cpp +++ b/paintutils.cpp @@ -255,7 +255,7 @@ QPixmap transition(const QPixmap &from, const QPixmap &to, qreal amount) return startPixmap; } #warning Cannot use XRender with QPixmap anymore. Find equivalent with Qt API. -#if 0 // defined(Q_WS_X11) && defined(HAVE_XRENDER) +#if 0 // defined(HAVE_X11) && defined(HAVE_XRENDER) // We have Xrender support else if (paintEngine && paintEngine->hasFeature(QPaintEngine::PorterDuff)) { // QX11PaintEngine doesn't implement CompositionMode_Plus in Qt 4.3, diff --git a/popupapplet.cpp b/popupapplet.cpp index 976393b79..7e1435823 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -28,10 +28,6 @@ #include #include -#ifdef Q_WS_X11 -#include -#endif - #include #include #include diff --git a/private/effectwatcher.cpp b/private/effectwatcher.cpp index 30da58687..361cb8e95 100644 --- a/private/effectwatcher.cpp +++ b/private/effectwatcher.cpp @@ -22,7 +22,8 @@ #include #include -#ifdef Q_WS_X11 +#include +#if 0 // Port to Qt5 native filters #include #include #endif @@ -36,7 +37,8 @@ EffectWatcher::EffectWatcher(QString property, QWidget *parent) m_property(property) { m_effectActive = isEffectActive(); -#ifdef Q_WS_X11 +#pragma message("Port to Qt5 native filter") +#if 0 kapp->installX11EventFilter( this ); Display *dpy = QX11Info::display(); Window root = DefaultRootWindow(dpy); @@ -49,7 +51,8 @@ EffectWatcher::EffectWatcher(QString property, QWidget *parent) } -#ifdef Q_WS_X11 +#pragma message("Port to Qt5 native filter") +#if 0 bool EffectWatcher::x11Event(XEvent *event) { if (event->type == PropertyNotify) { @@ -69,7 +72,8 @@ bool EffectWatcher::x11Event(XEvent *event) bool EffectWatcher::isEffectActive() const { -#ifdef Q_WS_X11 +#pragma message("Port to Qt5 native filter") +#if 0 Display *dpy = QX11Info::display(); Atom testAtom = XInternAtom(dpy, m_property.toLatin1(), False); diff --git a/private/effectwatcher_p.h b/private/effectwatcher_p.h index 4b108fa9c..6ef3e8850 100644 --- a/private/effectwatcher_p.h +++ b/private/effectwatcher_p.h @@ -34,7 +34,8 @@ public: protected: bool isEffectActive() const; -#ifdef Q_WS_X11 +#pragma message("Port to Qt5 native filter") +#if 0 bool x11Event(XEvent *event); #endif diff --git a/private/tooltip.cpp b/private/tooltip.cpp index fe4e7183e..d5ced78c3 100644 --- a/private/tooltip.cpp +++ b/private/tooltip.cpp @@ -31,10 +31,6 @@ #include #include #include -#ifdef Q_WS_X11 -#include -#include -#endif #include #include diff --git a/private/windowpreview.cpp b/private/windowpreview.cpp index 3471f537f..118af3df5 100644 --- a/private/windowpreview.cpp +++ b/private/windowpreview.cpp @@ -30,13 +30,6 @@ #include -#ifdef Q_WS_X11 -#include - -#include -#include -#endif - namespace Plasma { WindowPreview::WindowPreview(QWidget *parent) diff --git a/private/windowshadows.cpp b/private/windowshadows.cpp index 99d8e8cbe..911f6bcd6 100644 --- a/private/windowshadows.cpp +++ b/private/windowshadows.cpp @@ -21,7 +21,7 @@ #include #include -#ifdef Q_WS_X11 +#ifdef HAVE_X11 #include #include #include @@ -125,7 +125,7 @@ void WindowShadows::Private::updateShadows() void WindowShadows::Private::initPixmap(const QString &element) { -#ifdef Q_WS_X11 +#ifdef HAVE_X11 QPixmap pix = q->pixmap(element); if (pix.handle() == 0) { Pixmap xPix = XCreatePixmap(QX11Info::display(), QX11Info::appRootWindow(), pix.width(), pix.height(), 32); @@ -153,7 +153,7 @@ void WindowShadows::Private::setupPixmaps() initPixmap("shadow-left"); initPixmap("shadow-topleft"); -#ifdef Q_WS_X11 +#ifdef HAVE_X11 foreach (const QPixmap &pixmap, m_shadowPixmaps) { m_data << pixmap.handle(); } @@ -190,7 +190,7 @@ void WindowShadows::Private::setupPixmaps() void WindowShadows::Private::clearPixmaps() { -#ifdef Q_WS_X11 +#ifdef HAVE_X11 if (m_managePixmaps) { foreach (const QPixmap &pixmap, m_shadowPixmaps) { XFreePixmap(QX11Info::display(), pixmap.handle()); @@ -204,7 +204,7 @@ void WindowShadows::Private::clearPixmaps() void WindowShadows::Private::updateShadow(const QWidget *window) { -#ifdef Q_WS_X11 +#ifdef HAVE_X11 if (m_data.isEmpty()) { setupPixmaps(); } @@ -220,7 +220,7 @@ void WindowShadows::Private::updateShadow(const QWidget *window) void WindowShadows::Private::clearShadow(const QWidget *window) { -#ifdef Q_WS_X11 +#ifdef HAVE_X11 Display *dpy = QX11Info::display(); Atom atom = XInternAtom(dpy, "_KDE_NET_WM_SHADOW", False); XDeleteProperty(dpy, window->winId(), atom); diff --git a/theme.cpp b/theme.cpp index 92eec2910..ae2d18e9e 100644 --- a/theme.cpp +++ b/theme.cpp @@ -26,7 +26,7 @@ #include #include #include -#ifdef Q_WS_X11 +#ifdef HAVE_X11 #include #include "private/effectwatcher_p.h" #endif @@ -110,7 +110,7 @@ public: if (QPixmap::defaultDepth() > 8) { QObject::connect(KWindowSystem::self(), SIGNAL(compositingChanged(bool)), q, SLOT(compositingChanged(bool))); -#ifdef Q_WS_X11 +#ifdef HAVE_X11 //watch for blur effect property changes as well if (!s_blurEffectWatcher) { s_blurEffectWatcher = new EffectWatcher("_KDE_NET_WM_BLUR_BEHIND_REGION"); @@ -167,7 +167,7 @@ public: static const char *defaultTheme; static const char *systemColorsTheme; static const char *themeRcFile; -#ifdef Q_WS_X11 +#ifdef HAVE_X11 static EffectWatcher *s_blurEffectWatcher; #endif @@ -212,7 +212,7 @@ const char *ThemePrivate::themeRcFile = "plasmarc"; // the system colors theme is used to cache unthemed svgs with colorization needs // these svgs do not follow the theme's colors, but rather the system colors const char *ThemePrivate::systemColorsTheme = "internal-system-colors"; -#ifdef Q_WS_X11 +#ifdef HAVE_X11 EffectWatcher *ThemePrivate::s_blurEffectWatcher = 0; #endif @@ -279,7 +279,7 @@ QString ThemePrivate::findInTheme(const QString &image, const QString &theme, bo void ThemePrivate::compositingChanged(bool active) { -#ifdef Q_WS_X11 +#ifdef HAVE_X11 if (compositingActive != active) { compositingActive = active; //kDebug() << QTime::currentTime(); diff --git a/tooltipmanager.cpp b/tooltipmanager.cpp index f6acf5c56..9f16d923b 100644 --- a/tooltipmanager.cpp +++ b/tooltipmanager.cpp @@ -32,13 +32,6 @@ //KDE #include -//X11 -#ifdef Q_WS_X11 -#include -#include -#include -#endif - //Plasma #include "plasma/applet.h" #include "plasma/containment.h" diff --git a/widgets/checkbox.cpp b/widgets/checkbox.cpp index e26d5fb66..c89cbb5e1 100644 --- a/widgets/checkbox.cpp +++ b/widgets/checkbox.cpp @@ -121,7 +121,7 @@ void CheckBox::setImage(const QString &path) d->imagePath = path; bool absolutePath = !path.isEmpty() && - #ifdef Q_WS_WIN + #ifdef Q_OS_WIN !QDir::isRelativePath(path) #else (path[0] == '/' || path.startsWith(QLatin1String(":/"))) diff --git a/widgets/frame.cpp b/widgets/frame.cpp index bd82ea192..8c6794370 100644 --- a/widgets/frame.cpp +++ b/widgets/frame.cpp @@ -162,7 +162,7 @@ void Frame::setImage(const QString &path) d->pixmap = 0; bool absolutePath = !path.isEmpty() && - #ifdef Q_WS_WIN + #ifdef Q_OS_WIN !QDir::isRelativePath(path) #else (path[0] == '/' || path.startsWith(QLatin1String(":/"))) diff --git a/widgets/label.cpp b/widgets/label.cpp index e62f9b1e0..3f3d33497 100644 --- a/widgets/label.cpp +++ b/widgets/label.cpp @@ -138,7 +138,7 @@ void Label::setImage(const QString &path) d->imagePath = path; bool absolutePath = !path.isEmpty() && - #ifdef Q_WS_WIN + #ifdef Q_OS_WIN !QDir::isRelativePath(path) #else (path[0] == '/' || path.startsWith(QLatin1String(":/"))) diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 5004f1895..411636ecf 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -243,7 +243,7 @@ void PushButton::setImage(const QString &path) d->imagePath = path; bool absolutePath = !path.isEmpty() && - #ifdef Q_WS_WIN + #ifdef Q_OS_WIN !QDir::isRelativePath(path) #else (path[0] == '/' || path.startsWith(QLatin1String(":/"))) diff --git a/widgets/radiobutton.cpp b/widgets/radiobutton.cpp index 4e0d13105..f9c9faa54 100644 --- a/widgets/radiobutton.cpp +++ b/widgets/radiobutton.cpp @@ -110,7 +110,7 @@ void RadioButton::setImage(const QString &path) d->imagePath = path; bool absolutePath = !path.isEmpty() && - #ifdef Q_WS_WIN + #ifdef Q_OS_WIN !QDir::isRelativePath(path) #else (path[0] == '/' || path.startsWith(QLatin1String(":/"))) diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index b4c315730..fe007c3e8 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -240,7 +240,7 @@ void ToolButton::setImage(const QString &path) d->imagePath = path; bool absolutePath = !path.isEmpty() && - #ifdef Q_WS_WIN + #ifdef Q_OS_WIN !QDir::isRelativePath(path) #else (path[0] == '/' || path.startsWith(QLatin1String(":/"))) diff --git a/widgets/widget.cpp.template b/widgets/widget.cpp.template index 3629fa582..b11094910 100644 --- a/widgets/widget.cpp.template +++ b/widgets/widget.cpp.template @@ -119,7 +119,7 @@ void ::setImage(const QString &path) d->imagePath = path; bool absolutePath = !path.isEmpty() && - #ifdef Q_WS_WIN + #ifdef Q_OS_WIN !QDir::isRelativePath(path) #else (path[0] == '/' || path.startsWith(":/"))