Permalink
Browse files

Added fix for issue noticed by Mark Sohm.

  • Loading branch information...
1 parent 34c8792 commit f65ff0c2db58ac095ad56f172534942c58253239 Rob Williams committed Oct 15, 2013
Showing with 11 additions and 2 deletions.
  1. +11 −2 AESCryptoDemo/src/applicationui.cpp
@@ -42,8 +42,17 @@ ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
_plainText = settings.value("plainText",
QString::fromUtf8(montreal, strlen(montreal))).toString();
- _key = settings.value("key", generate()).toString();
- _iv = settings.value("iv", generate()).toString();
+
+ // bugfix - initial values were being ignored...
+ if (!settings.contains("key")) {
+ settings.setValue("key",generate());
+ }
+ if (!settings.contains("iv")) {
+ settings.setValue("iv",generate());
+ }
+ _key = settings.value("key").toString();
+ _iv = settings.value("iv").toString();
+
_cipherText = settings.value("cipherText", "").toString();
_recoveredPlainText = settings.value("recoveredPlainText", "").toString();

0 comments on commit f65ff0c

Please sign in to comment.