From d8e83f65ee738a56ffc0703f065e8c74f08697e7 Mon Sep 17 00:00:00 2001
From: Benjamin C Meyer <ben@meyerhome.net>
Date: Sun, 6 Feb 2011 16:52:01 -0500
Subject: [PATCH 06/23] Autofill manager was always storing forms.

exec() only returns the correct value when the standard buttons are
used.  Change to use the messagebox.buttonRole to determine what button
was pressed.

Issue: 912
---
 src/autofillmanager.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git src/autofillmanager.cpp src/autofillmanager.cpp
index 8c4891d..b4c713e 100644
--- src/autofillmanager.cpp
+++ src/autofillmanager.cpp
@@ -201,7 +201,8 @@ void AutoFillManager::post(const QNetworkRequest &request, const QByteArray &out
         messageBox.addButton(tr("Not now"), QMessageBox::RejectRole);
         messageBox.addButton(QMessageBox::Yes);
         messageBox.setDefaultButton(QMessageBox::Yes);
-        switch (messageBox.exec()) {
+        messageBox.exec();
+        switch (messageBox.buttonRole(messageBox.clickedButton())) {
         case QMessageBox::DestructiveRole:
             m_never.append(url);
             return;
-- 
2.44.0

