summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatgic78 <matgic78@gmail.com>2010-04-01 19:35:00 +0200
committermatgic78 <matgic78@gmail.com>2010-04-01 19:35:00 +0200
commit7f2ed90b03d28dca82fb38ceb43a2866d0d19a69 (patch)
tree4ab6469fae3e46bab155871f99bdc4d99a963a34
parentFix detail after rebase (diff)
downloadrekonq-7f2ed90b03d28dca82fb38ceb43a2866d0d19a69.tar.xz
Previews are now always completely removed when clicking the x
-rw-r--r--src/newtabpage.cpp30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp
index 98377d8a..3e21d0fe 100644
--- a/src/newtabpage.cpp
+++ b/src/newtabpage.cpp
@@ -300,30 +300,14 @@ void NewTabPage::removePreview(int index)
QStringList names = ReKonfig::previewNames();
QStringList urls = ReKonfig::previewUrls();
- if(urls.at(index) == "")
- {
- urls.removeAt(index);
- names.removeAt(index);
-
- // modify config before
- ReKonfig::setPreviewNames(names);
- ReKonfig::setPreviewUrls(urls);
-
- // reload to update index
- generate(KUrl("about:favorites"));
- }
- else
- {
- urls.replace(index, QString(""));
- names.replace(index, QString(""));
-
- QWebElement prev = m_root.findFirst("#preview" + QVariant(index).toString());
- prev.replace(emptyPreview(index));
-
- ReKonfig::setPreviewNames(names);
- ReKonfig::setPreviewUrls(urls);
- }
+ urls.removeAt(index);
+ names.removeAt(index);
+
+ ReKonfig::setPreviewNames(names);
+ ReKonfig::setPreviewUrls(urls);
+ generate(KUrl("about:favorites"));
+
ReKonfig::self()->writeConfig();
}