summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/application.cpp10
-rw-r--r--src/mainview.cpp7
-rw-r--r--src/mainwindow.cpp2
-rw-r--r--src/urlbar.cpp4
-rw-r--r--src/urlbar.h4
5 files changed, 18 insertions, 9 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 35d52a23..8e1740fc 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -187,7 +187,15 @@ BookmarkProvider *Application::bookmarkProvider()
KIcon Application::icon(const KUrl &url)
{
- KIcon icon = KIcon(QWebSettings::iconForUrl(url));
+ KIcon icon;
+ if(url.isEmpty())
+ {
+ icon = KIcon("text-html");
+ }
+ else
+ {
+ icon = KIcon(QWebSettings::iconForUrl(url));
+ }
if (icon.isNull())
{
icon = KIcon("text-html");
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 9dfa797d..832a0683 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -253,12 +253,12 @@ void MainView::slotCurrentChanged(int index)
if (oldWebView)
{
- // disconnecting webview with urlbar
+ // disconnecting webview from urlbar
disconnect(oldWebView, SIGNAL(loadProgress(int)), urlBar(), SLOT(slotUpdateProgress(int)));
disconnect(oldWebView, SIGNAL(loadFinished(bool)), urlBar(), SLOT(slotLoadFinished(bool)));
disconnect(oldWebView, SIGNAL(urlChanged(const QUrl &)), urlBar(), SLOT(setUrl(const QUrl &)));
- disconnect(oldWebView, SIGNAL(iconChanged()), urlBar(), SLOT(slotUpdateUrl()));
+ // disconnecting webpage from mainview
disconnect(oldWebView->page(), SIGNAL(statusBarMessage(const QString&)),
this, SIGNAL(showStatusBarMessage(const QString&)));
disconnect(oldWebView->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)),
@@ -269,7 +269,6 @@ void MainView::slotCurrentChanged(int index)
connect(webView, SIGNAL(loadProgress(int)), urlBar(), SLOT(slotUpdateProgress(int)));
connect(webView, SIGNAL(loadFinished(bool)), urlBar(), SLOT(slotLoadFinished(bool)));
connect(webView, SIGNAL(urlChanged(const QUrl &)), urlBar(), SLOT(setUrl(const QUrl &)));
- connect(webView, SIGNAL(iconChanged()), urlBar(), SLOT(slotUpdateUrl()));
connect(webView->page(), SIGNAL(statusBarMessage(const QString&)),
this, SIGNAL(showStatusBarMessage(const QString&)));
@@ -531,6 +530,8 @@ void MainView::webViewIconChanged()
delete movie;
label->setMovie(0);
label->setPixmap(icon.pixmap(16, 16));
+
+ urlBar()->slotUpdateUrl();
}
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 48d57e7d..f18cf1d2 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1030,7 +1030,7 @@ void MainWindow::slotAboutToShowBackMenu()
QWebHistoryItem item = history->backItems(history->count()).at(i);
KAction *action = new KAction(this);
action->setData(-1*(historyCount - i - 1));
- QIcon icon = Application::instance()->icon(item.url());
+ QIcon icon = Application::icon(item.url());
action->setIcon(icon);
action->setText(item.title());
m_historyBackMenu->addAction(action);
diff --git a/src/urlbar.cpp b/src/urlbar.cpp
index 4b253773..05a4ad9a 100644
--- a/src/urlbar.cpp
+++ b/src/urlbar.cpp
@@ -84,9 +84,9 @@ UrlBar::UrlBar(QWidget *parent)
QPalette p = view()->palette();
p.setColor(QPalette::Base, palette().color(QPalette::Base));
view()->setPalette(p);
-
+/*
// set empty item with default icon
- slotUpdateUrl();
+ slotUpdateUrl();*/
}
diff --git a/src/urlbar.h b/src/urlbar.h
index 41d7945e..a12c5f62 100644
--- a/src/urlbar.h
+++ b/src/urlbar.h
@@ -70,12 +70,12 @@ signals:
public slots:
void setUrl(const QUrl &url);
void slotUpdateProgress(int progress);
-
+ void slotUpdateUrl();
+
private slots:
void slotActivated(const QString&);
void slotLoadFinished(bool);
void slotCleared();
- void slotUpdateUrl();
protected:
virtual void paintEvent(QPaintEvent *event);