Mercurial > pidgin.yaz
annotate src/core.c @ 13982:052aee037835
[gaim-migrate @ 16550]
Only set an account's status to the default status when
enabling it, not when disabling it. Fixes a very minor
weirdness.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 23 Jul 2006 18:58:59 +0000 |
parents | 2d6f7ac4b6f2 |
children | 8bda65b88e49 |
rev | line source |
---|---|
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
1 /** |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
2 * @file core.c Gaim Core API |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
3 * @ingroup core |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
4 * |
2416 | 5 * gaim |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
2416 | 10 * |
11 * This program is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
25 #include "internal.h" |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10504
diff
changeset
|
26 #include "cipher.h" |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
27 #include "connection.h" |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
28 #include "conversation.h" |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
29 #include "core.h" |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
30 #include "debug.h" |
11281
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
31 #include "ft.h" |
12272 | 32 #include "idle.h" |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
33 #include "network.h" |
12129
216988c717da
[gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents:
12080
diff
changeset
|
34 #include "notify.h" |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
35 #include "plugin.h" |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
36 #include "pounce.h" |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
37 #include "prefs.h" |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6266
diff
changeset
|
38 #include "privacy.h" |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
39 #include "proxy.h" |
10418 | 40 #include "savedstatuses.h" |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
41 #include "signals.h" |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6612
diff
changeset
|
42 #include "sslconn.h" |
9944 | 43 #include "status.h" |
11424 | 44 #include "stun.h" |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
45 #include "sound.h" |
2416 | 46 |
11171 | 47 #ifdef HAVE_DBUS |
48 # include "dbus-server.h" | |
49 #endif | |
50 | |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
51 struct GaimCore |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
52 { |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
53 char *ui; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
54 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
55 void *reserved; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
56 }; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
57 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
58 static GaimCoreUiOps *_ops = NULL; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
59 static GaimCore *_core = NULL; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
60 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
61 STATIC_PROTO_INIT |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
62 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
63 gboolean |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
64 gaim_core_init(const char *ui) |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
65 { |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
66 GaimCoreUiOps *ops; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
67 GaimCore *core; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
68 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
69 g_return_val_if_fail(ui != NULL, FALSE); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
70 g_return_val_if_fail(gaim_get_core() == NULL, FALSE); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
71 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
72 _core = core = g_new0(GaimCore, 1); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
73 core->ui = g_strdup(ui); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
74 core->reserved = NULL; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
75 |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6846
diff
changeset
|
76 ops = gaim_core_get_ui_ops(); |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
77 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
78 /* The signals subsystem is important and should be first. */ |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
79 gaim_signals_init(); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
80 |
6564
800ef4a51096
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
81 gaim_signal_register(core, "quitting", gaim_marshal_VOID, NULL, 0); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
82 |
10087 | 83 /* The prefs subsystem needs to be initialized before static protocols |
84 * for protocol prefs to work. */ | |
85 gaim_prefs_init(); | |
86 | |
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
87 gaim_debug_init(); |
10448 | 88 |
9944 | 89 if (ops != NULL) |
90 { | |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
91 if (ops->ui_prefs_init != NULL) |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
92 ops->ui_prefs_init(); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
93 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
94 if (ops->debug_ui_init != NULL) |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
95 ops->debug_ui_init(); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
96 } |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
97 |
11171 | 98 #ifdef HAVE_DBUS |
99 gaim_dbus_init(); | |
100 #endif | |
101 | |
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
102 /* Initialize all static protocols. */ |
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
103 static_proto_init(); |
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
104 |
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
105 /* Since plugins get probed so early we should probably initialize their |
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
106 * subsystem right away too. |
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
107 */ |
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
108 gaim_plugins_init(); |
12066 | 109 gaim_plugins_probe(G_MODULE_SUFFIX); |
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
110 |
13480
ff06120eaf1e
[gaim-migrate @ 15856]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13293
diff
changeset
|
111 /* Accounts use status and buddy icons, so initialize these before accounts */ |
10418 | 112 gaim_status_init(); |
13480
ff06120eaf1e
[gaim-migrate @ 15856]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13293
diff
changeset
|
113 gaim_buddy_icons_init(); |
ff06120eaf1e
[gaim-migrate @ 15856]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13293
diff
changeset
|
114 |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
115 gaim_accounts_init(); |
12080 | 116 gaim_savedstatuses_init(); |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10504
diff
changeset
|
117 gaim_ciphers_init(); |
12129
216988c717da
[gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents:
12080
diff
changeset
|
118 gaim_notify_init(); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
119 gaim_connections_init(); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
120 gaim_conversations_init(); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
121 gaim_blist_init(); |
7431 | 122 gaim_log_init(); |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
123 gaim_network_init(); |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6266
diff
changeset
|
124 gaim_privacy_init(); |
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6266
diff
changeset
|
125 gaim_pounces_init(); |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
126 gaim_proxy_init(); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
127 gaim_sound_init(); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6612
diff
changeset
|
128 gaim_ssl_init(); |
11424 | 129 gaim_stun_init(); |
11281
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
130 gaim_xfers_init(); |
12272 | 131 gaim_idle_init(); |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
132 |
13180
bce53c3536da
[gaim-migrate @ 15543]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
13129
diff
changeset
|
133 /* Call this early on to try to auto-detect our IP address */ |
bce53c3536da
[gaim-migrate @ 15543]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
13129
diff
changeset
|
134 gaim_network_get_my_ip(-1); |
bce53c3536da
[gaim-migrate @ 15543]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
13129
diff
changeset
|
135 |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
136 if (ops != NULL && ops->ui_init != NULL) |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
137 ops->ui_init(); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
138 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
139 return TRUE; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
140 } |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
141 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
142 void |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
143 gaim_core_quit(void) |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
144 { |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
145 GaimCoreUiOps *ops; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
146 GaimCore *core = gaim_get_core(); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
147 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
148 g_return_if_fail(core != NULL); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
149 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
150 /* The self destruct sequence has been initiated */ |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
151 gaim_signal_emit(gaim_get_core(), "quitting"); |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
152 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
153 /* Transmission ends */ |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
154 gaim_connections_disconnect_all(); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
155 |
8235 | 156 /* Save .xml files, remove signals, etc. */ |
12272 | 157 gaim_idle_uninit(); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6612
diff
changeset
|
158 gaim_ssl_uninit(); |
6837
f098765ac919
[gaim-migrate @ 7382]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
159 gaim_pounces_uninit(); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
160 gaim_blist_uninit(); |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10504
diff
changeset
|
161 gaim_ciphers_uninit(); |
12129
216988c717da
[gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents:
12080
diff
changeset
|
162 gaim_notify_uninit(); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
163 gaim_conversations_uninit(); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
164 gaim_connections_uninit(); |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
165 gaim_buddy_icons_uninit(); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
166 gaim_accounts_uninit(); |
10418 | 167 gaim_savedstatuses_uninit(); |
168 gaim_status_uninit(); | |
8235 | 169 gaim_prefs_uninit(); |
11281
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
170 gaim_xfers_uninit(); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
171 |
10448 | 172 gaim_debug_info("main", "Unloading all plugins\n"); |
9649 | 173 gaim_plugins_destroy_all(); |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
174 |
9649 | 175 ops = gaim_core_get_ui_ops(); |
176 if (ops != NULL && ops->quit != NULL) | |
177 ops->quit(); | |
178 | |
11464 | 179 /* |
180 * gaim_sound_uninit() should be called as close to | |
181 * shutdown as possible. This is because the call | |
182 * to ao_shutdown() can sometimes leave our | |
183 * environment variables in an unusable state, which | |
184 * can cause a crash when getenv is called (by gettext | |
185 * for example). See the complete bug report at | |
186 * http://trac.xiph.org/cgi-bin/trac.cgi/ticket/701 | |
187 * | |
188 * TODO: Eventually move this call higher up with the others. | |
189 */ | |
190 gaim_sound_uninit(); | |
191 | |
10479 | 192 gaim_plugins_uninit(); |
9649 | 193 gaim_signals_uninit(); |
9633 | 194 |
13955 | 195 #ifdef HAVE_DBUS |
196 gaim_dbus_uninit(); | |
197 #endif | |
198 | |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
199 if (core->ui != NULL) { |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
200 g_free(core->ui); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
201 core->ui = NULL; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
202 } |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
203 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
204 g_free(core); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
205 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
206 _core = NULL; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
207 } |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
208 |
7646 | 209 gboolean |
210 gaim_core_quit_cb(gpointer unused) | |
211 { | |
212 gaim_core_quit(); | |
213 | |
214 return FALSE; | |
215 } | |
216 | |
6612
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6564
diff
changeset
|
217 const char * |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6564
diff
changeset
|
218 gaim_core_get_version(void) |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6564
diff
changeset
|
219 { |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6564
diff
changeset
|
220 return VERSION; |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6564
diff
changeset
|
221 } |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6564
diff
changeset
|
222 |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
223 const char * |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
224 gaim_core_get_ui(void) |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
225 { |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
226 GaimCore *core = gaim_get_core(); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
227 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
228 g_return_val_if_fail(core != NULL, NULL); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
229 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
230 return core->ui; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
231 } |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
232 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
233 GaimCore * |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
234 gaim_get_core(void) |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
235 { |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
236 return _core; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
237 } |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
238 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
239 void |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6846
diff
changeset
|
240 gaim_core_set_ui_ops(GaimCoreUiOps *ops) |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
241 { |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
242 _ops = ops; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
243 } |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
244 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
245 GaimCoreUiOps * |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6846
diff
changeset
|
246 gaim_core_get_ui_ops(void) |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
247 { |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
248 return _ops; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6168
diff
changeset
|
249 } |