[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/qca/examples
From:       Justin Karneges <infiniti () affinix ! com>
Date:       2009-04-24 17:59:20
Message-ID: 1240595960.657273.28918.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 958799 by infiniti:

set a good example, by making sure QCA::Initializer is always before 
qapp


 M  +3 -5      aes-cmac/aes-cmac.cpp  
 M  +2 -2      ciphertest/ciphertest.cpp  
 M  +2 -2      eventhandlerdemo/eventhandlerdemo.cpp  
 M  +2 -2      hextest/hextest.cpp  
 M  +4 -4      mactest/mactest.cpp  
 M  +4 -4      randomtest/randomtest.cpp  


--- trunk/kdesupport/qca/examples/aes-cmac/aes-cmac.cpp #958798:958799
@@ -243,16 +243,14 @@
 
 int main(int argc, char **argv)
 {
-    QCoreApplication app(argc, argv);
-
-    qDebug() << "This example shows AES CMAC";
-
     // the Initializer object sets things up, and
     // also does cleanup when it goes out of scope
     QCA::Initializer init;
 
-    qDebug() << "Completed initialisation";
+    qDebug() << "This example shows AES CMAC";
 
+    QCoreApplication app(argc, argv);
+
     if( ! QCA::isSupported("aes128-ecb") ) {
 	qDebug() << "AES not supported!";
     }
--- trunk/kdesupport/qca/examples/ciphertest/ciphertest.cpp #958798:958799
@@ -28,12 +28,12 @@
 
 int main(int argc, char **argv)
 {
-    QCoreApplication app(argc, argv);
-
     // the Initializer object sets things up, and
     // also does cleanup when it goes out of scope
     QCA::Initializer init;
 
+    QCoreApplication app(argc, argv);
+
     // we use the first argument if provided, or
     // use "hello" if no arguments
     QCA::SecureArray arg = (argc >= 2) ? argv[1] : "hello";
--- trunk/kdesupport/qca/examples/eventhandlerdemo/eventhandlerdemo.cpp #958798:958799
@@ -116,12 +116,12 @@
 
 int main(int argc, char **argv)
 {
-    QCoreApplication exampleApp(argc, argv);
-
     // the Initializer object sets things up, and
     // also does cleanup when it goes out of scope
     QCA::Initializer init;
 
+    QCoreApplication exampleApp(argc, argv);
+
     ClientPassphraseHandler cph;
 
     // handler and asker cannot occur in the same thread
--- trunk/kdesupport/qca/examples/hextest/hextest.cpp #958798:958799
@@ -28,12 +28,12 @@
 
 int main(int argc, char **argv)
 {
-	QCoreApplication app(argc, argv);
-
 	// the Initializer object sets things up, and
 	// also does cleanup when it goes out of scope
 	QCA::Initializer init;
 
+	QCoreApplication app(argc, argv);
+
 	// we use the first argument as the data to encode / decode
 	// if an argument is provided. Use "hello" if no argument
 	QByteArray arg; // empty array
--- trunk/kdesupport/qca/examples/mactest/mactest.cpp #958798:958799
@@ -30,14 +30,14 @@
 
 int main(int argc, char **argv)
 {
+	// the Initializer object sets things up, and
+	// also does cleanup when it goes out of scope
+	QCA::Initializer init;
+
 	QCoreApplication app(argc, argv);
 
 	qDebug() << "This example shows hashed MAC";
 
-	// the Initializer object sets things up, and
-	// also does cleanup when it goes out of scope
-	QCA::Initializer init;
-
 	// we use the first argument as the data to authenticate
 	// if an argument is provided. Use "hello" if no argument
 	QByteArray arg = (argc >= 2) ? argv[1] : "hello";
--- trunk/kdesupport/qca/examples/randomtest/randomtest.cpp #958798:958799
@@ -29,14 +29,14 @@
 
 int main(int argc, char **argv)
 {
+	// the Initializer object sets things up, and
+	// also does cleanup when it goes out of scope
+	QCA::Initializer init;
+
 	QCoreApplication app(argc, argv);
 
 	qDebug() << "This example generates random numbers";
 
-	// the Initializer object sets things up, and
-	// also does cleanup when it goes out of scope
-	QCA::Initializer init;
-
 	int randInt;
 	// This is the standard way to generate a random integer.
 	randInt = QCA::Random::randomInt();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic