summaryrefslogtreecommitdiff
path: root/src/tabbar.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-06-03 16:25:08 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-06-03 16:25:08 +0200
commitaebdde89e26a06b73e3c402cb86cbced9772593e (patch)
treedb01a98166a34385fa89e649dffff5711e5bce97 /src/tabbar.cpp
parentThis should save rekonq from crashes in closed tabs view. (diff)
downloadrekonq-aebdde89e26a06b73e3c402cb86cbced9772593e.tar.xz
Cleaning TabBar::showPreview code
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r--src/tabbar.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index 5d6b7b2c..8df8560f 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -148,6 +148,10 @@ void TabBar::detachTab()
void TabBar::showTabPreview(int tab)
{
+ //delete previous tab preview
+ delete m_previewPopup.data();
+ m_previewPopup.clear();
+
MainView *mv = qobject_cast<MainView *>(parent());
WebTab *indexedTab = mv->webTab(tab);
@@ -157,15 +161,12 @@ void TabBar::showTabPreview(int tab)
if (!currentTab || !indexedTab)
return;
- int w = tabSizeHint(tab).width();
- int h = w * ((0.0 + currentTab->height()) / currentTab->width());
-
- //delete previous tab preview
- delete m_previewPopup.data();
- m_previewPopup.clear();
-
+ // no previews during load
if (indexedTab->progress() != 0)
return;
+
+ int w = tabSizeHint(tab).width();
+ int h = w * ((0.0 + currentTab->height()) / currentTab->width());
m_previewPopup = new KPassivePopup(this);
m_previewPopup.data()->setFrameShape(QFrame::StyledPanel);