From 7f12bb5dfbe0d99d258082d87707e373fd16320d Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 27 Jun 2010 16:35:19 +0000 Subject: [PATCH] Ask for confirmation before clearing search history (closes #598605) --- src/searchengine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/searchengine.cpp b/src/searchengine.cpp index 58b697daf..157a241be 100644 --- a/src/searchengine.cpp +++ b/src/searchengine.cpp @@ -221,7 +221,11 @@ void SearchEngine::displayPatternContextMenu(QPoint) { QAction *act = myMenu.exec(QCursor::pos()); if(act != 0) { if(act == &clearHistoryAct) { - searchHistory.setStringList(QStringList()); + // Ask for confirmation + if(QMessageBox::question(this, tr("Confirmation"), tr("Are you sure you want to clear the history?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) { + // Clear history + searchHistory.setStringList(QStringList()); + } } else if (act == &pasteAct) { search_pattern->paste();