main_qt.cpp

Go to the documentation of this file.
00001 #include "client-run.h"
00002 #include "er_errors.h"
00003 #include "kr_controller.h"
00004 
00005 #include <QtCore/QCoreApplication>
00006 #include <QtGlobal>
00007 
00008 int main(int argc, char *argv[])
00009 {
00010   QCoreApplication app(argc, argv);
00011 
00012   int errCode = cl2GlobalInit();
00013   if (errCode) {
00014     logt("global init failed");
00015     return 1;
00016   }
00017 
00018   logg("compiled against Qt %s", QT_VERSION_STR);
00019   logg("running with Qt %s", qVersion());
00020   
00021   GError* localError = NULL;
00022   kr_Controller* controller = kr_Controller_new(&localError);
00023   if (!controller) {
00024     logt("controller init failed");
00025     gx_txtlog_error_free(localError);
00026     return 2;
00027   }
00028 
00029   if (!kr_Controller_start(controller, &localError)) {
00030     logt("controller start failed");
00031     gx_txtlog_error_free(localError);
00032     return 3;
00033   }
00034 
00035   return app.exec();
00036 }
00037 
00038 /**
00039 
00040 Copyright 2010 Helsinki Institute for Information Technology (HIIT)
00041 and the authors. All rights reserved.
00042 
00043 Authors: Tero Hasu <tero.hasu@hut.fi>
00044 
00045 Permission is hereby granted, free of charge, to any person
00046 obtaining a copy of this software and associated documentation files
00047 (the "Software"), to deal in the Software without restriction,
00048 including without limitation the rights to use, copy, modify, merge,
00049 publish, distribute, sublicense, and/or sell copies of the Software,
00050 and to permit persons to whom the Software is furnished to do so,
00051 subject to the following conditions:
00052 
00053 The above copyright notice and this permission notice shall be
00054 included in all copies or substantial portions of the Software.
00055 
00056 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00057 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00058 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00059 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00060 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00061 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00062 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00063 SOFTWARE.
00064 
00065  **/

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:55 2011 by Doxygen 1.6.1