summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@gmail.com>2011-02-24 18:35:20 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-02-24 18:38:45 +0100
commit23b44d0344304499ba8e1f199720202381920827 (patch)
treeedd144e38d6dc3619b8b889f3a80a69a8dc52180 /src/urlbar
parentSave one updateRightIcons call from the bookmark icon. (diff)
downloadrekonq-23b44d0344304499ba8e1f199720202381920827.tar.xz
No more static members in the Application class,
an rApp shortcut for Application::instance, clean up code switching to use the new shortcut Reviewed by: adjam
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/bookmarkwidget.cpp4
-rw-r--r--src/urlbar/completionwidget.cpp4
-rw-r--r--src/urlbar/listitem.cpp6
-rw-r--r--src/urlbar/rsswidget.cpp4
-rw-r--r--src/urlbar/urlbar.cpp18
-rw-r--r--src/urlbar/urlresolver.cpp10
-rw-r--r--src/urlbar/urlresolver.h2
7 files changed, 24 insertions, 24 deletions
diff --git a/src/urlbar/bookmarkwidget.cpp b/src/urlbar/bookmarkwidget.cpp
index 3252d9cc..374b325d 100644
--- a/src/urlbar/bookmarkwidget.cpp
+++ b/src/urlbar/bookmarkwidget.cpp
@@ -123,7 +123,7 @@ void BookmarkWidget::accept()
if (!m_bookmark->isNull() && m_name->text() != m_bookmark->fullText())
{
m_bookmark->setFullText(m_name->text());
- Application::bookmarkProvider()->bookmarkManager()->emitChanged();
+ rApp->bookmarkProvider()->bookmarkManager()->emitChanged();
}
close();
}
@@ -131,7 +131,7 @@ void BookmarkWidget::accept()
void BookmarkWidget::removeBookmark()
{
- Application::bookmarkProvider()->bookmarkOwner()->deleteBookmark(*m_bookmark);
+ rApp->bookmarkProvider()->bookmarkOwner()->deleteBookmark(*m_bookmark);
close();
emit updateIcon();
diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp
index 0d2026af..8064c5bb 100644
--- a/src/urlbar/completionwidget.cpp
+++ b/src/urlbar/completionwidget.cpp
@@ -329,11 +329,11 @@ void CompletionWidget::setVisible(bool visible)
{
if (visible)
{
- Application::instance()->installEventFilter(this);
+ rApp->installEventFilter(this);
}
else
{
- Application::instance()->removeEventFilter(this);
+ rApp->removeEventFilter(this);
}
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index 1794233e..0afcd273 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -69,7 +69,7 @@ ListItem::ListItem(const UrlSearchItem &item, QWidget *parent)
// use the same application palette (hence, the same colors)
// Qt docs says that using this cctor is possible & fast (qt:qpalette)
- QPalette p(Application::palette());
+ QPalette p(rApp->palette());
setPalette(p);
deactivate();
@@ -195,7 +195,7 @@ QLabel *TypeIconLabel::getIcon(QString icon)
IconLabel::IconLabel(const QString &icon, QWidget *parent)
: QLabel(parent)
{
- QPixmap pixmapIcon = Application::iconManager()->iconForUrl(KUrl(icon)).pixmap(16);
+ QPixmap pixmapIcon = rApp->iconManager()->iconForUrl(KUrl(icon)).pixmap(16);
setFixedSize(16, 16);
setPixmap(pixmapIcon);
}
@@ -481,7 +481,7 @@ KAction *EngineBar::newEngineAction(KService::Ptr engine, KService::Ptr selected
KUrl url = KUrl( u.toString( QUrl::RemovePath | QUrl::RemoveQuery ) );
kDebug() << "Engine NAME: " << engine->name() << " URL: " << url;
- KAction *a = new KAction(Application::iconManager()->iconForUrl(url), engine->name(), this);
+ KAction *a = new KAction(rApp->iconManager()->iconForUrl(url), engine->name(), this);
a->setCheckable(true);
if (engine->desktopEntryName() == selectedEngine->desktopEntryName()) a->setChecked(true);
a->setData(engine->entryPath());
diff --git a/src/urlbar/rsswidget.cpp b/src/urlbar/rsswidget.cpp
index b29ed0e8..9065dc80 100644
--- a/src/urlbar/rsswidget.cpp
+++ b/src/urlbar/rsswidget.cpp
@@ -74,7 +74,7 @@ RSSWidget::RSSWidget(const QMap< KUrl, QString > &map, QWidget *parent)
m_agregators->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
m_agregators->addItem(KIcon("akregator"), QString("Akregator"));
- m_agregators->addItem(Application::iconManager()->iconForUrl(KUrl("http://google.com/reader")), i18n("Google Reader"));
+ m_agregators->addItem(rApp->iconManager()->iconForUrl(KUrl("http://google.com/reader")), i18n("Google Reader"));
layout->addRow(agregator, m_agregators);
@@ -138,7 +138,7 @@ void RSSWidget::accept()
void RSSWidget::addWithGoogleReader(const QString &url)
{
KUrl toLoad = KUrl("http://www.google.com/ig/add?feedurl=" + url);
- Application::instance()->mainWindow()->currentTab()->view()->load(toLoad);
+ rApp->mainWindow()->currentTab()->view()->load(toLoad);
}
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index ceecf211..0cc96f30 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -110,7 +110,7 @@ UrlBar::UrlBar(QWidget *parent)
connect(_tab->view(), SIGNAL(iconChanged()), this, SLOT(refreshFavicon()));
// search icon
- connect(Application::opensearchManager(), SIGNAL(openSearchEngineAdded(const QString &, const QString &, const QString &)), this, SLOT(updateRightIcons()));
+ connect(rApp->opensearchManager(), SIGNAL(openSearchEngineAdded(const QString &, const QString &, const QString &)), this, SLOT(updateRightIcons()));
_suggestionTimer->setSingleShot(true);
connect(_suggestionTimer, SIGNAL(timeout()), this, SLOT(suggest()));
@@ -149,7 +149,7 @@ void UrlBar::activated(const KUrl& url, Rekonq::OpenType type)
activateSuggestions(false);
clearFocus();
setUrl(url);
- Application::instance()->loadUrl(url, type);
+ rApp->loadUrl(url, type);
}
@@ -165,8 +165,8 @@ void UrlBar::paintEvent(QPaintEvent *event)
}
else
{
- backgroundColor = Application::palette().color(QPalette::Base);
- foregroundColor = Application::palette().color(QPalette::Text);
+ backgroundColor = rApp->palette().color(QPalette::Base);
+ foregroundColor = rApp->palette().color(QPalette::Text);
}
// set background color of UrlBar
@@ -185,7 +185,7 @@ void UrlBar::paintEvent(QPaintEvent *event)
}
else
{
- QColor highlight = Application::palette().color(QPalette::Highlight);
+ QColor highlight = rApp->palette().color(QPalette::Highlight);
int r = (highlight.red()+2*backgroundColor.red())/3;
int g = (highlight.green()+2*backgroundColor.green())/3;
@@ -356,7 +356,7 @@ void UrlBar::showBookmarkInfo(const QPoint &pos)
if( _tab->url().scheme() == QL1S("about") )
return;
- KBookmark bookmark = Application::bookmarkProvider()->bookmarkForUrl(_tab->url());
+ KBookmark bookmark = rApp->bookmarkProvider()->bookmarkForUrl(_tab->url());
IconButton *bt = qobject_cast<IconButton *>(this->sender());
if (!bt)
@@ -364,7 +364,7 @@ void UrlBar::showBookmarkInfo(const QPoint &pos)
if (bookmark.isNull())
{
- bookmark = Application::bookmarkProvider()->bookmarkOwner()->bookmarkCurrentPage();
+ bookmark = rApp->bookmarkProvider()->bookmarkOwner()->bookmarkCurrentPage();
// set bk icon
bt->setIcon(KIcon("bookmarks"));
@@ -443,7 +443,7 @@ IconButton *UrlBar::addRightIcon(UrlBar::icon ic)
rightIcon->setToolTip(i18n("Show SSL Info"));
break;
case UrlBar::BK:
- if (Application::bookmarkProvider()->bookmarkForUrl(_tab->url()).isNull())
+ if (rApp->bookmarkProvider()->bookmarkForUrl(_tab->url()).isNull())
{
rightIcon->setIcon(KIcon("bookmarks").pixmap(32,32, QIcon::Disabled));
rightIcon->setToolTip(i18n("Bookmark this page"));
@@ -540,5 +540,5 @@ void UrlBar::refreshFavicon()
_icon->setIcon(KIcon("arrow-right"));
return;
}
- _icon->setIcon(Application::iconManager()->iconForUrl(u));
+ _icon->setIcon(rApp->iconManager()->iconForUrl(u));
}
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp
index 3797f51f..15445ee5 100644
--- a/src/urlbar/urlresolver.cpp
+++ b/src/urlbar/urlresolver.cpp
@@ -356,7 +356,7 @@ void UrlResolver::computeWebSearches()
// history
void UrlResolver::computeHistory()
{
- QList<HistoryItem> found = Application::historyManager()->find(_typedString);
+ QList<HistoryItem> found = rApp->historyManager()->find(_typedString);
qSort(found);
Q_FOREACH(const HistoryItem &i, found)
@@ -373,7 +373,7 @@ void UrlResolver::computeHistory()
// bookmarks
void UrlResolver::computeBookmarks()
{
- QList<KBookmark> found = Application::bookmarkProvider()->find(_typedString);
+ QList<KBookmark> found = rApp->bookmarkProvider()->find(_typedString);
kDebug() << "FOUND: " << found.count();
Q_FOREACH(const KBookmark &b, found)
{
@@ -388,7 +388,7 @@ void UrlResolver::computeSuggestions()
{
// if a string startsWith /, it is probably a local path
// so, no need for suggestions...
- if(_typedString.startsWith('/') || !Application::opensearchManager()->isSuggestionAvailable())
+ if(_typedString.startsWith('/') || !rApp->opensearchManager()->isSuggestionAvailable())
{
UrlSearchList list;
emit suggestionsReady(list, _typedString);
@@ -403,13 +403,13 @@ void UrlResolver::computeSuggestions()
setSearchEngine(engine);
}
- connect(Application::opensearchManager(),
+ connect(rApp->opensearchManager(),
SIGNAL(suggestionsReceived(const QString &, const ResponseList &)),
this,
SLOT(suggestionsReceived(const QString &, const ResponseList &)));
_typedQuery = query;
- Application::opensearchManager()->requestSuggestion(query);
+ rApp->opensearchManager()->requestSuggestion(query);
}
diff --git a/src/urlbar/urlresolver.h b/src/urlbar/urlresolver.h
index 43a4a43e..821287c8 100644
--- a/src/urlbar/urlresolver.h
+++ b/src/urlbar/urlresolver.h
@@ -133,7 +133,7 @@ public:
{
_searchEngine = engine;
if(engine)
- Application::opensearchManager()->setSearchProvider(engine->desktopEntryName());
+ rApp->opensearchManager()->setSearchProvider(engine->desktopEntryName());
};
void computeSuggestions();