Cpp: Use whitelist for status messages
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 1 Jun 2016 11:46:27 +0000 (13:46 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 1 Jun 2016 11:48:28 +0000 (13:48 +0200)
* lang/cpp/src/editinteractor.cpp (EditInteractor::needsNoResponse):
Use whitelist instead of blacklist.

--
This should be more robust when new status messages are added.
The whitelist is the same GPA uses. Fixes Qt's t-ownertrust.

lang/cpp/src/editinteractor.cpp

index fb68bcb..d2633b5 100644 (file)
@@ -201,20 +201,16 @@ Error EditInteractor::lastError() const
 bool EditInteractor::needsNoResponse(unsigned int status) const
 {
     switch (status) {
-    case GPGME_STATUS_EOF:
-    case GPGME_STATUS_GOT_IT:
-    case GPGME_STATUS_NEED_PASSPHRASE:
+    case GPGME_STATUS_ALREADY_SIGNED:
+    case GPGME_STATUS_ERROR:
+    case GPGME_STATUS_GET_BOOL:
+    case GPGME_STATUS_GET_LINE:
+    case GPGME_STATUS_KEY_CREATED:
     case GPGME_STATUS_NEED_PASSPHRASE_SYM:
-    case GPGME_STATUS_GOOD_PASSPHRASE:
-    case GPGME_STATUS_BAD_PASSPHRASE:
-    case GPGME_STATUS_USERID_HINT:
-    case GPGME_STATUS_SIGEXPIRED:
-    case GPGME_STATUS_KEYEXPIRED:
-    case GPGME_STATUS_PINENTRY_LAUNCHED:
-    case GPGME_STATUS_KEY_CONSIDERED:
-        return true;
-    default:
+    case GPGME_STATUS_SC_OP_FAILURE:
         return false;
+    default:
+        return true;
     }
 }