From 7f2ed90b03d28dca82fb38ceb43a2866d0d19a69 Mon Sep 17 00:00:00 2001 From: matgic78 Date: Thu, 1 Apr 2010 19:35:00 +0200 Subject: Previews are now always completely removed when clicking the x --- src/newtabpage.cpp | 30 +++++++----------------------- 1 file 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(); } -- cgit v1.2.1