[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/utils/yakuake
From:       Eike Hein <hein () kde ! org>
Date:       2010-08-07 10:41:15
Message-ID: 20100807104115.0F542AC7CA () svn ! kde ! org
[Download RAW message or body]

SVN commit 1160185 by hein:

Make Yakuake depend on KDE 4.3 and drop all of the compat code
for older version.


 M  +4 -1      CMakeLists.txt  
 M  +1 -0      ChangeLog  
 M  +1 -1      README  
 M  +0 -6      app/CMakeLists.txt  
 M  +0 -8      app/application.cpp  
 M  +0 -3      app/application.h  
 M  +0 -8      app/config/skinlistdelegate.cpp  
 M  +0 -2      app/firstrundialog.cpp  
 M  +0 -74     app/main.cpp  
 M  +1 -49     app/mainwindow.cpp  
 M  +0 -10     app/visualeventoverlay.cpp  


--- trunk/extragear/utils/yakuake/CMakeLists.txt #1160184:1160185
@@ -1,6 +1,9 @@
 project(yakuake)
 
-find_package(KDE4 REQUIRED)
+set(KDE_MIN_VERSION "4.3.0")
+
+find_package(KDE4 ${KDE_MIN_VERSION} REQUIRED)
+
 include(KDE4Defaults)
 
 add_subdirectory( app )
--- trunk/extragear/utils/yakuake/ChangeLog #1160184:1160185
@@ -2,6 +2,7 @@
 * Fixed a bug causing the "Keep above other windows" preference not to be
   respected immediately when toggling the "Keep window open when it loses
   focus" preference from the title bar or the main menu.
+* Yakuake now depends on KDE 4.3.
 
 
 Changes in 2.9.7:
--- trunk/extragear/utils/yakuake/README #1160184:1160185
@@ -12,7 +12,7 @@
 Report bugs and wishes at: http://bugs.kde.org/
 
 
-Yakuake requires kdelibs and Konsole from KDE 4.0 or higher.
+Yakuake requires kdelibs and Konsole from KDE 4.3 or higher.
 
 
 Basic build and installtion instructions:
--- trunk/extragear/utils/yakuake/app/CMakeLists.txt #1160184:1160185
@@ -35,12 +35,6 @@
 
 target_link_libraries(yakuake ${KDE4_KPARTS_LIBS})
 
-macro_ensure_version("4.2.68" ${KDE_VERSION} KDE_IS_43_OR_HIGHER)
-
-if(Q_WS_X11 AND !KDE_IS_43_OR_HIGHER)
-  target_link_libraries(yakuake ${X11_Xrender_LIB} ${X11_X11_LIB})
-endif(Q_WS_X11 AND !KDE_IS_43_OR_HIGHER)
-
 install(TARGETS yakuake ${INSTALL_TARGETS_DEFAULT_ARGS})
 
 install(FILES yakuake.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
--- trunk/extragear/utils/yakuake/app/application.cpp #1160184:1160185
@@ -28,14 +28,6 @@
     m_mainWindow = 0;
 }
 
-#if defined(Q_WS_X11) && !KDE_IS_VERSION(4,2,68)
-Application::Application(Display* display, Qt::HANDLE visual, Qt::HANDLE colormap)
-    : KUniqueApplication(display, visual, colormap)
-{
-    m_mainWindow = 0;
-}
-#endif
-
 Application::~Application()
 {
 }
--- trunk/extragear/utils/yakuake/app/application.h #1160184:1160185
@@ -35,9 +35,6 @@
 
     public:
         explicit Application();
-#if defined(Q_WS_X11) && !KDE_IS_VERSION(4,2,68)
-        explicit Application(Display* display, Qt::HANDLE visual, Qt::HANDLE \
                colormap);
-#endif
         virtual ~Application();
 
         virtual int newInstance();
--- trunk/extragear/utils/yakuake/app/config/skinlistdelegate.cpp #1160184:1160185
@@ -56,17 +56,9 @@
 
 void SkinListDelegate::paintBackground(QPainter* painter, const \
QStyleOptionViewItem& option) const  {
-#if KDE_IS_VERSION(4, 0, 60)
     QStyleOptionViewItemV4 opt = option;
     QStyle* style = opt.widget ? opt.widget->style() : QApplication::style();
     style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget);
-#else
-    QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? \
                QPalette::Normal : QPalette::Disabled;
-    if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) cg = \
                QPalette::Inactive;
-
-    if (option.showDecorationSelected && (option.state & QStyle::State_Selected))
-        painter->fillRect(option.rect, option.palette.brush(cg, \
                QPalette::Highlight));
-#endif
 }
 
 void SkinListDelegate::paintIcon(QPainter* painter, const QStyleOptionViewItem& \
                option, const QModelIndex &index) const
--- trunk/extragear/utils/yakuake/app/firstrundialog.cpp #1160184:1160185
@@ -56,9 +56,7 @@
 
 void FirstRunDialog::initKeyButton()
 {
-#if KDE_IS_VERSION(4,2,0)
     m_ui->keyButton->setMultiKeyShortcutsAllowed(false);
-#endif
 
     m_ui->keyButton->blockSignals(true);
 
--- trunk/extragear/utils/yakuake/app/main.cpp #1160184:1160185
@@ -29,17 +29,7 @@
 
 #include <cstdio>
 
-#if defined(Q_WS_X11) && !KDE_IS_VERSION(4,2,68)
-#include <cstdlib>
 
-#include <X11/Xlib.h>
-#include <X11/extensions/Xrender.h>
-
-
-void getDisplayInformation(Display*& display, Visual*& visual, Colormap& colormap);
-#endif
-
-
 int main (int argc, char *argv[])
 {
     KAboutData aboutData("yakuake",
@@ -76,71 +66,7 @@
         return 0;
     }
 
-#if defined(Q_WS_X11) && !KDE_IS_VERSION(4,2,68)
-    if (KWindowSystem::compositingActive())
-    {
-            Display* display = 0;
-            Visual* visual = 0;
-            Colormap colormap = 0;
-
-            getDisplayInformation(display, visual, colormap);
-
-            Application app(display, (Qt::HANDLE)visual, (Qt::HANDLE)colormap);
-
-            return app.exec();
-    }
-    else
-#endif
-    {
         Application app;
 
         return app.exec();
     }
-}
-
-// Code from the Qt 4 graphics dojo examples at http://labs.trolltech.com
-#if defined(Q_WS_X11) && !KDE_IS_VERSION(4,2,68)
-void getDisplayInformation(Display*& display, Visual*& visual, Colormap& colormap)
-{
-    display = XOpenDisplay(0);
-
-    if (!display)
-    {
-        QTextStream err(stderr);
-
-        err << i18nc("@info:shell", "Cannot connect to X server.") << '\n';
-
-        exit(1);
-    }
-
-    int screen = DefaultScreen(display);
-    int eventBase, errorBase;
-
-    if (XRenderQueryExtension(display, &eventBase, &errorBase))
-    {
-        int nvi;
-        XVisualInfo templ;
-        templ.screen  = screen;
-        templ.depth = 32;
-        templ.c_class = TrueColor;
-        XVisualInfo *xvi = XGetVisualInfo(display, VisualScreenMask |
-                                          VisualDepthMask |
-                                          VisualClassMask, &templ, &nvi);
-
-        for (int i = 0; i < nvi; ++i)
-        {
-            XRenderPictFormat* format = XRenderFindVisualFormat(display, \
                xvi[i].visual);
-
-            if (format->type == PictTypeDirect && format->direct.alphaMask)
-            {
-                visual = xvi[i].visual;
-                colormap = XCreateColormap(display, RootWindow(display, screen),
-                                           visual, AllocNone);
-
-                // Found ARGB visual.
-                break;
-            }
-        }
-    }
-}
-#endif
--- trunk/extragear/utils/yakuake/app/mainwindow.cpp #1160184:1160185
@@ -53,22 +53,13 @@
 #include <QtDBus/QtDBus>
 #include <QTimer>
 
-#if defined(Q_WS_X11) && !KDE_IS_VERSION(4,2,68)
-#include <QX11Info>
 
-#include <X11/Xlib.h>
-#include <X11/extensions/Xrender.h>
-#endif
-
-
 MainWindow::MainWindow(QWidget* parent)
     : KMainWindow(parent, Qt::CustomizeWindowHint | Qt::FramelessWindowHint)
 {
     QDBusConnection::sessionBus().registerObject("/yakuake/window", this, \
QDBusConnection::ExportScriptableSlots);  
-#if KDE_IS_VERSION(4,2,68)
     setAttribute(Qt::WA_TranslucentBackground, true);
-#endif
 
     m_skin = new Skin();
     m_menu = new KMenu(this);
@@ -765,21 +756,12 @@
 
     if (useTranslucency())
     {
-#if defined(Q_WS_X11) && !KDE_IS_VERSION(4,2,68)
-        painter.setCompositionMode(QPainter::CompositionMode_Source);
-        painter.fillRect(rect(), Qt::transparent);
-#endif
         painter.setOpacity(qreal(Settings::backgroundColorOpacity()) / 100);
         painter.fillRect(rect(), Settings::backgroundColor());
         painter.setOpacity(1.0);
     }
     else
-    {
-#if defined(Q_WS_X11) && !KDE_IS_VERSION(4,2,68)
-        painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
-#endif
         painter.fillRect(rect(), Settings::backgroundColor());
-    }
 
     QRect leftBorder(0, 0, m_skin->borderWidth(), height() - m_titleBar->height());
     painter.fillRect(leftBorder, m_skin->borderColor());
@@ -1069,35 +1051,5 @@
 
 void MainWindow::updateUseTranslucency()
 {
-#if defined(Q_WS_X11) && !KDE_IS_VERSION(4,2,68)
-    bool ARGB = false;
-
-    int screen = QX11Info::appScreen();
-    bool depth = (QX11Info::appDepth() == 32);
-
-    Display* display = QX11Info::display();
-    Visual* visual = static_cast<Visual*>(QX11Info::appVisual(screen));
-
-    XRenderPictFormat* format = XRenderFindVisualFormat(display, visual);
-
-    if (depth && format->type == PictTypeDirect && format->direct.alphaMask)
-    {
-        ARGB = true;
+    m_useTranslucency = (Settings::translucency() && \
KWindowSystem::compositingActive());  }
-
-    if (ARGB && Settings::translucency())
-    {
-        m_useTranslucency = KWindowSystem::compositingActive();
-    }
-    else
-#elif KDE_IS_VERSION(4,2,68)
-    if (Settings::translucency())
-    {
-        m_useTranslucency = KWindowSystem::compositingActive();
-    }
-    else
-#endif
-    {
-        m_useTranslucency = false;
-    }
-}
--- trunk/extragear/utils/yakuake/app/visualeventoverlay.cpp #1160184:1160185
@@ -73,14 +73,8 @@
 
     setAutoFillBackground(false);
 
-#if QT_VERSION >= 0x040500
     setAttribute(Qt::WA_TranslucentBackground, true);
-#endif
 
-#if QT_VERSION < 0x040500
-    setAttribute(Qt::WA_NoSystemBackground, true);
-#endif
-
     setFocusPolicy(Qt::NoFocus);
     setAttribute(Qt::WA_TransparentForMouseEvents, true);
 
@@ -165,10 +159,6 @@
 
     QPainter painter(this);
 
-#if QT_VERSION < 0x040500
-    painter.fillRect(rect(), Qt::transparent);
-#endif
-
     m_time.start();
     bool painted = false;
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic