From 7c6da307058648a7f3aaaaa26c3a288d630805a1 Mon Sep 17 00:00:00 2001 From: ngosang Date: Tue, 4 Aug 2015 01:41:34 +0200 Subject: [PATCH] [RSS] More precise message and code simplification in RSS feeds deletion --- src/gui/rss/rss_imp.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/gui/rss/rss_imp.cpp b/src/gui/rss/rss_imp.cpp index 78ddda16a..371cc1a97 100644 --- a/src/gui/rss/rss_imp.cpp +++ b/src/gui/rss/rss_imp.cpp @@ -249,21 +249,13 @@ void RSSImp::deleteSelectedItems() QList selectedItems = m_feedList->selectedItems(); if (selectedItems.isEmpty()) return; + if ((selectedItems.size() == 1) && (selectedItems.first() == m_feedList->stickyUnreadItem())) + return; - int ret; - if (selectedItems.size() > 1) { - ret = QMessageBox::question(this, tr("Are you sure? -- qBittorrent"), tr("Are you sure you want to delete these elements from the list?"), - tr("&Yes"), tr("&No"), - QString(), 0, 1); - } - else { - if (selectedItems.first() == m_feedList->stickyUnreadItem()) - return; - ret = QMessageBox::question(this, tr("Are you sure? -- qBittorrent"), tr("Are you sure you want to delete this element from the list?"), - tr("&Yes"), tr("&No"), - QString(), 0, 1); - } - if (ret) + QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Deletion confirmation"), + tr("Are you sure you want to delete the selected RSS feeds?"), + QMessageBox::Yes|QMessageBox::No, QMessageBox::No); + if (answer == QMessageBox::No) return; foreach (QTreeWidgetItem* item, selectedItems) {