summaryrefslogtreecommitdiff
path: root/src/tabbar.cpp
diff options
context:
space:
mode:
authorRohan Garg <rohangarg@gmail.com>2011-01-09 03:14:04 +0530
committerRohan Garg <rohangarg@gmail.com>2011-01-09 03:14:04 +0530
commit914b0c1c0d2440bee0675ef9b77bad9d40630903 (patch)
tree401ab32756d5d7fb95a9663d38cc7cd099524ecd /src/tabbar.cpp
parentUse Escape shortcut to stop web loading (diff)
downloadrekonq-914b0c1c0d2440bee0675ef9b77bad9d40630903.tar.xz
Tab bar preview optimization, use event->pos() to get the position of tab instead of cycling with a while loop
Thanks to Furkan Üzümcü Review Board request : http://git.reviewboard.kde.org/r/100324/
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r--src/tabbar.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index 57124979..fcc7b789 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -222,18 +222,7 @@ void TabBar::mouseMoveEvent(QMouseEvent *event)
if (ReKonfig::hoveringTabOption() == 0)
{
//Find the tab under the mouse
- int i = 0;
- int tabIndex = -1;
- while (i < count()
- && tabIndex == -1
- )
- {
- if (tabRect(i).contains(event->pos()))
- {
- tabIndex = i;
- }
- i++;
- }
+ const int tabIndex = tabAt(event->pos());
// if found and not the current tab then show tab preview
if (tabIndex != -1