From 5c3a7afb361283769938471511c110bd6178ba11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <mgraesslin@kde.org>
Date: Mon, 31 Oct 2011 08:43:37 +0100
Subject: [PATCH] Drop obsoleted files of TabBox Configuration

Old ui file for layout configuration no longer required and
preview of old TabBox no longer required (and was not used at all).
---
 kcmkwin/kwintabbox/CMakeLists.txt         |   2 -
 kcmkwin/kwintabbox/layoutconfig.ui        |  57 -------
 kcmkwin/kwintabbox/previewhandlerimpl.cpp | 183 ----------------------
 kcmkwin/kwintabbox/previewhandlerimpl.h   |  77 ---------
 4 files changed, 319 deletions(-)
 delete mode 100644 kcmkwin/kwintabbox/layoutconfig.ui
 delete mode 100644 kcmkwin/kwintabbox/previewhandlerimpl.cpp
 delete mode 100644 kcmkwin/kwintabbox/previewhandlerimpl.h

diff --git a/kcmkwin/kwintabbox/CMakeLists.txt b/kcmkwin/kwintabbox/CMakeLists.txt
index e113d1db8d..0616945a6a 100644
--- a/kcmkwin/kwintabbox/CMakeLists.txt
+++ b/kcmkwin/kwintabbox/CMakeLists.txt
@@ -5,7 +5,6 @@ include_directories( ${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/tabbox )
 set(kcm_kwintabbox_PART_SRCS
     main.cpp
     layoutconfig.cpp
-    previewhandlerimpl.cpp
     ${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/tabbox/clientitemdelegate.cpp
     ${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/tabbox/clientmodel.cpp
     ${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/tabbox/declarative.cpp
@@ -17,7 +16,6 @@ set(kcm_kwintabbox_PART_SRCS
     ${KDEBASE_WORKSPACE_SOURCE_DIR}/kwin/tabbox/tabboxview.cpp )
 
 kde4_add_ui_files( kcm_kwintabbox_PART_SRCS main.ui )
-kde4_add_ui_files( kcm_kwintabbox_PART_SRCS layoutconfig.ui )
 
 kde4_add_plugin(kcm_kwintabbox ${kcm_kwintabbox_PART_SRCS})
 
diff --git a/kcmkwin/kwintabbox/layoutconfig.ui b/kcmkwin/kwintabbox/layoutconfig.ui
deleted file mode 100644
index 55f392f3cc..0000000000
--- a/kcmkwin/kwintabbox/layoutconfig.ui
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>LayoutConfigForm</class>
- <widget class="QWidget" name="LayoutConfigForm">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>680</width>
-    <height>432</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout" name="gridLayout_3">
-   <item row="0" column="0">
-    <widget class="QGroupBox" name="groupBox_2">
-     <property name="title">
-      <string>Item Layout</string>
-     </property>
-     <layout class="QFormLayout" name="formLayout">
-      <item row="1" column="0">
-       <widget class="QLabel" name="label_9">
-        <property name="text">
-         <string>Item layout:</string>
-        </property>
-        <property name="buddy">
-         <cstring>itemLayoutCombo</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <widget class="KComboBox" name="itemLayoutCombo">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
- </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KComboBox</class>
-   <extends>QComboBox</extends>
-   <header>kcombobox.h</header>
-  </customwidget>
- </customwidgets>
- <tabstops>
-  <tabstop>itemLayoutCombo</tabstop>
- </tabstops>
- <resources/>
- <connections/>
-</ui>
diff --git a/kcmkwin/kwintabbox/previewhandlerimpl.cpp b/kcmkwin/kwintabbox/previewhandlerimpl.cpp
deleted file mode 100644
index cbe2a38be8..0000000000
--- a/kcmkwin/kwintabbox/previewhandlerimpl.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/********************************************************************
- KWin - the KDE window manager
- This file is part of the KDE project.
-
-Copyright (C) 2009 Martin Gräßlin <kde@martin-graesslin.com>
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*********************************************************************/
-
-#include "previewhandlerimpl.h"
-#include <kephal/screens.h>
-#include <klocalizedstring.h>
-#include <kwindowsystem.h>
-#include <KDebug>
-
-namespace KWin
-{
-namespace TabBox
-{
-
-PreviewClientImpl::PreviewClientImpl(WId id)
-    : m_id(id)
-{
-}
-
-PreviewClientImpl::~PreviewClientImpl()
-{
-}
-
-QString PreviewClientImpl::caption() const
-{
-    KWindowInfo info = KWindowSystem::windowInfo(m_id, NET::WMVisibleName);
-    return info.visibleName();
-}
-
-QPixmap PreviewClientImpl::icon(const QSize& size) const
-{
-    return KWindowSystem::icon(m_id, size.width(), size.height(), true);
-}
-
-bool PreviewClientImpl::isMinimized() const
-{
-    KWindowInfo info = KWindowSystem::windowInfo(m_id, NET::WMState | NET::XAWMState);
-    return info.isMinimized();
-}
-
-int PreviewClientImpl::width() const
-{
-    return 0; // only needed for the outline - not needed in preview
-}
-
-int PreviewClientImpl::height() const
-{
-    return 0; // only needed for the outline - not needed in preview
-}
-
-WId PreviewClientImpl::window() const
-{
-    return m_id;
-}
-
-int PreviewClientImpl::x() const
-{
-    return 0; // only needed for the outline - not needed in preview
-}
-
-int PreviewClientImpl::y() const
-{
-    return 0; // only needed for the outline - not needed in preview
-}
-
-/*******************************************************
-* PreviewHandlerImpl
-*******************************************************/
-PreviewHandlerImpl::PreviewHandlerImpl()
-{
-    QList< WId > windows = KWindowSystem::stackingOrder();
-    foreach (WId w, windows) {
-        m_stackingOrder.append(new PreviewClientImpl(w));
-        kDebug(1212) << "Window " << w;
-    }
-}
-
-PreviewHandlerImpl::~PreviewHandlerImpl()
-{
-    qDeleteAll(m_stackingOrder.begin(), m_stackingOrder.end());
-    m_stackingOrder.clear();
-}
-
-TabBoxClient* PreviewHandlerImpl::clientToAddToList(TabBoxClient* client, int desktop, bool allDesktops) const
-{
-    Q_UNUSED(desktop)
-    Q_UNUSED(allDesktops)
-    // don't include desktops and panels
-    KWindowInfo info = KWindowSystem::windowInfo(client->window(), NET::WMWindowType);
-    NET::WindowType wType = info.windowType(NET::NormalMask | NET::DesktopMask | NET::DockMask |
-                                            NET::ToolbarMask | NET::MenuMask | NET::DialogMask |
-                                            NET::OverrideMask | NET::TopMenuMask |
-                                            NET::UtilityMask | NET::SplashMask);
-
-    if (wType != NET::Normal && wType != NET::Override && wType != NET::Unknown &&
-            wType != NET::Dialog && wType != NET::Utility) {
-        return NULL;
-    }
-    return client;
-}
-
-TabBoxClientList PreviewHandlerImpl::stackingOrder() const
-{
-    return m_stackingOrder;
-}
-
-int PreviewHandlerImpl::nextDesktopFocusChain(int desktop) const
-{
-    int ret = desktop + 1;
-    if (ret > numberOfDesktops())
-        ret = 1;
-    return ret;
-}
-
-int PreviewHandlerImpl::numberOfDesktops() const
-{
-    return KWindowSystem::numberOfDesktops();
-}
-
-int PreviewHandlerImpl::currentDesktop() const
-{
-    return KWindowSystem::currentDesktop();
-}
-
-QString PreviewHandlerImpl::desktopName(int desktop) const
-{
-    return KWindowSystem::desktopName(desktop);
-}
-
-QString PreviewHandlerImpl::desktopName(TabBoxClient* client) const
-{
-    Q_UNUSED(client)
-    return desktopName(1);
-}
-
-TabBoxClient* PreviewHandlerImpl::nextClientFocusChain(TabBoxClient* client) const
-{
-    if (m_stackingOrder.isEmpty())
-        return NULL;
-    int index = m_stackingOrder.indexOf(client);
-    index++;
-    if (index >= m_stackingOrder.count())
-        index = 0;
-    return m_stackingOrder[ index ];
-}
-
-KWin::TabBox::TabBoxClient* PreviewHandlerImpl::activeClient() const
-{
-    if (m_stackingOrder.isEmpty())
-        return NULL;
-    return m_stackingOrder[ 0 ];
-}
-
-int PreviewHandlerImpl::activeScreen() const
-{
-    return 0;
-}
-
-TabBoxClient* PreviewHandlerImpl::desktopClient() const
-{
-    return 0;
-}
-
-
-} // namespace TabBox
-} // namespace KWin
diff --git a/kcmkwin/kwintabbox/previewhandlerimpl.h b/kcmkwin/kwintabbox/previewhandlerimpl.h
deleted file mode 100644
index 6d26562043..0000000000
--- a/kcmkwin/kwintabbox/previewhandlerimpl.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/********************************************************************
- KWin - the KDE window manager
- This file is part of the KDE project.
-
-Copyright (C) 2009 Martin Gräßlin <kde@martin-graesslin.com>
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*********************************************************************/
-
-
-#ifndef KWIN_TABBOX_PREVIEWHANDLERIMPL_H
-#define KWIN_TABBOX_PREVIEWHANDLERIMPL_H
-
-#include "tabboxhandler.h"
-
-namespace KWin
-{
-namespace TabBox
-{
-
-class PreviewClientImpl :
-    public KWin::TabBox::TabBoxClient
-{
-public:
-    PreviewClientImpl(WId id);
-    ~PreviewClientImpl();
-
-    virtual QString caption() const;
-    virtual int height() const;
-    virtual QPixmap icon(const QSize& size = QSize(32, 32)) const;
-    virtual bool isMinimized() const;
-    virtual int width() const;
-    virtual WId window() const;
-    virtual int x() const;
-    virtual int y() const;
-
-private:
-    WId m_id;
-};
-
-class PreviewHandlerImpl :
-    public KWin::TabBox::TabBoxHandler
-{
-public:
-    PreviewHandlerImpl();
-    ~PreviewHandlerImpl();
-    virtual KWin::TabBox::TabBoxClient* clientToAddToList(KWin::TabBox::TabBoxClient* client, int desktop, bool allDesktops) const;
-    virtual KWin::TabBox::TabBoxClientList stackingOrder() const;
-    virtual int nextDesktopFocusChain(int desktop) const;
-    virtual int numberOfDesktops() const;
-    virtual int currentDesktop() const;
-    virtual QString desktopName(int desktop) const;
-    virtual QString desktopName(KWin::TabBox::TabBoxClient* client) const;
-    virtual KWin::TabBox::TabBoxClient* nextClientFocusChain(KWin::TabBox::TabBoxClient* client) const;
-    virtual KWin::TabBox::TabBoxClient* activeClient() const;
-    virtual int activeScreen() const;
-    virtual TabBoxClient* desktopClient() const;
-
-private:
-    TabBoxClientList m_stackingOrder;
-};
-
-} // namespace TabBox
-} // namespace KWin
-
-#endif // KWIN_TABBOX_PREVIEWHANDLERIMPL_H