Branch 'formatchecker' - utils/kolabformatchecker.cpp

Sofia Balicka balicka at kolabsys.com
Mon Dec 3 16:25:56 CET 2012


 utils/kolabformatchecker.cpp |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

New commits:
commit 4c4f5f2cd1c47a971e030b0426d9c3425a1011e2
Author: Sofia Balicka <balicka at kolabsys.com>
Date:   Mon Dec 3 16:24:08 2012 +0100

    Improved error handling

diff --git a/utils/kolabformatchecker.cpp b/utils/kolabformatchecker.cpp
index b28c4a0..cfca944 100644
--- a/utils/kolabformatchecker.cpp
+++ b/utils/kolabformatchecker.cpp
@@ -3,14 +3,13 @@
 #include <string>
 #include <vector>
 #include <kolabformat.h>
+#include "kolabformat/errorhandler.h"
 #include "tests/testutils.h"
 #include "kolabformat/kolabobject.h"
-#include "kolabformat/errorhandler.h"
 #include "qstring.h"
 
 namespace po = boost::program_options;
 using namespace std;
-using namespace Kolab;
 
 int main(int argc, char *argv[])
 {
@@ -42,8 +41,6 @@ int main(int argc, char *argv[])
         return -1;
     }
 	
-	ErrorHandler::handleLibkolabxmlErrors();
-
 	int returnValue = 0;
 
 	cout << endl;
@@ -51,8 +48,6 @@ int main(int argc, char *argv[])
 	for(vector<string>::const_iterator it = inputFiles.begin();
             it != inputFiles.end(); it++){
 
-		ErrorHandler::clearErrors();
-
 		cout << "File: " << *it << endl;
 
 		bool ok;
@@ -65,11 +60,8 @@ int main(int argc, char *argv[])
 		}
 
 		Kolab::KolabObjectReader reader(message);
-	
-		if (error()){
-			cout << "Error: " << errorMessage() << endl;
-			returnValue = -1;
-		} else if (ErrorHandler::errorOccured()){
+
+		if (Kolab::ErrorHandler::errorOccured()){
 			cout << "Errors occured during parsing." << endl;
 			returnValue = -1;
 		} else {





More information about the commits mailing list