summaryrefslogtreecommitdiff
path: root/src/webtab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webtab.cpp')
-rw-r--r--src/webtab.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/webtab.cpp b/src/webtab.cpp
index 7687a957..1b0eef5e 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -11,9 +11,9 @@
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
+* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
-*
+*
* 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
@@ -66,8 +66,8 @@
WebTab::WebTab(QWidget *parent)
- : QWidget(parent)
- , m_progress(0)
+ : QWidget(parent)
+ , m_progress(0)
{
QVBoxLayout *l = new QVBoxLayout(this);
l->setMargin(0);
@@ -75,7 +75,7 @@ WebTab::WebTab(QWidget *parent)
QWidget *messageBar = new QWidget(this);
l->addWidget(messageBar);
- messageBar->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
+ messageBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
QVBoxLayout *l2 = new QVBoxLayout(messageBar);
l2->setMargin(0);
@@ -86,11 +86,11 @@ WebTab::WebTab(QWidget *parent)
view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
// fix focus handling
- setFocusProxy( view );
+ setFocusProxy(view);
KWebWallet *wallet = view->page()->wallet();
-
- if(wallet)
+
+ if (wallet)
{
connect(wallet, SIGNAL(saveFormDataRequested(const QString &, const QUrl &)),
this, SLOT(createWalletBar(const QString &, const QUrl &)));
@@ -108,7 +108,7 @@ WebTab::~WebTab()
WebView *WebTab::view()
{
- WebView *view = qobject_cast<WebView *>( layout()->itemAt(1)->widget() );
+ WebView *view = qobject_cast<WebView *>(layout()->itemAt(1)->widget());
return view;
}
@@ -119,26 +119,26 @@ WebPage *WebTab::page()
}
-// TODO:
-// Import the "about" check and the one in protocolhandler
+// TODO:
+// Import the "about" check and the one in protocolhandler
// in some (static?) methods in NewTabPage
-KUrl WebTab::url()
+KUrl WebTab::url()
{
- KUrl u = KUrl( view()->url() );
- if( u.scheme() == QL1S("about") )
+ KUrl u = KUrl(view()->url());
+ if (u.scheme() == QL1S("about"))
{
QWebElement rootElement = page()->mainFrame()->documentElement();
- if( rootElement.document().findAll("#rekonq-newtabpage").count() == 0 )
+ if (rootElement.document().findAll("#rekonq-newtabpage").count() == 0)
return u;
- if( rootElement.findAll(".favorites").count() > 0 )
+ if (rootElement.findAll(".favorites").count() > 0)
return KUrl("about:favorites");
- if( rootElement.findAll(".closedTabs").count() > 0 )
+ if (rootElement.findAll(".closedTabs").count() > 0)
return KUrl("about:closedTabs");
- if( rootElement.findAll(".history").count() > 0 )
+ if (rootElement.findAll(".history").count() > 0)
return KUrl("about:history");
- if( rootElement.findAll(".bookmarks").count() > 0 )
+ if (rootElement.findAll(".bookmarks").count() > 0)
return KUrl("about:bookmarks");
- if( rootElement.findAll(".downloads").count() > 0 )
+ if (rootElement.findAll(".downloads").count() > 0)
return KUrl("about:downloads");
}
return u;
@@ -168,14 +168,14 @@ void WebTab::createWalletBar(const QString &key, const QUrl &url)
// check if the url is in the wallet blacklist
QString urlString = url.toString();
QStringList blackList = ReKonfig::walletBlackList();
- if( blackList.contains( urlString ) )
+ if (blackList.contains(urlString))
return;
-
+
KWebWallet *wallet = page()->wallet();
QWidget *messageBar = layout()->itemAt(0)->widget();
WalletBar *walletBar = new WalletBar(messageBar);
- walletBar->onSaveFormData(key,url);
+ walletBar->onSaveFormData(key, url);
messageBar->layout()->addWidget(walletBar);
connect(walletBar, SIGNAL(saveFormDataAccepted(const QString &)),
@@ -190,7 +190,7 @@ void WebTab::createPreviewSelectorBar(int index)
QWidget *messageBar = layout()->itemAt(0)->widget();
PreviewSelectorBar *bar = new PreviewSelectorBar(index, messageBar);
messageBar->layout()->addWidget(bar);
-
+
connect(page(), SIGNAL(loadStarted()), bar, SLOT(loadProgress()));
connect(page(), SIGNAL(loadProgress(int)), bar, SLOT(loadProgress()));
connect(page(), SIGNAL(loadFinished(bool)), bar, SLOT(loadFinished()));
@@ -202,9 +202,9 @@ bool WebTab::hasRSSInfo()
{
QWebElementCollection col = page()->mainFrame()->findAllElements("link[type=\"application/rss+xml\"]");
col.append(page()->mainFrame()->findAllElements("link[type=\"application/atom+xml\"]"));
- if(col.count() != 0)
+ if (col.count() != 0)
return true;
-
+
return false;
}
@@ -213,33 +213,33 @@ void WebTab::showRSSInfo(QPoint pos)
{
QWebElementCollection col = page()->mainFrame()->findAllElements("link[type=\"application/rss+xml\"]");
col.append(page()->mainFrame()->findAllElements("link[type=\"application/atom+xml\"]"));
-
+
QMap<KUrl, QString> map;
int i = 0;
foreach(QWebElement el, col)
{
QString urlString;
- if( el.attribute("href").startsWith( QL1S("http") ) )
+ if (el.attribute("href").startsWith(QL1S("http")))
urlString = el.attribute("href");
else
{
KUrl u = url();
// NOTE
- // cd() is probably better than setPath() here,
+ // cd() is probably better than setPath() here,
// for all those url sites just having a path
- if(u.cd( el.attribute("href") ))
- urlString = u.toMimeDataString();
+ if (u.cd(el.attribute("href")))
+ urlString = u.toMimeDataString();
}
-
+
QString title = el.attribute("title");
- if(title.isEmpty())
- title= el.attribute("href");
-
+ if (title.isEmpty())
+ title = el.attribute("href");
+
map.insert(KUrl(urlString), title);
-
+
i++;
}
-
- RSSWidget *widget = new RSSWidget(map, window());
+
+ RSSWidget *widget = new RSSWidget(map, window());
widget->showAt(pos);
}