From 14664e54b1a2dbe9c06f474a0918a262dba04e20 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 25 Jul 2011 19:48:41 +0200 Subject: clean up - QL1S - one stupid kDebug less - codingstyle --- src/tabbar.cpp | 68 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'src/tabbar.cpp') diff --git a/src/tabbar.cpp b/src/tabbar.cpp index edcb3a9c..48a0ad70 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -102,13 +102,13 @@ QSize TabBar::tabSizeHint(int index) const int minWidth = view->sizeHint().width() / minWidthDivisor; int w; - if(baseWidth * count() < tabBarWidth) + if (baseWidth * count() < tabBarWidth) { w = baseWidth; } else { - if(count() > 0 && tabBarWidth / count() > minWidth) + if (count() > 0 && tabBarWidth / count() > minWidth) { w = tabBarWidth / count(); } @@ -162,7 +162,7 @@ void TabBar::detachTab() void TabBar::showTabPreview() { - if(m_isFirstTimeOnTab) + if (m_isFirstTimeOnTab) m_isFirstTimeOnTab = false; //delete previous tab preview @@ -175,11 +175,11 @@ void TabBar::showTabPreview() WebTab *currentTab = mv->webTab(currentIndex()); // check if view && currentView exist before using them :) - if(!currentTab || !indexedTab) + if (!currentTab || !indexedTab) return; // no previews during load - if(indexedTab->isPageLoading()) + if (indexedTab->isPageLoading()) return; int w = (mv->sizeHint().width() / baseWidthDivisor); @@ -189,11 +189,11 @@ void TabBar::showTabPreview() int tabBarWidth = mv->size().width(); int leftIndex = tabRect(m_currentTabPreviewIndex).x() + (tabRect(m_currentTabPreviewIndex).width() - w) / 2; - if(leftIndex < 0) + if (leftIndex < 0) { leftIndex = 0; } - else if(leftIndex + w > tabBarWidth) + else if (leftIndex + w > tabBarWidth) { leftIndex = tabBarWidth - w; } @@ -205,7 +205,7 @@ void TabBar::showTabPreview() void TabBar::hideEvent(QHideEvent *event) { - if(!event->spontaneous()) + if (!event->spontaneous()) { qobject_cast(parent())->addTabButton()->hide(); } @@ -216,7 +216,7 @@ void TabBar::hideEvent(QHideEvent *event) void TabBar::showEvent(QShowEvent *event) { KTabBar::showEvent(event); - if(!event->spontaneous()) + if (!event->spontaneous()) { qobject_cast(parent())->addTabButton()->show(); } @@ -225,24 +225,24 @@ void TabBar::showEvent(QShowEvent *event) void TabBar::mouseMoveEvent(QMouseEvent *event) { - if(count() == 1) + if (count() == 1) { return; } KTabBar::mouseMoveEvent(event); - if(ReKonfig::hoveringTabOption() == 0) + if (ReKonfig::hoveringTabOption() == 0) { //Find the tab under the mouse const int tabIndex = tabAt(event->pos()); // if found and not the current tab then show tab preview - if(tabIndex != -1 + if (tabIndex != -1 && tabIndex != currentIndex() && m_currentTabPreviewIndex != tabIndex && event->buttons() == Qt::NoButton - ) + ) { m_currentTabPreviewIndex = tabIndex; @@ -253,9 +253,9 @@ void TabBar::mouseMoveEvent(QMouseEvent *event) } // if current tab or not found then hide previous tab preview - if(tabIndex == currentIndex() || tabIndex == -1) + if (tabIndex == currentIndex() || tabIndex == -1) { - if(!m_previewPopup.isNull()) + if (!m_previewPopup.isNull()) { m_previewPopup.data()->hide(); } @@ -267,10 +267,10 @@ void TabBar::mouseMoveEvent(QMouseEvent *event) void TabBar::leaveEvent(QEvent *event) { - if(ReKonfig::hoveringTabOption() == 0) + if (ReKonfig::hoveringTabOption() == 0) { //if leave tabwidget then hide previous tab preview - if(!m_previewPopup.isNull()) + if (!m_previewPopup.isNull()) { m_previewPopup.data()->hide(); } @@ -284,9 +284,9 @@ void TabBar::leaveEvent(QEvent *event) void TabBar::mousePressEvent(QMouseEvent *event) { - if(ReKonfig::hoveringTabOption() == 0) + if (ReKonfig::hoveringTabOption() == 0) { - if(!m_previewPopup.isNull()) + if (!m_previewPopup.isNull()) { m_previewPopup.data()->hide(); } @@ -294,7 +294,7 @@ void TabBar::mousePressEvent(QMouseEvent *event) } // just close tab on middle mouse click - if(event->button() == Qt::MidButton) + if (event->button() == Qt::MidButton) return; KTabBar::mousePressEvent(event); @@ -319,7 +319,7 @@ void TabBar::contextMenu(int tab, const QPoint &pos) menu.addAction(mainWindow->actionByName(QL1S("new_tab"))); menu.addAction(mainWindow->actionByName(QL1S("clone_tab"))); - if(count() > 1) + if (count() > 1) menu.addAction(mainWindow->actionByName(QL1S("detach_tab"))); menu.addAction(mainWindow->actionByName(QL1S("open_last_closed_tab"))); menu.addAction(mainWindow->actionByName(QL1S("closed_tab_menu"))); @@ -348,7 +348,7 @@ void TabBar::emptyAreaContextMenu(const QPoint &pos) menu.addAction(mainWindow->actionByName(QL1S("reload_all_tabs"))); KToolBar *mainBar = mainWindow->toolBar("mainToolBar"); - if(!mainBar->isVisible()) + if (!mainBar->isVisible()) { menu.addAction(mainBar->toggleViewAction()); } @@ -359,16 +359,16 @@ void TabBar::emptyAreaContextMenu(const QPoint &pos) void TabBar::tabRemoved(int index) { - if(ReKonfig::hoveringTabOption() == 0) + if (ReKonfig::hoveringTabOption() == 0) { - if(!m_previewPopup.isNull()) + if (!m_previewPopup.isNull()) { m_previewPopup.data()->hide(); } m_currentTabPreviewIndex = -1; } - if(ReKonfig::animatedTabHighlighting()) + if (ReKonfig::animatedTabHighlighting()) removeAnimation(index); } @@ -383,16 +383,16 @@ void TabBar::setupHistoryActions() // update closed tabs menu KActionMenu *am = qobject_cast(w->actionByName(QL1S("closed_tab_menu"))); - if(!am) + if (!am) return; bool isEnabled = (mv->recentlyClosedTabs().size() > 0); am->setEnabled(isEnabled); - if(am->menu()) + if (am->menu()) am->menu()->clear(); - if(!isEnabled) + if (!isEnabled) return; Q_FOREACH(const HistoryItem & item, mv->recentlyClosedTabs()) @@ -418,9 +418,9 @@ void TabBar::setTabHighlighted(int index) const QByteArray propertyName = highlightPropertyName(index); const QColor highlightColor = KColorScheme(QPalette::Active, KColorScheme::Window).foreground(KColorScheme::PositiveText).color(); - if(tabTextColor(index) != highlightColor) + if (tabTextColor(index) != highlightColor) { - if(ReKonfig::animatedTabHighlighting()) + if (ReKonfig::animatedTabHighlighting()) { m_tabHighlightEffect->setEnabled(true); m_tabHighlightEffect->setProperty(propertyName, qreal(0.9)); @@ -445,7 +445,7 @@ void TabBar::setTabHighlighted(int index) void TabBar::resetTabHighlighted(int index) { - if(ReKonfig::animatedTabHighlighting()) + if (ReKonfig::animatedTabHighlighting()) removeAnimation(index); setTabTextColor(index, palette().text().color()); @@ -461,14 +461,14 @@ void TabBar::removeAnimation(int index) m_animationMapper->removeMappings(anim); delete anim; - if(m_highlightAnimation.isEmpty()) + if (m_highlightAnimation.isEmpty()) m_tabHighlightEffect->setEnabled(false); } void TabBar::setAnimatedTabHighlighting(bool enabled) { - if(enabled) + if (enabled) m_tabHighlightEffect->setEnabled(true); else { @@ -476,7 +476,7 @@ void TabBar::setAnimatedTabHighlighting(bool enabled) //cleanup QHashIterator i(m_highlightAnimation); - while(i.hasNext()) + while (i.hasNext()) { i.next(); m_tabHighlightEffect->setProperty(i.key(), QVariant()); //destroy the property -- cgit v1.2.1