summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/newtabpage.cpp34
-rw-r--r--src/rekonq.kcfg4
2 files changed, 22 insertions, 16 deletions
diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp
index 043648e7..d7671937 100644
--- a/src/newtabpage.cpp
+++ b/src/newtabpage.cpp
@@ -283,20 +283,9 @@ void NewTabPage::setupPreview(QWebElement e, int index)
void NewTabPage::snapFinished(int index, const KUrl &url, const QString &title)
{
- // do not try to modify the page if it isn't the newTabPage
- if(m_root.document().findAll("#rekonq-newtabpage").count() == 0)
- return;
-
- QWebElement prev = m_root.findFirst("#preview" + QVariant(index).toString());
- QWebElement newPrev = validPreview(index, url, title);
-
- if(m_root.findAll(".closedTabs").count() != 0)
- hideControls(newPrev);
-
- prev.replace(newPrev);
-
- // update title
- if(m_root.findAll(".favorites").count() != 0)
+ // Update title if necessary
+ QStringList urls = ReKonfig::previewUrls();
+ if(KUrl(urls.at(index)) == url)
{
QStringList names = ReKonfig::previewNames();
names.replace(index, title);
@@ -304,6 +293,23 @@ void NewTabPage::snapFinished(int index, const KUrl &url, const QString &title)
ReKonfig::self()->writeConfig();
}
+
+ // Update page, but only if open
+ if(m_root.document().findAll("#rekonq-newtabpage").count() == 0)
+ return;
+ if(m_root.findAll(".favorites").count() == 0 && m_root.findAll(".closedTabs").count() == 0)
+ return;
+
+ QWebElement prev = m_root.findFirst("#preview" + QVariant(index).toString());
+ if(KUrl(prev.findFirst("a").attribute("href")) == url)
+ {
+ QWebElement newPrev = validPreview(index, url, title);
+
+ if(m_root.findAll(".closedTabs").count() != 0)
+ hideControls(newPrev);
+
+ prev.replace(newPrev);
+ }
}
diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg
index ea09acbc..c999d063 100644
--- a/src/rekonq.kcfg
+++ b/src/rekonq.kcfg
@@ -34,10 +34,10 @@
<!-- New Tab Page Settings -->
<group name="NewTabPage">
<entry name="previewNames" type="StringList">
- <default>KDE Homepage,UserBase,,,,,,</default>
+ <default>KDE Homepage,UserBase,rekonq site</default>
</entry>
<entry name="previewUrls" type="StringList">
- <default>http://www.kde.org,http://userbase.kde.org,,,,,,</default>
+ <default>http://www.kde.org,http://userbase.kde.org,http://rekonq.sourceforge.net</default>
</entry>
</group>