From a9262c6fa4ab39d84597c76d55b8fe5cfb848891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= Date: Fri, 17 Oct 2014 09:31:22 +0200 Subject: [PATCH] Removed the dead code that used to calculate the direction of a tooltip The value of the 'dir' variable is quite difficult to calculate, and it is not used anywhere. Change-Id: I806a559dde51bdf3b243271fe68ee138faa872f6 --- src/declarativeimports/core/tooltip.cpp | 30 ------------------------- 1 file changed, 30 deletions(-) diff --git a/src/declarativeimports/core/tooltip.cpp b/src/declarativeimports/core/tooltip.cpp index dda0b5013..839b8b72b 100644 --- a/src/declarativeimports/core/tooltip.cpp +++ b/src/declarativeimports/core/tooltip.cpp @@ -140,36 +140,6 @@ void ToolTip::showToolTip() mainItem()->setVisible(true); } - //heuristics for knowing the diration - Plasma::Types::Direction dir; - QPoint pos = mapToScene(QPoint(0, 0)).toPoint(); - - if (window() && window()->screen()) { - pos = window()->mapToGlobal(pos); - } - QPoint popupPos = dlg->popupPosition(this, dlg->size()); - - if (location == Plasma::Types::Floating) { - dir = Plasma::Types::Up; - - if (pos.y() + height() <= popupPos.y()) { - dir = Plasma::Types::Down; - } else if (pos.x() + width() <= popupPos.x()) { - dir = Plasma::Types::Right; - } else if (pos.y() >= popupPos.y() + dlg->height()) { - dir = Plasma::Types::Up; - } else if (pos.x() >= popupPos.x() + dlg->width()) { - dir = Plasma::Types::Left; - } - } else { - dir = Plasma::locationToDirection(location); - if (dir == Plasma::Types::Left && (pos.x() + width() <= popupPos.x())) { - dir = Plasma::Types::Right; - } else if (dir == Plasma::Types::Up && (pos.y() + height() <= popupPos.y())) { - dir = Plasma::Types::Down; - } - } - dlg->setLocation(location); dlg->setMainItem(mainItem()); dlg->setVisualParent(this);