summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rekonqpage/newtabpage.cpp9
-rw-r--r--src/rekonqpage/newtabpage.h4
2 files changed, 11 insertions, 2 deletions
diff --git a/src/rekonqpage/newtabpage.cpp b/src/rekonqpage/newtabpage.cpp
index c8b2e916..78928bca 100644
--- a/src/rekonqpage/newtabpage.cpp
+++ b/src/rekonqpage/newtabpage.cpp
@@ -53,6 +53,7 @@
NewTabPage::NewTabPage(QWebFrame *frame)
: m_root(frame->documentElement())
+ , m_url(KUrl())
{
QString htmlFilePath = KStandardDirs::locate("data", "rekonq/htmls/home.html");
@@ -73,7 +74,7 @@ NewTabPage::~NewTabPage()
}
-void NewTabPage::generate(const KUrl &url)
+void NewTabPage::generate(KUrl url)
{
if(KUrl("about:preview").isParentOf(url))
{
@@ -106,6 +107,7 @@ void NewTabPage::generate(const KUrl &url)
{
favoritesPage();
title = i18n("Favorites");
+ url = KUrl("about:favorites");
}
else if(url == KUrl("about:closedTabs"))
{
@@ -123,6 +125,8 @@ void NewTabPage::generate(const KUrl &url)
title = i18n("Bookmarks");
}
+ m_url = url;
+
m_root.document().findFirst("title").setPlainText(title);
}
@@ -236,6 +240,9 @@ void NewTabPage::snapFinished()
QWebElement prev = m_root.findFirst("#preview" + snap->data().toString());
prev.replace(validPreview(snap->data().toInt(), snap->snapUrl(), snap->snapTitle()));
+ if(m_url != KUrl("about:favorites"))
+ return;
+
// Save the new config
QStringList names = ReKonfig::previewNames();
QStringList urls = ReKonfig::previewUrls();
diff --git a/src/rekonqpage/newtabpage.h b/src/rekonqpage/newtabpage.h
index 973028b3..cdc3cb31 100644
--- a/src/rekonqpage/newtabpage.h
+++ b/src/rekonqpage/newtabpage.h
@@ -53,7 +53,7 @@ public:
* about: url and loads the corresponding part of the
* new tab page
*/
- void generate(const KUrl &url = KUrl("about:home"));
+ void generate(KUrl url = KUrl("about:home"));
protected slots:
void snapFinished();
@@ -97,6 +97,8 @@ private:
QString m_html;
QWebElement m_root;
+
+ KUrl m_url;
};
#endif // REKONQ_NEW_TAB_PAGE