More removals of Q_WS_* in favor of Q_OS_* or HAVE_X11

This commit is contained in:
Kevin Ottens 2012-08-03 11:38:59 +02:00
parent 54433eaca3
commit 22f74fc0ca
18 changed files with 31 additions and 55 deletions

View File

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

View File

@ -27,9 +27,6 @@
#include <QSvgRenderer>
#include <QResizeEvent>
#include <QMouseEvent>
#ifdef Q_WS_X11
#include <QX11Info>
#endif
#include <QBitmap>
#include <QTimer>
#include <QVBoxLayout>
@ -55,10 +52,6 @@
#include "plasma/widgets/scrollwidget.h"
#include "plasma/private/windowshadows_p.h"
#ifdef Q_WS_X11
#include <X11/Xlib.h>
#endif
namespace Plasma
{

View File

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

View File

@ -28,10 +28,6 @@
#include <QTimer>
#include <QVBoxLayout>
#ifdef Q_WS_X11
#include <QX11Info>
#endif
#include <kiconloader.h>
#include <kwindowsystem.h>
#include <kglobalsettings.h>

View File

@ -22,7 +22,8 @@
#include <kapplication.h>
#include <kdebug.h>
#ifdef Q_WS_X11
#include <config.h>
#if 0 // Port to Qt5 native filters
#include <X11/Xlib.h>
#include <QX11Info>
#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);

View File

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

View File

@ -31,10 +31,6 @@
#include <QTextDocument>
#include <QPropertyAnimation>
#include <QTextBlock>
#ifdef Q_WS_X11
#include <QX11Info>
#include <netwm.h>
#endif
#include <kdebug.h>
#include <kglobal.h>

View File

@ -30,13 +30,6 @@
#include <plasma/framesvg.h>
#ifdef Q_WS_X11
#include <QX11Info>
#include <X11/Xlib.h>
#include <fixx11h.h>
#endif
namespace Plasma {
WindowPreview::WindowPreview(QWidget *parent)

View File

@ -21,7 +21,7 @@
#include <QWidget>
#include <QPainter>
#ifdef Q_WS_X11
#ifdef HAVE_X11
#include <QX11Info>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
@ -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);

View File

@ -26,7 +26,7 @@
#include <QPair>
#include <QStringBuilder>
#include <QTimer>
#ifdef Q_WS_X11
#ifdef HAVE_X11
#include <QX11Info>
#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();

View File

@ -32,13 +32,6 @@
//KDE
#include <kwindowsystem.h>
//X11
#ifdef Q_WS_X11
#include <QX11Info>
#include <X11/Xlib.h>
#include <fixx11h.h>
#endif
//Plasma
#include "plasma/applet.h"
#include "plasma/containment.h"

View File

@ -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(":/")))

View File

@ -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(":/")))

View File

@ -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(":/")))

View File

@ -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(":/")))

View File

@ -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(":/")))

View File

@ -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(":/")))

View File

@ -119,7 +119,7 @@ void <Name>::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(":/"))