diff options
Diffstat (limited to 'src/urlbar/bookmarkwidget.cpp')
-rw-r--r-- | src/urlbar/bookmarkwidget.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/urlbar/bookmarkwidget.cpp b/src/urlbar/bookmarkwidget.cpp index 3380ec57..bcf85e1f 100644 --- a/src/urlbar/bookmarkwidget.cpp +++ b/src/urlbar/bookmarkwidget.cpp @@ -31,6 +31,7 @@ // Local includes #include "application.h" #include "bookmarksmanager.h" +#include "bookmarkowner.h" // KDE Includes #include <KLocalizedString> @@ -57,12 +58,12 @@ BookmarkWidget::BookmarkWidget(const KBookmark &bookmark, QWidget *parent) setLayout(layout); QHBoxLayout *hLayout = new QHBoxLayout(); - + QLabel *bookmarkIcon = new QLabel(this); bookmarkIcon->setPixmap(KIcon("bookmarks").pixmap(32, 32)); hLayout->addWidget(bookmarkIcon); hLayout->setSpacing(10); - + QVBoxLayout *vLayout = new QVBoxLayout(); QLabel *bookmarkInfo = new QLabel(this); @@ -70,13 +71,13 @@ BookmarkWidget::BookmarkWidget(const KBookmark &bookmark, QWidget *parent) QFont font; font.setPointSize(font.pointSize() + 2); bookmarkInfo->setFont(font); - + vLayout->addWidget(bookmarkInfo); QPushButton *removeButton = new QPushButton(this); removeButton->setText(i18n("Remove this Bookmark")); connect(removeButton, SIGNAL(clicked()), this, SLOT(removeBookmark())); - + vLayout->addWidget(removeButton); hLayout->addLayout(vLayout); layout->addItem(hLayout); @@ -152,21 +153,6 @@ void BookmarkWidget::showAt(const QPoint &pos) void BookmarkWidget::removeBookmark() { - bool folder = m_bookmark.isGroup(); - - if (KMessageBox::warningContinueCancel( - QApplication::activeWindow(), - folder ? i18n("Are you sure you wish to remove the bookmark folder\n\"%1\"?", m_bookmark.text()) - : i18n("Are you sure you wish to remove the bookmark\n\"%1\"?", m_bookmark.text()), - folder ? i18n("Bookmark Folder Deletion") - : i18n("Bookmark Deletion"), - KStandardGuiItem::del()) - == KMessageBox::Continue - ) - { - m_bookmark.parentGroup().deleteBookmark(m_bookmark); - Application::bookmarkProvider()->bookmarkManager()->emitChanged(); - } - + Application::bookmarkProvider()->bookmarkOwner()->deleteBookmark(m_bookmark); reject(); } |