Thu, 23 Jul 2020 20:13:47 -0500
phase2 of pidgin.h: move existing file to pidgincore.h
Rename pidgin.h to pidgincore.h and update everything accordingly.
Testing Done:
Compile test only.
Reviewed at https://reviews.imfreedom.org/r/43/
| 10302 | 1 | /* |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
2 | * pidgin |
| 10302 | 3 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
4 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 10302 | 5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 6 | * source distribution. | |
| 7 | * | |
| 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 | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19840
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 10302 | 21 | * |
| 22 | */ | |
| 23 | ||
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
24 | #ifdef HAVE_CONFIG_H |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
25 | # include <config.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
26 | #endif |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
27 | |
|
40462
24ed25d87550
Fix some issues on macos that resulted from the internal.h cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
28 | #include <errno.h> |
|
24ed25d87550
Fix some issues on macos that resulted from the internal.h cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
29 | |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
30 | #include <glib/gi18n-lib.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
31 | #include <glib/gstdio.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
32 | |
|
39372
43e3da39daf6
Include 'locale.h' directly in files which use setlocale()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39365
diff
changeset
|
33 | #include <locale.h> |
| 10302 | 34 | |
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40337
diff
changeset
|
35 | #include <purple.h> |
| 10302 | 36 | |
| 37 | #include "gtkaccount.h" | |
| 38 | #include "gtkblist.h" | |
| 39 | #include "gtkconn.h" | |
| 40 | #include "gtkconv.h" | |
| 41 | #include "gtkdialogs.h" | |
|
34910
60502558e400
Replacements for the GObject Xfer API
Ankit Vani <a@nevitus.org>
parents:
34892
diff
changeset
|
42 | #include "gtkxfer.h" |
|
11907
de3ea77afe3c
[gaim-migrate @ 14198]
Evan Schoenberg <evands@pidgin.im>
parents:
11906
diff
changeset
|
43 | #include "gtkidle.h" |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
24585
diff
changeset
|
44 | #include "gtkmedia.h" |
| 10302 | 45 | #include "gtknotify.h" |
| 46 | #include "gtkpounce.h" | |
| 47 | #include "gtkprefs.h" | |
| 48 | #include "gtkprivacy.h" | |
| 49 | #include "gtkrequest.h" | |
| 50 | #include "gtkroomlist.h" | |
|
10574
5abb2931b6ff
[gaim-migrate @ 11966]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10448
diff
changeset
|
51 | #include "gtksavedstatuses.h" |
|
35704
aa22dcef8913
Initial PidginSmileyTheme implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35605
diff
changeset
|
52 | #include "gtksmiley-theme.h" |
| 10302 | 53 | #include "gtksound.h" |
| 54 | #include "gtkutils.h" | |
|
11475
1e222e6e52a0
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11403
diff
changeset
|
55 | #include "gtkwhiteboard.h" |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40462
diff
changeset
|
56 | #include "pidgincore.h" |
|
39152
37144ff35a91
Rename gtkdebug -> pidgindebug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39036
diff
changeset
|
57 | #include "pidgindebug.h" |
|
39603
98fd85e156e0
Rename gtklog -> pidginlog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39574
diff
changeset
|
58 | #include "pidginlog.h" |
|
40222
40f2888f85c1
delete gtkplugin.[ch] and deal with the repercussions
Gary Kramlich <grim@reaperworld.com>
parents:
40203
diff
changeset
|
59 | #include "pidginplugininfo.h" |
|
40f2888f85c1
delete gtkplugin.[ch] and deal with the repercussions
Gary Kramlich <grim@reaperworld.com>
parents:
40203
diff
changeset
|
60 | #include "pidginstock.h" |
| 10302 | 61 | |
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
62 | #ifndef _WIN32 |
|
38047
312be70f9de6
Remove AC_HEADER_STDC and related C89 tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37998
diff
changeset
|
63 | #include <signal.h> |
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
64 | #endif |
| 10302 | 65 | |
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
66 | #ifndef _WIN32 |
| 10302 | 67 | |
| 68 | /* | |
| 69 | * Lists of signals we wish to catch and those we wish to ignore. | |
| 70 | * Each list terminated with -1 | |
| 71 | */ | |
|
21091
07fe1a99c47b
Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@pidgin.im>
parents:
20791
diff
changeset
|
72 | static const int catch_sig_list[] = { |
| 10302 | 73 | SIGSEGV, |
| 74 | SIGINT, | |
| 75 | SIGTERM, | |
| 76 | SIGQUIT, | |
|
34293
c1da9082287f
Fix a crash in case of Ctrl+C while booting (it's fork related)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33955
diff
changeset
|
77 | SIGCHLD, |
| 10302 | 78 | -1 |
| 79 | }; | |
| 80 | ||
|
21091
07fe1a99c47b
Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@pidgin.im>
parents:
20791
diff
changeset
|
81 | static const int ignore_sig_list[] = { |
| 10302 | 82 | SIGPIPE, |
| 83 | -1 | |
| 84 | }; | |
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
85 | #endif /* !_WIN32 */ |
| 10302 | 86 | |
|
17719
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
87 | static void |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
88 | dologin_named(const char *name) |
| 10302 | 89 | { |
| 15884 | 90 | PurpleAccount *account; |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
91 | char **names; |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
92 | int i; |
| 10302 | 93 | |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
94 | if (name != NULL) { /* list of names given */ |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
95 | names = g_strsplit(name, ",", 64); |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
96 | for (i = 0; names[i] != NULL; i++) { |
| 15884 | 97 | account = purple_accounts_find(names[i], NULL); |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
98 | if (account != NULL) { /* found a user */ |
|
17719
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
99 | purple_account_set_enabled(account, PIDGIN_UI, TRUE); |
| 10302 | 100 | } |
| 101 | } | |
| 102 | g_strfreev(names); | |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
103 | } else { /* no name given, use the first account */ |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
104 | GList *accounts; |
|
11520
61d34ca357f2
[gaim-migrate @ 13765]
Mark Doliner <markdoliner@pidgin.im>
parents:
11475
diff
changeset
|
105 | |
| 15884 | 106 | accounts = purple_accounts_get_all(); |
|
11520
61d34ca357f2
[gaim-migrate @ 13765]
Mark Doliner <markdoliner@pidgin.im>
parents:
11475
diff
changeset
|
107 | if (accounts != NULL) |
|
61d34ca357f2
[gaim-migrate @ 13765]
Mark Doliner <markdoliner@pidgin.im>
parents:
11475
diff
changeset
|
108 | { |
| 15884 | 109 | account = (PurpleAccount *)accounts->data; |
|
17719
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
110 | purple_account_set_enabled(account, PIDGIN_UI, TRUE); |
|
11520
61d34ca357f2
[gaim-migrate @ 13765]
Mark Doliner <markdoliner@pidgin.im>
parents:
11475
diff
changeset
|
111 | } |
| 10302 | 112 | } |
| 113 | } | |
| 114 | ||
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
115 | #ifndef _WIN32 |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
116 | static char *segfault_message; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
117 | |
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
118 | static guint signal_channel_watcher; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
119 | |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
120 | static int signal_sockets[2]; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
121 | |
|
14542
7c1dd9601f1d
[gaim-migrate @ 17199]
Mark Doliner <markdoliner@pidgin.im>
parents:
14323
diff
changeset
|
122 | static void sighandler(int sig); |
|
7c1dd9601f1d
[gaim-migrate @ 17199]
Mark Doliner <markdoliner@pidgin.im>
parents:
14323
diff
changeset
|
123 | |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
124 | static void sighandler(int sig) |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
125 | { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
126 | ssize_t written; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
127 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
128 | /* |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
129 | * We won't do any of the heavy lifting for the signal handling here |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
130 | * because we have no idea what was interrupted. Previously this signal |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
131 | * handler could result in some calls to malloc/free, which can cause |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
132 | * deadlock in libc when the signal handler was interrupting a previous |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
133 | * malloc or free. So instead we'll do an ugly hack where we write the |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
134 | * signal number to one end of a socket pair. The other half of the |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
135 | * socket pair is watched by our main loop. When the main loop sees new |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
136 | * data on the socket it reads in the signal and performs the appropriate |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
137 | * action without fear of interrupting stuff. |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
138 | */ |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
139 | if (sig == SIGSEGV) { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
140 | fprintf(stderr, "%s", segfault_message); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
141 | abort(); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
142 | return; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
143 | } |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
144 | |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
145 | written = write(signal_sockets[0], &sig, sizeof(int)); |
|
40133
b86418d6eb94
Remove redundant comparisons in conditions
qarkai <qarkai@gmail.com>
parents:
40094
diff
changeset
|
146 | if (written != sizeof(int)) { |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
147 | /* This should never happen */ |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
148 | purple_debug_error("sighandler", "Received signal %d but only " |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
149 | "wrote %" G_GSSIZE_FORMAT " bytes out of %" |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
150 | G_GSIZE_FORMAT ": %s\n", |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
151 | sig, written, sizeof(int), g_strerror(errno)); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
152 | exit(1); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
153 | } |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
154 | } |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
155 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
156 | static gboolean |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
157 | mainloop_sighandler(GIOChannel *source, GIOCondition cond, gpointer data) |
| 10302 | 158 | { |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
159 | GIOStatus stat; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
160 | int sig; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
161 | gsize bytes_read; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
162 | GError *error = NULL; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
163 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
164 | /* read the signal number off of the io channel */ |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
165 | stat = g_io_channel_read_chars(source, (gchar *)&sig, sizeof(int), |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
166 | &bytes_read, &error); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
167 | if (stat != G_IO_STATUS_NORMAL) { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
168 | purple_debug_error("sighandler", "Signal callback failed to read " |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
169 | "from signal socket: %s", error->message); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
170 | purple_core_quit(); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
171 | return FALSE; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
172 | } |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
173 | |
|
34293
c1da9082287f
Fix a crash in case of Ctrl+C while booting (it's fork related)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33955
diff
changeset
|
174 | switch (sig) { |
|
c1da9082287f
Fix a crash in case of Ctrl+C while booting (it's fork related)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33955
diff
changeset
|
175 | case SIGCHLD: |
|
c1da9082287f
Fix a crash in case of Ctrl+C while booting (it's fork related)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33955
diff
changeset
|
176 | /* Restore signal catching */ |
|
c1da9082287f
Fix a crash in case of Ctrl+C while booting (it's fork related)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33955
diff
changeset
|
177 | signal(SIGCHLD, sighandler); |
|
c1da9082287f
Fix a crash in case of Ctrl+C while booting (it's fork related)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33955
diff
changeset
|
178 | break; |
|
c1da9082287f
Fix a crash in case of Ctrl+C while booting (it's fork related)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33955
diff
changeset
|
179 | default: |
|
c1da9082287f
Fix a crash in case of Ctrl+C while booting (it's fork related)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33955
diff
changeset
|
180 | purple_debug_warning("sighandler", "Caught signal %d\n", sig); |
|
c1da9082287f
Fix a crash in case of Ctrl+C while booting (it's fork related)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33955
diff
changeset
|
181 | purple_core_quit(); |
|
c1da9082287f
Fix a crash in case of Ctrl+C while booting (it's fork related)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33955
diff
changeset
|
182 | } |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
183 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
184 | return TRUE; |
| 10302 | 185 | } |
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
186 | #endif /* !_WIN32 */ |
| 10302 | 187 | |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
188 | static int |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
21984
diff
changeset
|
189 | ui_main(void) |
| 10302 | 190 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
191 | pidgin_blist_setup_sort_methods(); |
| 10302 | 192 | |
|
39237
8d0af3b47338
libpidgin: Set default window icon from icon theme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39152
diff
changeset
|
193 | gtk_window_set_default_icon_name("pidgin"); |
| 10302 | 194 | |
| 195 | return 0; | |
| 196 | } | |
| 197 | ||
| 198 | static void | |
| 199 | debug_init(void) | |
| 200 | { | |
|
38645
bf3f91939dc5
Convert PidginDebugUi to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38578
diff
changeset
|
201 | PidginDebugUi *ui = pidgin_debug_ui_new(); |
|
bf3f91939dc5
Convert PidginDebugUi to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38578
diff
changeset
|
202 | purple_debug_set_ui(PURPLE_DEBUG_UI(ui)); |
| 10302 | 203 | } |
| 204 | ||
| 205 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
206 | pidgin_ui_init(void) |
| 10302 | 207 | { |
|
39036
ced50832d0c7
libpidgin: Add pidgin icon path to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39014
diff
changeset
|
208 | gchar *path; |
|
ced50832d0c7
libpidgin: Add pidgin icon path to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39014
diff
changeset
|
209 | |
|
ced50832d0c7
libpidgin: Add pidgin icon path to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39014
diff
changeset
|
210 | path = g_build_filename(PURPLE_DATADIR, "pidgin", "icons", NULL); |
|
ced50832d0c7
libpidgin: Add pidgin icon path to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39014
diff
changeset
|
211 | gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), path); |
|
ced50832d0c7
libpidgin: Add pidgin icon path to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39014
diff
changeset
|
212 | g_free(path); |
|
ced50832d0c7
libpidgin: Add pidgin icon path to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39014
diff
changeset
|
213 | |
|
22481
d8a9e927c90f
Initialize the stock stuff before doing anything else so that stock items used in error messages are ready to be used. Fixes #4917.
Daniel Atallah <datallah@pidgin.im>
parents:
22187
diff
changeset
|
214 | pidgin_stock_init(); |
|
d8a9e927c90f
Initialize the stock stuff before doing anything else so that stock items used in error messages are ready to be used. Fixes #4917.
Daniel Atallah <datallah@pidgin.im>
parents:
22187
diff
changeset
|
215 | |
| 10302 | 216 | /* Set the UI operation structures. */ |
| 15884 | 217 | purple_accounts_set_ui_ops(pidgin_accounts_get_ui_ops()); |
| 218 | purple_xfers_set_ui_ops(pidgin_xfers_get_ui_ops()); | |
|
39693
86f5c1fef140
Convert UI ops to PurpleBuddyListClass methods.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
219 | purple_blist_set_ui(PIDGIN_TYPE_BUDDY_LIST); |
| 15884 | 220 | purple_notify_set_ui_ops(pidgin_notify_get_ui_ops()); |
| 221 | purple_request_set_ui_ops(pidgin_request_get_ui_ops()); | |
| 222 | purple_sound_set_ui_ops(pidgin_sound_get_ui_ops()); | |
| 223 | purple_connections_set_ui_ops(pidgin_connections_get_ui_ops()); | |
| 224 | purple_whiteboard_set_ui_ops(pidgin_whiteboard_get_ui_ops()); | |
| 225 | purple_idle_set_ui_ops(pidgin_idle_get_ui_ops()); | |
| 10302 | 226 | |
|
34587
a3bc28bb4ef5
Refactored pidgin to use the GObject-based PurpleAccount API
Ankit Vani <a@nevitus.org>
parents:
33955
diff
changeset
|
227 | pidgin_accounts_init(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
228 | pidgin_connection_init(); |
|
34502
433382371e89
Request API: datasheet field
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34308
diff
changeset
|
229 | pidgin_request_init(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
230 | pidgin_blist_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
231 | pidgin_status_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
232 | pidgin_conversations_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
233 | pidgin_pounces_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
234 | pidgin_privacy_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
235 | pidgin_xfers_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
236 | pidgin_roomlist_init(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
237 | pidgin_log_init(); |
|
35781
8c621fbbee8e
Comments: PidginSmileyTheme
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35756
diff
changeset
|
238 | _pidgin_smiley_theme_init(); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
24585
diff
changeset
|
239 | pidgin_medias_init(); |
|
27476
d44640cb5686
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
240 | pidgin_notify_init(); |
| 10302 | 241 | } |
| 242 | ||
| 243 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
244 | pidgin_quit(void) |
| 10302 | 245 | { |
|
10574
5abb2931b6ff
[gaim-migrate @ 11966]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10448
diff
changeset
|
246 | /* Uninit */ |
|
38645
bf3f91939dc5
Convert PidginDebugUi to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38578
diff
changeset
|
247 | PurpleDebugUi *ui; |
|
bf3f91939dc5
Convert PidginDebugUi to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38578
diff
changeset
|
248 | |
|
27476
d44640cb5686
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
249 | pidgin_notify_uninit(); |
|
35781
8c621fbbee8e
Comments: PidginSmileyTheme
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35756
diff
changeset
|
250 | _pidgin_smiley_theme_uninit(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
251 | pidgin_conversations_uninit(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
252 | pidgin_status_uninit(); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
253 | pidgin_blist_uninit(); |
|
34502
433382371e89
Request API: datasheet field
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34308
diff
changeset
|
254 | pidgin_request_uninit(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
255 | pidgin_connection_uninit(); |
|
34587
a3bc28bb4ef5
Refactored pidgin to use the GObject-based PurpleAccount API
Ankit Vani <a@nevitus.org>
parents:
33955
diff
changeset
|
256 | pidgin_accounts_uninit(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
257 | pidgin_xfers_uninit(); |
|
38645
bf3f91939dc5
Convert PidginDebugUi to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38578
diff
changeset
|
258 | ui = purple_debug_get_ui(); |
|
bf3f91939dc5
Convert PidginDebugUi to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38578
diff
changeset
|
259 | purple_debug_set_ui(NULL); |
|
bf3f91939dc5
Convert PidginDebugUi to a GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38578
diff
changeset
|
260 | g_object_unref(ui); |
|
10574
5abb2931b6ff
[gaim-migrate @ 11966]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10448
diff
changeset
|
261 | |
| 10302 | 262 | /* and end it all... */ |
|
38383
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
263 | g_application_quit(g_application_get_default()); |
| 10302 | 264 | } |
| 265 | ||
|
40336
4e766d681de5
purple_core_get_ui_info now transfers the PurpleUiInfo to the caller, so we need to make sure to not cache it.
Gary Kramlich <grim@reaperworld.com>
parents:
40312
diff
changeset
|
266 | static PurpleUiInfo * |
|
4e766d681de5
purple_core_get_ui_info now transfers the PurpleUiInfo to the caller, so we need to make sure to not cache it.
Gary Kramlich <grim@reaperworld.com>
parents:
40312
diff
changeset
|
267 | pidgin_ui_get_info(void) { |
|
4e766d681de5
purple_core_get_ui_info now transfers the PurpleUiInfo to the caller, so we need to make sure to not cache it.
Gary Kramlich <grim@reaperworld.com>
parents:
40312
diff
changeset
|
268 | return purple_ui_info_new(PIDGIN_NAME, VERSION, "https://pidgin.im", |
|
40337
917a228d6268
Fix some issues found in review
Gary Kramlich <grim@reaperworld.com>
parents:
40336
diff
changeset
|
269 | "https://developer.pidgin.im", "pc"); |
|
18442
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
270 | } |
|
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
271 | |
| 15884 | 272 | static PurpleCoreUiOps core_ops = |
| 10302 | 273 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
274 | pidgin_prefs_init, |
| 10302 | 275 | debug_init, |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
276 | pidgin_ui_init, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16545
diff
changeset
|
277 | pidgin_quit, |
|
18442
99c6a0271b1d
UI info for finch and pidgin (finch guys probably want to take a look
Nathan Walp <nwalp@pidgin.im>
parents:
18256
diff
changeset
|
278 | pidgin_ui_get_info, |
| 10302 | 279 | }; |
| 280 | ||
| 15884 | 281 | static PurpleCoreUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
282 | pidgin_core_get_ui_ops(void) |
| 10302 | 283 | { |
| 284 | return &core_ops; | |
| 285 | } | |
| 286 | ||
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
287 | static gint |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
288 | pidgin_handle_local_options_cb(GApplication *app, GVariantDict *options, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
289 | gpointer user_data) |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
290 | { |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
291 | if (g_variant_dict_contains(options, "version")) { |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
292 | printf("%s %s (libpurple %s)\n", PIDGIN_NAME, DISPLAY_VERSION, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
293 | purple_core_get_version()); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
294 | return 0; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
295 | } |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
296 | |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
297 | return -1; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
298 | } |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
299 | |
| 10302 | 300 | static void |
|
38383
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
301 | pidgin_activate_cb(GApplication *application, gpointer user_data) |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
302 | { |
|
39333
2da5959eb42c
pidgin: Use gtk_window_present() to present buddy list
Mike Ruprecht <cmaiku@gmail.com>
parents:
39321
diff
changeset
|
303 | PidginBuddyList *blist = pidgin_blist_get_default_gtk_blist(); |
|
2da5959eb42c
pidgin: Use gtk_window_present() to present buddy list
Mike Ruprecht <cmaiku@gmail.com>
parents:
39321
diff
changeset
|
304 | |
|
2da5959eb42c
pidgin: Use gtk_window_present() to present buddy list
Mike Ruprecht <cmaiku@gmail.com>
parents:
39321
diff
changeset
|
305 | if (blist != NULL && blist->window != NULL) { |
|
2da5959eb42c
pidgin: Use gtk_window_present() to present buddy list
Mike Ruprecht <cmaiku@gmail.com>
parents:
39321
diff
changeset
|
306 | gtk_window_present(GTK_WINDOW(blist->window)); |
|
2da5959eb42c
pidgin: Use gtk_window_present() to present buddy list
Mike Ruprecht <cmaiku@gmail.com>
parents:
39321
diff
changeset
|
307 | } |
|
38383
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
308 | } |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
309 | |
|
39321
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
310 | static gint |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
311 | pidgin_command_line_cb(GApplication *application, |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
312 | GApplicationCommandLine *cmdline, gpointer user_data) |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
313 | { |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
314 | gchar **argv; |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
315 | int argc; |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
316 | int i; |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
317 | |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
318 | argv = g_application_command_line_get_arguments(cmdline, &argc); |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
319 | |
|
39326
459e31e859c7
pidgin: Fix GApplication activation
Mike Ruprecht <cmaiku@gmail.com>
parents:
39321
diff
changeset
|
320 | if (argc == 1) { |
|
459e31e859c7
pidgin: Fix GApplication activation
Mike Ruprecht <cmaiku@gmail.com>
parents:
39321
diff
changeset
|
321 | /* No arguments, just activate */ |
|
459e31e859c7
pidgin: Fix GApplication activation
Mike Ruprecht <cmaiku@gmail.com>
parents:
39321
diff
changeset
|
322 | g_application_activate(application); |
|
459e31e859c7
pidgin: Fix GApplication activation
Mike Ruprecht <cmaiku@gmail.com>
parents:
39321
diff
changeset
|
323 | } |
|
459e31e859c7
pidgin: Fix GApplication activation
Mike Ruprecht <cmaiku@gmail.com>
parents:
39321
diff
changeset
|
324 | |
|
39321
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
325 | /* Start at 1 to skip the executable name */ |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
326 | for (i = 1; i < argc; ++i) { |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
327 | purple_got_protocol_handler_uri(argv[i]); |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
328 | } |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
329 | |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
330 | g_strfreev(argv); |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
331 | |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
332 | return 0; |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
333 | } |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
334 | |
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
335 | static gchar *opt_config_dir_arg = NULL; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
336 | static gboolean opt_nologin = FALSE; |
|
38594
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
337 | static gboolean opt_login = FALSE; |
|
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
338 | static gchar *opt_login_arg = NULL; |
|
12846
93ff2d8dd1e7
[gaim-migrate @ 15194]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
12838
diff
changeset
|
339 | |
|
38594
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
340 | static gboolean |
|
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
341 | login_opt_arg_func(const gchar *option_name, const gchar *value, |
|
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
342 | gpointer data, GError **error) |
|
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
343 | { |
|
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
344 | opt_login = TRUE; |
|
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
345 | |
|
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
346 | g_free(opt_login_arg); |
|
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
347 | opt_login_arg = g_strdup(value); |
|
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
348 | |
|
eb2d289be0fe
libpidgin: Port to use GOptionContext for parsing command line args
Mike Ruprecht <cmaiku@gmail.com>
parents:
38593
diff
changeset
|
349 | return TRUE; |
| 10302 | 350 | } |
| 351 | ||
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
352 | static GOptionEntry option_entries[] = { |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
353 | {"config", 'c', 0, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
354 | G_OPTION_ARG_FILENAME, &opt_config_dir_arg, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
355 | N_("use DIR for config files"), N_("DIR")}, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
356 | {"login", 'l', G_OPTION_FLAG_OPTIONAL_ARG, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
357 | G_OPTION_ARG_CALLBACK, &login_opt_arg_func, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
358 | N_("enable specified account(s) (optional argument NAME\n" |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
359 | " " |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
360 | "specifies account(s) to use, separated by commas.\n" |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
361 | " " |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
362 | "Without this only the first account will be enabled)"), |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
363 | N_("[NAME]")}, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
364 | {"nologin", 'n', 0, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
365 | G_OPTION_ARG_NONE, &opt_nologin, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
366 | N_("don't automatically login"), NULL}, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
367 | {"version", 'v', 0, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
368 | G_OPTION_ARG_NONE, NULL, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
369 | N_("display the current version and exit"), NULL}, |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
370 | {NULL} |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
371 | }; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
372 | |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
373 | #ifndef _WIN32 |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
374 | static void |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
375 | pidgin_setup_error_handler(void) |
| 10302 | 376 | { |
| 377 | int sig_indx; /* for setting up signal catching */ | |
| 378 | sigset_t sigset; | |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
379 | char errmsg[BUFSIZ]; |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
380 | GIOChannel *signal_channel; |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
381 | GIOStatus signal_status; |
|
39365
af69ee5abbf2
pidgin: Fix compiling with -Dconsole-logging=true
Mike Ruprecht <cmaiku@gmail.com>
parents:
39335
diff
changeset
|
382 | GError *error = NULL; |
|
13215
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
383 | #ifndef DEBUG |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
384 | char *segfault_message_tmp; |
| 10302 | 385 | |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
386 | /* We translate this here in case the crash breaks gettext. */ |
|
13215
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
387 | segfault_message_tmp = g_strdup_printf(_( |
|
20395
81c963c89157
Include the version in the segfault message - enough people blindly copy
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20346
diff
changeset
|
388 | "%s %s has segfaulted and attempted to dump a core file.\n" |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
389 | "This is a bug in the software and has happened through\n" |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
390 | "no fault of your own.\n\n" |
|
16977
c9cb49bea66d
Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@pidgin.im>
parents:
16967
diff
changeset
|
391 | "If you can reproduce the crash, please notify the developers\n" |
|
c9cb49bea66d
Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@pidgin.im>
parents:
16967
diff
changeset
|
392 | "by reporting a bug at:\n" |
|
18256
63c91e6c806e
I believe the great unwashed should be using simpleticket for submitting
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18232
diff
changeset
|
393 | "%ssimpleticket/\n\n" |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
394 | "Please make sure to specify what you were doing at the time\n" |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
395 | "and post the backtrace from the core file. If you do not know\n" |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
396 | "how to get the backtrace, please read the instructions at\n" |
|
24585
25d84f35abf8
kluge pointed out that the segfault message still recommends people IM
Richard Laager <rlaager@pidgin.im>
parents:
23545
diff
changeset
|
397 | "%swiki/GetABacktrace\n"), |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
398 | PIDGIN_NAME, DISPLAY_VERSION, PURPLE_WEBSITE, PURPLE_WEBSITE |
|
13090
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13024
diff
changeset
|
399 | ); |
|
13587
fb0245a7ccab
[gaim-migrate @ 15971]
Daniel Atallah <datallah@pidgin.im>
parents:
13429
diff
changeset
|
400 | |
|
13215
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
401 | /* we have to convert the message (UTF-8 to console |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
402 | charset) early because after a segmentation fault |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
403 | it's not a good practice to allocate memory */ |
|
13587
fb0245a7ccab
[gaim-migrate @ 15971]
Daniel Atallah <datallah@pidgin.im>
parents:
13429
diff
changeset
|
404 | segfault_message = g_locale_from_utf8(segfault_message_tmp, |
|
13215
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
405 | -1, NULL, NULL, &error); |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
406 | if (segfault_message != NULL) { |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
407 | g_free(segfault_message_tmp); |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
408 | } |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
409 | else { |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
410 | /* use 'segfault_message_tmp' (UTF-8) as a fallback */ |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
411 | g_warning("%s\n", error->message); |
|
38607
51b50879b5c9
libpidgin: Fix Windows crash by initializing error to NULL
Mike Ruprecht <cmaiku@gmail.com>
parents:
38578
diff
changeset
|
412 | g_clear_error(&error); |
|
13215
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
413 | segfault_message = segfault_message_tmp; |
|
c3e72e316531
[gaim-migrate @ 15578]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13111
diff
changeset
|
414 | } |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
415 | #else |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
416 | /* Don't mark this for translation. */ |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
417 | segfault_message = g_strdup( |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
418 | "Hi, user. We need to talk.\n" |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
419 | "I think something's gone wrong here. It's probably my fault.\n" |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
420 | "No, really, it's not you... it's me... no no no, I think we get along well\n" |
| 12670 | 421 | "it's just that.... well, I want to see other people. I... what?!? NO! I \n" |
| 422 | "haven't been cheating on you!! How many times do you want me to tell you?! And\n" | |
| 423 | "for the last time, it's just a rash!\n" | |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
424 | ); |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
425 | #endif |
|
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
426 | |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
427 | /* |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
428 | * Create a socket pair for receiving unix signals from a signal |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
429 | * handler. |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
430 | */ |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
431 | if (socketpair(AF_UNIX, SOCK_STREAM, 0, signal_sockets) < 0) { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
432 | perror("Failed to create sockets for GLib signal handling"); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
433 | exit(1); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
434 | } |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
435 | signal_channel = g_io_channel_unix_new(signal_sockets[1]); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
436 | |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
437 | /* |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
438 | * Set the channel encoding to raw binary instead of the default of |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
439 | * UTF-8, because we'll be sending integers across instead of strings. |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
440 | */ |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
441 | signal_status = g_io_channel_set_encoding(signal_channel, NULL, &error); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
442 | if (signal_status != G_IO_STATUS_NORMAL) { |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
443 | fprintf(stderr, "Failed to set the signal channel to raw " |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
444 | "binary: %s", error->message); |
|
38607
51b50879b5c9
libpidgin: Fix Windows crash by initializing error to NULL
Mike Ruprecht <cmaiku@gmail.com>
parents:
38578
diff
changeset
|
445 | g_clear_error(&error); |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
446 | exit(1); |
|
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
447 | } |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
448 | signal_channel_watcher = g_io_add_watch(signal_channel, G_IO_IN, mainloop_sighandler, NULL); |
|
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
449 | g_io_channel_unref(signal_channel); |
|
28820
58701e24ed40
We really shouldn't be doing a whole lot in our signal handler. The
Mark Doliner <markdoliner@pidgin.im>
parents:
28800
diff
changeset
|
450 | |
| 10302 | 451 | /* Let's not violate any PLA's!!!! */ |
| 452 | /* jseymour: whatever the fsck that means */ | |
| 453 | /* Robot101: for some reason things like gdm like to block * | |
| 454 | * useful signals like SIGCHLD, so we unblock all the ones we * | |
| 455 | * declare a handler for. thanks JSeymour and Vann. */ | |
| 456 | if (sigemptyset(&sigset)) { | |
|
40094
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
457 | g_snprintf(errmsg, sizeof(errmsg), |
|
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
458 | "Warning: couldn't initialise empty signal set"); |
| 10302 | 459 | perror(errmsg); |
| 460 | } | |
| 461 | for(sig_indx = 0; catch_sig_list[sig_indx] != -1; ++sig_indx) { | |
|
33794
716cbef8d1c6
Fix a number of additional trivial issues - unused variables, etc.
Daniel Atallah <datallah@pidgin.im>
parents:
33371
diff
changeset
|
462 | if(signal(catch_sig_list[sig_indx], sighandler) == SIG_ERR) { |
|
40094
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
463 | g_snprintf(errmsg, sizeof(errmsg), |
|
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
464 | "Warning: couldn't set signal %d for catching", |
|
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
465 | catch_sig_list[sig_indx]); |
| 10302 | 466 | perror(errmsg); |
| 467 | } | |
| 468 | if(sigaddset(&sigset, catch_sig_list[sig_indx])) { | |
|
40094
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
469 | g_snprintf(errmsg, sizeof(errmsg), |
|
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
470 | "Warning: couldn't include signal %d for unblocking", |
|
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
471 | catch_sig_list[sig_indx]); |
| 10302 | 472 | perror(errmsg); |
| 473 | } | |
| 474 | } | |
| 475 | for(sig_indx = 0; ignore_sig_list[sig_indx] != -1; ++sig_indx) { | |
|
33794
716cbef8d1c6
Fix a number of additional trivial issues - unused variables, etc.
Daniel Atallah <datallah@pidgin.im>
parents:
33371
diff
changeset
|
476 | if(signal(ignore_sig_list[sig_indx], SIG_IGN) == SIG_ERR) { |
|
40094
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
477 | g_snprintf(errmsg, sizeof(errmsg), |
|
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
478 | "Warning: couldn't set signal %d to ignore", |
|
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
479 | ignore_sig_list[sig_indx]); |
| 10302 | 480 | perror(errmsg); |
| 481 | } | |
| 482 | } | |
| 483 | ||
| 484 | if (sigprocmask(SIG_UNBLOCK, &sigset, NULL)) { | |
|
40094
8e6d91e4dd8f
Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39954
diff
changeset
|
485 | g_snprintf(errmsg, sizeof(errmsg), "Warning: couldn't unblock signals"); |
| 10302 | 486 | perror(errmsg); |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10306
diff
changeset
|
487 | } |
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
488 | } |
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
489 | #endif /* !_WIN32 */ |
| 10302 | 490 | |
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
491 | static void |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
492 | pidgin_startup_cb(GApplication *app, gpointer user_data) |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
493 | { |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
494 | char *search_path; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
495 | GtkCssProvider *provider; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
496 | GdkScreen *screen; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
497 | GList *accounts; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
498 | gboolean gui_check; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
499 | GList *active_accounts; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
500 | GStatBuf st; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
501 | GError *error = NULL; |
| 10302 | 502 | |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
503 | /* set a user-specified config directory */ |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
504 | if (opt_config_dir_arg != NULL) { |
|
32785
5e08d5a41442
pidgin/finch: Make relative paths absolute with -c
Paul Aurich <darkrain42@pidgin.im>
parents:
31992
diff
changeset
|
505 | if (g_path_is_absolute(opt_config_dir_arg)) { |
|
5e08d5a41442
pidgin/finch: Make relative paths absolute with -c
Paul Aurich <darkrain42@pidgin.im>
parents:
31992
diff
changeset
|
506 | purple_util_set_user_dir(opt_config_dir_arg); |
|
5e08d5a41442
pidgin/finch: Make relative paths absolute with -c
Paul Aurich <darkrain42@pidgin.im>
parents:
31992
diff
changeset
|
507 | } else { |
|
5e08d5a41442
pidgin/finch: Make relative paths absolute with -c
Paul Aurich <darkrain42@pidgin.im>
parents:
31992
diff
changeset
|
508 | /* Make an absolute (if not canonical) path */ |
|
5e08d5a41442
pidgin/finch: Make relative paths absolute with -c
Paul Aurich <darkrain42@pidgin.im>
parents:
31992
diff
changeset
|
509 | char *cwd = g_get_current_dir(); |
|
5e08d5a41442
pidgin/finch: Make relative paths absolute with -c
Paul Aurich <darkrain42@pidgin.im>
parents:
31992
diff
changeset
|
510 | char *path = g_build_path(G_DIR_SEPARATOR_S, cwd, opt_config_dir_arg, NULL); |
|
5e08d5a41442
pidgin/finch: Make relative paths absolute with -c
Paul Aurich <darkrain42@pidgin.im>
parents:
31992
diff
changeset
|
511 | purple_util_set_user_dir(path); |
|
5e08d5a41442
pidgin/finch: Make relative paths absolute with -c
Paul Aurich <darkrain42@pidgin.im>
parents:
31992
diff
changeset
|
512 | g_free(path); |
|
5e08d5a41442
pidgin/finch: Make relative paths absolute with -c
Paul Aurich <darkrain42@pidgin.im>
parents:
31992
diff
changeset
|
513 | g_free(cwd); |
|
5e08d5a41442
pidgin/finch: Make relative paths absolute with -c
Paul Aurich <darkrain42@pidgin.im>
parents:
31992
diff
changeset
|
514 | } |
|
10323
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
515 | } |
|
f4a013ac9e7c
[gaim-migrate @ 11530]
Mark Doliner <markdoliner@pidgin.im>
parents:
10322
diff
changeset
|
516 | |
|
39953
10db0a477198
Move some Pidgin things to XDG directories.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39921
diff
changeset
|
517 | search_path = g_build_filename(purple_config_dir(), "gtk-3.0.css", NULL); |
|
33926
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
518 | |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
519 | provider = gtk_css_provider_new(); |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
520 | gui_check = gtk_css_provider_load_from_path(provider, search_path, &error); |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
521 | |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
522 | if (gui_check && !error) { |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
523 | screen = gdk_screen_get_default(); |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
524 | gtk_style_context_add_provider_for_screen(screen, |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
525 | GTK_STYLE_PROVIDER(provider), |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
526 | GTK_STYLE_PROVIDER_PRIORITY_USER); |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
527 | } else { |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
528 | purple_debug_error("gtk", "Unable to load custom gtk-3.0.css: %s\n", |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
529 | error ? error->message : "(unknown error)"); |
|
38607
51b50879b5c9
libpidgin: Fix Windows crash by initializing error to NULL
Mike Ruprecht <cmaiku@gmail.com>
parents:
38578
diff
changeset
|
530 | g_clear_error(&error); |
|
33926
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
531 | } |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
532 | |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
533 | g_free(search_path); |
|
0c11d752fbe4
Load custom CSS for styling on GTK+3.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33890
diff
changeset
|
534 | |
|
12572
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
535 | #ifdef _WIN32 |
| 35605 | 536 | winpidgin_init(); |
|
12572
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
537 | #endif |
|
a71b6aef215b
[gaim-migrate @ 14891]
Daniel Atallah <datallah@pidgin.im>
parents:
12562
diff
changeset
|
538 | |
| 15884 | 539 | purple_core_set_ui_ops(pidgin_core_get_ui_ops()); |
| 10302 | 540 | |
| 15884 | 541 | if (!purple_core_init(PIDGIN_UI)) { |
| 10302 | 542 | fprintf(stderr, |
|
16977
c9cb49bea66d
Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@pidgin.im>
parents:
16967
diff
changeset
|
543 | "Initialization of the libpurple core failed. Dumping core.\n" |
| 10302 | 544 | "Please report this!\n"); |
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
545 | #ifndef _WIN32 |
|
16193
e27165dcba9b
Free segfault_message when Pidgin exits abnormally
Mark Doliner <markdoliner@pidgin.im>
parents:
16158
diff
changeset
|
546 | g_free(segfault_message); |
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
547 | #endif |
| 10302 | 548 | abort(); |
| 549 | } | |
| 550 | ||
|
39013
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
551 | if (!g_getenv("PURPLE_PLUGINS_SKIP")) { |
|
39954
e843e8fab70c
Move Pidgin/Finch plugins to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39953
diff
changeset
|
552 | search_path = g_build_filename(purple_data_dir(), |
|
39013
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
553 | "plugins", NULL); |
|
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
554 | if (!g_stat(search_path, &st)) |
|
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
555 | g_mkdir(search_path, S_IRUSR | S_IWUSR | S_IXUSR); |
|
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
556 | purple_plugins_add_search_path(search_path); |
|
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
557 | g_free(search_path); |
|
36485
bfb60fd48059
Add LIBDIR to pidgin and finch search paths
Ankit Vani <a@nevitus.org>
parents:
36431
diff
changeset
|
558 | |
|
39013
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
559 | purple_plugins_add_search_path(PIDGIN_LIBDIR); |
|
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
560 | } else { |
|
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
561 | purple_debug_info("gtk", |
|
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
562 | "PURPLE_PLUGINS_SKIP environment variable " |
|
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
563 | "set, skipping normal Pidgin plugin paths"); |
|
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
564 | } |
|
3d8d5a8a36c7
libpidgin: Make PURPLE_PLUGINS_SKIP also skip Pidgin plugin paths
Mike Ruprecht <cmaiku@gmail.com>
parents:
38803
diff
changeset
|
565 | |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36415
diff
changeset
|
566 | purple_plugins_refresh(); |
|
36415
1c0b40253875
Refactored gtkdocklet, gtkimhtmltoolbar, gtkmain to use the new API
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
567 | |
| 10302 | 568 | /* load plugins we had when we quit */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
569 | purple_plugins_load_saved(PIDGIN_PREFS_ROOT "/plugins/loaded"); |
| 10302 | 570 | |
| 571 | ui_main(); | |
| 572 | ||
|
37424
04cf8cbe44d8
Remove more NULL-checks before free().
Michael McConville <mmcco@mykolab.com>
parents:
37422
diff
changeset
|
573 | g_free(opt_config_dir_arg); |
|
04cf8cbe44d8
Remove more NULL-checks before free().
Michael McConville <mmcco@mykolab.com>
parents:
37422
diff
changeset
|
574 | opt_config_dir_arg = NULL; |
| 10302 | 575 | |
|
12011
85a627679414
[gaim-migrate @ 14304]
Mark Doliner <markdoliner@pidgin.im>
parents:
11928
diff
changeset
|
576 | /* |
|
85a627679414
[gaim-migrate @ 14304]
Mark Doliner <markdoliner@pidgin.im>
parents:
11928
diff
changeset
|
577 | * We want to show the blist early in the init process so the |
|
85a627679414
[gaim-migrate @ 14304]
Mark Doliner <markdoliner@pidgin.im>
parents:
11928
diff
changeset
|
578 | * user feels warm and fuzzy (not cold and prickley). |
|
85a627679414
[gaim-migrate @ 14304]
Mark Doliner <markdoliner@pidgin.im>
parents:
11928
diff
changeset
|
579 | */ |
| 15884 | 580 | purple_blist_show(); |
|
12011
85a627679414
[gaim-migrate @ 14304]
Mark Doliner <markdoliner@pidgin.im>
parents:
11928
diff
changeset
|
581 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
582 | if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")) |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
583 | pidgin_debug_window_show(); |
| 10302 | 584 | |
| 585 | if (opt_login) { | |
|
17719
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
586 | /* disable all accounts */ |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
587 | for (accounts = purple_accounts_get_all(); accounts != NULL; accounts = accounts->next) { |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
588 | PurpleAccount *account = accounts->data; |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
589 | purple_account_set_enabled(account, PIDGIN_UI, FALSE); |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
590 | } |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
591 | /* honor the startup status preference */ |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
592 | if (!purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
593 | purple_savedstatus_activate(purple_savedstatus_get_startup()); |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
594 | /* now enable the requested ones */ |
|
8070b1610abe
Make -l do something slightly more sane than it does now, even though it
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17105
diff
changeset
|
595 | dologin_named(opt_login_arg); |
|
37424
04cf8cbe44d8
Remove more NULL-checks before free().
Michael McConville <mmcco@mykolab.com>
parents:
37422
diff
changeset
|
596 | g_free(opt_login_arg); |
|
04cf8cbe44d8
Remove more NULL-checks before free().
Michael McConville <mmcco@mykolab.com>
parents:
37422
diff
changeset
|
597 | opt_login_arg = NULL; |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19122
diff
changeset
|
598 | } else if (opt_nologin) { |
|
11806
269e9f78cf89
[gaim-migrate @ 14097]
Mark Doliner <markdoliner@pidgin.im>
parents:
11795
diff
changeset
|
599 | /* Set all accounts to "offline" */ |
| 15884 | 600 | PurpleSavedStatus *saved_status; |
|
13111
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
601 | |
|
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
602 | /* If we've used this type+message before, lookup the transient status */ |
| 15884 | 603 | saved_status = purple_savedstatus_find_transient_by_type_and_message( |
| 604 | PURPLE_STATUS_OFFLINE, NULL); | |
|
13111
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
605 | |
|
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
606 | /* If this type+message is unique then create a new transient saved status */ |
|
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
607 | if (saved_status == NULL) |
| 15884 | 608 | saved_status = purple_savedstatus_new(NULL, PURPLE_STATUS_OFFLINE); |
|
13111
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
609 | |
|
31caa48825f7
[gaim-migrate @ 15472]
Mark Doliner <markdoliner@pidgin.im>
parents:
13106
diff
changeset
|
610 | /* Set the status for each account */ |
| 15884 | 611 | purple_savedstatus_activate(saved_status); |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19122
diff
changeset
|
612 | } else { |
|
11348
b8938b189d61
[gaim-migrate @ 13565]
Mark Doliner <markdoliner@pidgin.im>
parents:
11277
diff
changeset
|
613 | /* Everything is good to go--sign on already */ |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
614 | if (!purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) |
| 15884 | 615 | purple_savedstatus_activate(purple_savedstatus_get_startup()); |
| 616 | purple_accounts_restore_current_statuses(); | |
|
10738
63ca8277c234
[gaim-migrate @ 12340]
Mark Doliner <markdoliner@pidgin.im>
parents:
10638
diff
changeset
|
617 | } |
| 10302 | 618 | |
|
18121
2d8ea56b9097
Mark the return type const for the following functions. I noticed this
Richard Laager <rlaager@pidgin.im>
parents:
18093
diff
changeset
|
619 | if ((active_accounts = purple_accounts_get_all_active()) == NULL) |
|
11403
e7e7ed37dc51
[gaim-migrate @ 13638]
Mark Doliner <markdoliner@pidgin.im>
parents:
11348
diff
changeset
|
620 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
621 | pidgin_accounts_window_show(); |
| 10315 | 622 | } |
| 13835 | 623 | else |
| 624 | { | |
|
18121
2d8ea56b9097
Mark the return type const for the following functions. I noticed this
Richard Laager <rlaager@pidgin.im>
parents:
18093
diff
changeset
|
625 | g_list_free(active_accounts); |
| 13835 | 626 | } |
| 10302 | 627 | |
|
31506
d282fb1e8315
Remove the dependency on libstartup-notification. Our use of it had some bugs
David Benjamin <davidben@mit.edu>
parents:
30844
diff
changeset
|
628 | /* GTK clears the notification for us when opening the first window, |
|
d282fb1e8315
Remove the dependency on libstartup-notification. Our use of it had some bugs
David Benjamin <davidben@mit.edu>
parents:
30844
diff
changeset
|
629 | * but we may have launched with only a status icon, so clear the it |
|
d282fb1e8315
Remove the dependency on libstartup-notification. Our use of it had some bugs
David Benjamin <davidben@mit.edu>
parents:
30844
diff
changeset
|
630 | * just in case. */ |
|
d282fb1e8315
Remove the dependency on libstartup-notification. Our use of it had some bugs
David Benjamin <davidben@mit.edu>
parents:
30844
diff
changeset
|
631 | gdk_notify_startup_complete(); |
|
14762
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14743
diff
changeset
|
632 | |
|
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14743
diff
changeset
|
633 | #ifdef _WIN32 |
|
15574
18d9d1c05994
Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents:
15567
diff
changeset
|
634 | winpidgin_post_init(); |
|
14762
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14743
diff
changeset
|
635 | #endif |
|
f494a5f12981
[gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents:
14743
diff
changeset
|
636 | |
|
38383
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
637 | /* TODO: Use GtkApplicationWindow or add a window instead */ |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
638 | g_application_hold(app); |
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
639 | } |
|
38383
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
640 | |
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
641 | int pidgin_start(int argc, char *argv[]) |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
642 | { |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
643 | GApplication *app; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
644 | int ret; |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
645 | |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
646 | #ifdef DEBUG |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
647 | purple_debug_set_enabled(TRUE); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
648 | #endif |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
649 | |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
650 | bindtextdomain(PACKAGE, PURPLE_LOCALEDIR); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
651 | bind_textdomain_codeset(PACKAGE, "UTF-8"); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
652 | textdomain(PACKAGE); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
653 | |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
654 | /* Locale initialization is not complete here. See gtk_init_check() */ |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
655 | setlocale(LC_ALL, ""); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
656 | |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
657 | #ifndef _WIN32 |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
658 | pidgin_setup_error_handler(); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
659 | #endif |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
660 | |
|
39857
3a718dc6e705
Update application name.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39703
diff
changeset
|
661 | app = G_APPLICATION(gtk_application_new("im.pidgin.Pidgin3", |
|
39321
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
662 | G_APPLICATION_CAN_OVERRIDE_APP_ID | |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
663 | G_APPLICATION_HANDLES_COMMAND_LINE)); |
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
664 | |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
665 | g_application_add_main_option_entries(app, option_entries); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
666 | g_application_add_option_group(app, purple_get_option_group()); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
667 | g_application_add_option_group(app, gplugin_get_option_group()); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
668 | |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
669 | g_object_set(app, "register-session", TRUE, NULL); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
670 | |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
671 | g_signal_connect(app, "handle-local-options", |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
672 | G_CALLBACK(pidgin_handle_local_options_cb), NULL); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
673 | g_signal_connect(app, "startup", |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
674 | G_CALLBACK(pidgin_startup_cb), NULL); |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
675 | g_signal_connect(app, "activate", |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
676 | G_CALLBACK(pidgin_activate_cb), NULL); |
|
39321
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
677 | g_signal_connect(app, "command-line", |
|
e4ba787be39c
libpidgin: Handle command line URIs using GApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
39257
diff
changeset
|
678 | G_CALLBACK(pidgin_command_line_cb), NULL); |
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
679 | |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
680 | ret = g_application_run(app, argc, argv); |
|
38383
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
681 | |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
682 | /* Make sure purple has quit in case something in GApplication |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
683 | * has caused g_application_run() to finish on its own. This can |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
684 | * happen, for example, if the desktop session is ending. |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
685 | */ |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
686 | if (purple_get_core() != NULL) { |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
687 | purple_core_quit(); |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
688 | } |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
689 | |
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
690 | if (g_application_get_is_registered(app) && |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
691 | g_application_get_is_remote(app)) { |
|
39921
a9c92a82f4c8
Don't pass literals to g_set_error / g_error_new.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39857
diff
changeset
|
692 | g_printerr("%s\n", _("Exiting because another libpurple client is " |
|
a9c92a82f4c8
Don't pass literals to g_set_error / g_error_new.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39857
diff
changeset
|
693 | "already running.")); |
|
39256
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
694 | } |
|
0245b49e1231
libpidgin: Use GApplication command line argument parsing and uniqueness
Mike Ruprecht <cmaiku@gmail.com>
parents:
39255
diff
changeset
|
695 | |
|
38383
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
696 | /* Now that we're sure purple_core_quit() has been called, |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
697 | * this can be freed. |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
698 | */ |
|
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
699 | g_object_unref(app); |
|
10320
f5b0f5cf8562
[gaim-migrate @ 11527]
Mark Doliner <markdoliner@pidgin.im>
parents:
10317
diff
changeset
|
700 | |
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
701 | #ifndef _WIN32 |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
702 | g_free(segfault_message); |
|
29991
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
703 | g_source_remove(signal_channel_watcher); |
|
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
704 | close(signal_sockets[0]); |
|
37e306c31983
Try to be polite and free stuff associated with our signal watcher pipes
Mark Doliner <markdoliner@pidgin.im>
parents:
29662
diff
changeset
|
705 | close(signal_sockets[1]); |
|
38064
7cb860a7bb2e
libpidgin: Fix Win32 build due to lacking signalpair() and some enums
Mike Ruprecht <cmaiku@gmail.com>
parents:
38048
diff
changeset
|
706 | #endif |
|
12556
f4d4e4e3a825
[gaim-migrate @ 14875]
Richard Laager <rlaager@pidgin.im>
parents:
12409
diff
changeset
|
707 | |
| 10302 | 708 | #ifdef _WIN32 |
|
15574
18d9d1c05994
Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents:
15567
diff
changeset
|
709 | winpidgin_cleanup(); |
| 10302 | 710 | #endif |
| 711 | ||
|
38383
0ceb576f5617
libpidgin: Port to use GtkApplication
Mike Ruprecht <cmaiku@gmail.com>
parents:
38240
diff
changeset
|
712 | return ret; |
| 10302 | 713 | } |