diff --git a/tabbox/declarative.cpp b/tabbox/declarative.cpp index 0131bb9d76..dd4f24214b 100644 --- a/tabbox/declarative.cpp +++ b/tabbox/declarative.cpp @@ -271,21 +271,6 @@ void DeclarativeView::setCurrentIndex(const QModelIndex &index) } } -QModelIndex DeclarativeView::indexAt(const QPoint &pos) const -{ - if (QObject *item = rootObject()->findChild("listView")) { - QVariant returnedValue; - QVariant xPos(pos.x()); - QVariant yPos(pos.y()); - QMetaObject::invokeMethod(item, "indexAtMousePos", Q_RETURN_ARG(QVariant, returnedValue), Q_ARG(QVariant, QVariant(pos))); - if (!returnedValue.canConvert()) { - return QModelIndex(); - } - return m_model->index(returnedValue.toInt(), 0); - } - return QModelIndex(); -} - void DeclarativeView::currentIndexChanged(int row) { tabBox->setCurrentIndex(m_model->index(row, 0)); diff --git a/tabbox/declarative.h b/tabbox/declarative.h index 9bdad158a2..28b8a74739 100644 --- a/tabbox/declarative.h +++ b/tabbox/declarative.h @@ -57,7 +57,6 @@ public: virtual void showEvent(QShowEvent *event); virtual void resizeEvent(QResizeEvent *event); void setCurrentIndex(const QModelIndex &index); - QModelIndex indexAt(const QPoint &pos) const; protected: virtual void hideEvent(QHideEvent *event); diff --git a/tabbox/qml/IconTabBox.qml b/tabbox/qml/IconTabBox.qml index 88cbc49ec0..f2b3eab45a 100644 --- a/tabbox/qml/IconTabBox.qml +++ b/tabbox/qml/IconTabBox.qml @@ -85,12 +85,6 @@ Item { } } ListView { - /** - * Called from C++ to get the index at a mouse pos. - **/ - function indexAtMousePos(pos) { - return iconsListView.indexAt(pos.x, pos.y); - } signal currentIndexChanged(int index) id: iconsListView objectName: "listView" diff --git a/tabbox/qml/compact.qml b/tabbox/qml/compact.qml index 050982b58b..9504789efb 100644 --- a/tabbox/qml/compact.qml +++ b/tabbox/qml/compact.qml @@ -166,12 +166,6 @@ Item { // icon size or two text elements and margins and hoverItem margins return Math.max(16, height + hoverItem.margins.top + hoverItem.margins.bottom); } - /** - * Called from C++ to get the index at a mouse pos. - **/ - function indexAtMousePos(pos) { - return compactListView.indexAt(pos.x, pos.y); - } signal currentIndexChanged(int index) id: compactListView objectName: "listView" diff --git a/tabbox/qml/desktop.qml b/tabbox/qml/desktop.qml index f63996cc66..fe0c273c8f 100644 --- a/tabbox/qml/desktop.qml +++ b/tabbox/qml/desktop.qml @@ -140,12 +140,6 @@ Item { // icon size or two text elements and margins and hoverItem margins return Math.max(32, height + desktopTabBox.textMargin * 2 + hoverItem.margins.top + hoverItem.margins.bottom); } - /** - * Called from C++ to get the index at a mouse pos. - **/ - function indexAtMousePos(pos) { - return listView.indexAt(pos.x, pos.y); - } signal currentIndexChanged(int index) id: listView objectName: "listView" diff --git a/tabbox/qml/informative.qml b/tabbox/qml/informative.qml index 54bcdddbdb..9ec87575d1 100644 --- a/tabbox/qml/informative.qml +++ b/tabbox/qml/informative.qml @@ -182,12 +182,6 @@ Item { // icon size or two text elements and margins and hoverItem margins return Math.max(32, height*2 + informativeTabBox.textMargin * 3 + hoverItem.margins.top + hoverItem.margins.bottom); } - /** - * Called from C++ to get the index at a mouse pos. - **/ - function indexAtMousePos(pos) { - return listView.indexAt(pos.x, pos.y); - } signal currentIndexChanged(int index) id: listView objectName: "listView" diff --git a/tabbox/qml/text.qml b/tabbox/qml/text.qml index 388ffbae18..669a541b7f 100644 --- a/tabbox/qml/text.qml +++ b/tabbox/qml/text.qml @@ -131,12 +131,6 @@ Item { // icon size or two text elements and margins and hoverItem margins return height + hoverItem.margins.top + hoverItem.margins.bottom; } - /** - * Called from C++ to get the index at a mouse pos. - **/ - function indexAtMousePos(pos) { - return textListView.indexAt(pos.x, pos.y); - } signal currentIndexChanged(int index) id: textListView objectName: "listView" diff --git a/tabbox/qml/thumbnails.qml b/tabbox/qml/thumbnails.qml index 4bdddcb876..a0bb0735c9 100644 --- a/tabbox/qml/thumbnails.qml +++ b/tabbox/qml/thumbnails.qml @@ -64,12 +64,6 @@ Item { } ListView { - /** - * Called from C++ to get the index at a mouse pos. - **/ - function indexAtMousePos(pos) { - return thumbnailListView.indexAt(pos.x, pos.y); - } signal currentIndexChanged(int index) id: thumbnailListView objectName: "listView" diff --git a/tabbox/qml/window_strip.qml b/tabbox/qml/window_strip.qml index b63a138b90..a8137342d7 100644 --- a/tabbox/qml/window_strip.qml +++ b/tabbox/qml/window_strip.qml @@ -55,12 +55,6 @@ Item { } ListView { - /** - * Called from C++ to get the index at a mouse pos. - **/ - function indexAtMousePos(pos) { - return thumbnailListView.indexAt(pos.x, pos.y); - } signal currentIndexChanged(int index) id: thumbnailListView objectName: "listView" diff --git a/tabbox/tabboxhandler.cpp b/tabbox/tabboxhandler.cpp index bddfcbb49b..d106b14c0c 100644 --- a/tabbox/tabboxhandler.cpp +++ b/tabbox/tabboxhandler.cpp @@ -342,11 +342,6 @@ int TabBoxHandler::desktop(const QModelIndex& index) const return -1; } -int TabBoxHandler::currentSelectedDesktop() const -{ - return desktop(d->index); -} - void TabBoxHandler::setCurrentIndex(const QModelIndex& index) { if (d->index == index) { @@ -440,18 +435,6 @@ bool TabBoxHandler::containsPos(const QPoint& pos) const return w->geometry().contains(pos); } -QModelIndex TabBoxHandler::indexAt(const QPoint& pos) const -{ - if (d->m_declarativeView && d->m_declarativeView->isVisible()) { - QPoint widgetPos = d->m_declarativeView->mapFromGlobal(pos); - return d->m_declarativeView->indexAt(widgetPos); - } else if (d->m_declarativeDesktopView && d->m_declarativeDesktopView->isVisible()) { - QPoint widgetPos = d->m_declarativeDesktopView->mapFromGlobal(pos); - return d->m_declarativeDesktopView->indexAt(widgetPos); - } - return QModelIndex(); -} - QModelIndex TabBoxHandler::index(KWin::TabBox::TabBoxClient* client) const { return d->clientModel()->index(client); diff --git a/tabbox/tabboxhandler.h b/tabbox/tabboxhandler.h index 0f5a0447b4..27b475a8ef 100644 --- a/tabbox/tabboxhandler.h +++ b/tabbox/tabboxhandler.h @@ -256,11 +256,6 @@ public: * @see DesktopModel::desktopIndex */ int desktop(const QModelIndex& index) const; - /** - * @return The current selected desktop. If there is no selected desktop - * or TabBoxMode is not TabBoxConfig::DesktopTabBox -1 will be returned. - */ - int currentSelectedDesktop() const; /** * Handles additional grabbed key events by the TabBox controller. @@ -278,15 +273,6 @@ public: */ bool containsPos(const QPoint& pos) const; /** - * Returns the index at the given position in global coordinates - * of the view. - * @param pos The position in global coordinates - * @return The model index at given position. If there is no item - * at the position or the position is not in the view an invalid - * model index will be returned; - */ - QModelIndex indexAt(const QPoint& pos) const; - /** * @param client The TabBoxClient whose index should be returned * @return Returns the ModelIndex of given TabBoxClient or an invalid ModelIndex * if the model does not contain the given TabBoxClient.