Fixed bug #47
[centerim.git] / src / centermain.cc
blob6e4625f433ad58dc111a578ef87669eadef58659
1 /*
3 * centerim main() function
4 * $Id: centermain.cc,v 1.16 2002/07/07 22:58:18 konst Exp $
6 * Copyright (C) 2001 by Konstantin Klyagin <k@thekonst.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
25 #include "centerim.h"
26 #include "icqface.h"
27 #include "icqconf.h"
28 #include "icqcontacts.h"
29 #include "icqmlist.h"
30 #include "icqgroups.h"
32 #ifdef HAVE_LIBOTR
33 #include "imotr.h"
34 #endif
36 centerim cicq;
37 icqconf conf;
38 icqcontacts clist;
39 icqface face;
40 icqlist lst;
41 icqgroups groups;
43 #ifdef ENABLE_NLS
45 #include <locale.h>
46 #include <libintl.h>
48 #endif
50 int main(int argc, char **argv) {
51 char savedir[1024];
53 getcwd(savedir, 1024);
55 try {
56 srand((unsigned int) time(NULL));
58 #ifdef ENABLE_NLS
59 setlocale(LC_ALL, "");
60 bindtextdomain(PACKAGE, LOCALEDIR);
61 textdomain(PACKAGE);
62 #endif
64 conf.commandline(argc, argv);
65 #ifdef HAVE_LIBOTR
66 otr.init();
67 #endif
69 cicq.exec();
71 } catch(exception e) {
72 cerr << "Caught exception: " << e.what() << endl;
75 chdir(savedir);