schedulator: only count bugs that you were the *last* one to resolve, but
[wvapps.git] / evolution / exchangeitaccount.cc
bloba39318b17e75f8864727f5dad6b60dedd5a09fb6
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * Author :
4 * JP Rosevear <jpr@ximian.com>
6 * Copyright 2003, Novell, Inc.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 * USA
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
27 #include <stdlib.h>
28 #include <string.h>
30 #include "exchangeitaccount.h"
32 #define EXCHANGEIT_GCONF_SERVER "/apps/evolution-exchangeit/account_server"
33 #define EXCHANGEIT_GCONF_USER "/apps/evolution-exchangeit/account_user"
34 #define EXCHANGEIT_GCONF_PASSWORD "/apps/evolution-exchangeit/account_password"
36 ExchangeItAccount::ExchangeItAccount(WvStringParm _server,
37 WvStringParm _user,
38 WvStringParm _password) :
39 server(_server),
40 user(_user),
41 password(_password)
45 ExchangeItAccount::ExchangeItAccount(GConfClient *gconf)
47 WvString server_value = gconf_client_get_string(gconf,
48 EXCHANGEIT_GCONF_SERVER,
49 NULL);
50 WvString user_value = gconf_client_get_string(gconf,
51 EXCHANGEIT_GCONF_USER,
52 NULL);
54 WvString password_value = gconf_client_get_string(gconf,
55 EXCHANGEIT_GCONF_PASSWORD,
56 NULL);
58 // FIXME: There HAS to be a better way of doing this...
59 // are the accessors used anywhere else.. if not, then why use
60 // them here... especially since wherever else they are being used
61 // they need to be validated... do they not?
63 if (!!server_value && !!user_value && !!password_value)
65 set_server(server_value);
66 set_user(user_value);
67 set_password(password_value);
71 void ExchangeItAccount::save(GConfClient *gconf)
73 // Since it is possible to get here without having a value in server,
74 // user and/or password, probably some sort of check and an error return
75 // would be usefull here.
76 gconf_client_set_string (gconf, EXCHANGEIT_GCONF_SERVER,
77 server.cstr(), NULL);
79 gconf_client_set_string (gconf, EXCHANGEIT_GCONF_USER,
80 user.cstr(), NULL);
82 gconf_client_set_string (gconf, EXCHANGEIT_GCONF_PASSWORD,
83 password.cstr(), NULL);