diff -r b0dd75e285d2 -r 0f2326c2a325 ginebra2/mostvisitedsnippet.cpp --- a/ginebra2/mostvisitedsnippet.cpp Fri May 14 15:40:36 2010 +0300 +++ b/ginebra2/mostvisitedsnippet.cpp Wed Jun 23 17:59:43 2010 +0300 @@ -1,20 +1,23 @@ /* * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation, version 2.1 of the License. * -* Initial Contributors: -* Nokia Corporation - initial contribution. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. * -* Contributors: +* You should have received a copy of the GNU Lesser General Public License +* along with this program. If not, +* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". * -* Description: +* Description: * */ - #include "mostvisitedsnippet.h" #include "mostvisitedpageview.h" @@ -26,10 +29,10 @@ m_chrome = chrome; } -void MostVisitedSnippet::toggleVisibility(bool animate) +void MostVisitedSnippet::toggleVisibility(bool animate) { MostVisitedPagesWidget *mostVisitedPagesWidget = dynamic_cast(widget()); - if (!mostVisitedPagesWidget) + if (!mostVisitedPagesWidget) return; if (!isVisible()) { @@ -47,7 +50,7 @@ void MostVisitedSnippet::setWidget(QGraphicsWidget * widget) { connect(m_chrome , SIGNAL(aspectChanged(int)), this, SLOT(displayModeChanged(int))); - ChromeSnippet::setWidget(widget); + ChromeSnippet::setWidget(widget); MostVisitedPagesWidget *mostVisitedPagesWidget = dynamic_cast(widget); connect(mostVisitedPagesWidget, SIGNAL(closeComplete()), this, SIGNAL(mostVisitedSnippetCloseComplete())); } @@ -59,7 +62,7 @@ ChromeSnippet* visibleSnippet= m_chrome->getSnippet("WebViewToolbarId"); if (visibleSnippet) - toolBarHeight = visibleSnippet->widget()->rect().height(); + toolBarHeight = visibleSnippet->widget()->rect().height(); mostVisitedPagesWidget->resize(m_chrome->size().toSize()); mostVisitedPagesWidget->updatePos(QPointF(0, 0), toolBarHeight); @@ -67,14 +70,14 @@ void MostVisitedSnippet::displayModeChanged(int newMode) { - if (isVisible()) { + if (isVisible()) { MostVisitedPagesWidget *mostVisitedPagesWidget = dynamic_cast(widget()); - - if (!mostVisitedPagesWidget) + + if (!mostVisitedPagesWidget) return; updateMVGeometry(); - + QString displayMode = (newMode == landscape) ? "Landscape" : "Portrait"; mostVisitedPagesWidget->displayModeChanged(displayMode); } @@ -83,19 +86,19 @@ void MostVisitedSnippet::hide(bool animate) { MostVisitedPagesWidget *mostVisitedPagesWidget = dynamic_cast(widget()); - - if(!mostVisitedPagesWidget) + + if (!mostVisitedPagesWidget) return; ChromeSnippet::hide(animate); mostVisitedPagesWidget->closeAnimationCompleted(); } -void MostVisitedSnippet::close() +void MostVisitedSnippet::close() { MostVisitedPagesWidget *mostVisitedPagesWidget = dynamic_cast(widget()); - - if(mostVisitedPagesWidget) { + + if (mostVisitedPagesWidget) { mostVisitedPagesWidget->close(); } }