Mon, 10 Feb 2014 16:22:00 +0530
Merged default branch
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* purple |
| 5639 | 2 | * |
| 15884 | 3 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
6 | * |
| 5639 | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18265
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5639 | 20 | */ |
|
18265
9f26190d7f46
Move the define in internal.h instead.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18190
diff
changeset
|
21 | #include "internal.h" |
|
9f26190d7f46
Move the define in internal.h instead.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18190
diff
changeset
|
22 | |
| 5639 | 23 | #include "accountopt.h" |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
24 | #include "util.h" |
|
33369
4a43f6a6326b
Fix again, refs #15310
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33267
diff
changeset
|
25 | #include "glibcompat.h" |
| 5639 | 26 | |
|
35458
385156e1b493
Fix some gtk-doc warnings from account to connection
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
27 | /* |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
28 | * An option for an account. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
29 | * |
|
36691
92122af1f083
Some documentation updates with regard to 'protocol plugins' and 'protocols'
Ankit Vani <a@nevitus.org>
parents:
33369
diff
changeset
|
30 | * This is set by protocols, and appears in the account settings |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
31 | * dialogs. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
32 | */ |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
33 | struct _PurpleAccountOption |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
34 | { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
35 | PurplePrefType type; /* The type of value. */ |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
36 | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
37 | char *text; /* The text that will appear to the user. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
38 | char *pref_name; /* The name of the associated preference. */ |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
39 | |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
40 | union |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
41 | { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
42 | gboolean boolean; /* The default boolean value. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
43 | int integer; /* The default integer value. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
44 | char *string; /* The default string value. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
45 | GList *list; /* The default list value. */ |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
46 | |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
47 | } default_value; |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
48 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
49 | union |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
50 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
51 | struct |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
52 | { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
53 | gboolean masked; /* Whether the value entered should |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
54 | * be obscured from view (for |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
55 | * passwords and similar options) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
56 | */ |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
57 | GSList *hints; /* List of hinted values */ |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
58 | } string; |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
59 | } params; |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
60 | }; |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
61 | |
|
35458
385156e1b493
Fix some gtk-doc warnings from account to connection
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
62 | /* |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
63 | * A username split. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
64 | * |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
65 | * This is used by some protocols to separate the fields of the username |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
66 | * into more human-readable components. |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
67 | */ |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
68 | struct _PurpleAccountUserSplit |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
69 | { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
70 | char *text; /* The text that will appear to the user. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
71 | char *default_value; /* The default value. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
72 | char field_sep; /* The field separator. */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
73 | gboolean reverse; /* TRUE if the separator should be found |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
74 | starting a the end of the string, FALSE |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35458
diff
changeset
|
75 | otherwise */ |
|
32438
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
76 | }; |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
77 | |
|
dc8991868906
A boring and large patch so I can merge heads.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27977
diff
changeset
|
78 | |
| 15884 | 79 | PurpleAccountOption * |
| 80 | purple_account_option_new(PurplePrefType type, const char *text, | |
| 5639 | 81 | const char *pref_name) |
| 82 | { | |
| 15884 | 83 | PurpleAccountOption *option; |
| 5639 | 84 | |
| 15884 | 85 | g_return_val_if_fail(type != PURPLE_PREF_NONE, NULL); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
86 | g_return_val_if_fail(text != NULL, NULL); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
87 | g_return_val_if_fail(pref_name != NULL, NULL); |
| 5639 | 88 | |
| 15884 | 89 | option = g_new0(PurpleAccountOption, 1); |
| 5639 | 90 | |
| 91 | option->type = type; | |
| 92 | option->text = g_strdup(text); | |
| 93 | option->pref_name = g_strdup(pref_name); | |
| 94 | ||
| 95 | return option; | |
| 96 | } | |
| 97 | ||
| 15884 | 98 | PurpleAccountOption * |
| 99 | purple_account_option_bool_new(const char *text, const char *pref_name, | |
| 5639 | 100 | gboolean default_value) |
| 101 | { | |
| 15884 | 102 | PurpleAccountOption *option; |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
103 | |
| 15884 | 104 | option = purple_account_option_new(PURPLE_PREF_BOOLEAN, text, pref_name); |
| 5639 | 105 | |
| 106 | if (option == NULL) | |
| 107 | return NULL; | |
| 108 | ||
| 109 | option->default_value.boolean = default_value; | |
| 110 | ||
| 111 | return option; | |
| 112 | } | |
| 113 | ||
| 15884 | 114 | PurpleAccountOption * |
| 115 | purple_account_option_int_new(const char *text, const char *pref_name, | |
| 5639 | 116 | int default_value) |
| 117 | { | |
| 15884 | 118 | PurpleAccountOption *option; |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
119 | |
| 15884 | 120 | option = purple_account_option_new(PURPLE_PREF_INT, text, pref_name); |
| 5639 | 121 | |
| 122 | if (option == NULL) | |
| 123 | return NULL; | |
| 124 | ||
| 125 | option->default_value.integer = default_value; | |
| 126 | ||
| 127 | return option; | |
| 128 | } | |
| 129 | ||
| 15884 | 130 | PurpleAccountOption * |
| 131 | purple_account_option_string_new(const char *text, const char *pref_name, | |
| 5639 | 132 | const char *default_value) |
| 133 | { | |
| 15884 | 134 | PurpleAccountOption *option; |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
135 | |
| 15884 | 136 | option = purple_account_option_new(PURPLE_PREF_STRING, text, pref_name); |
| 5639 | 137 | |
| 138 | if (option == NULL) | |
| 139 | return NULL; | |
| 140 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
141 | option->default_value.string = g_strdup(default_value); |
| 5639 | 142 | |
| 143 | return option; | |
| 144 | } | |
| 145 | ||
| 15884 | 146 | PurpleAccountOption * |
| 147 | purple_account_option_list_new(const char *text, const char *pref_name, | |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
148 | GList *list) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
149 | { |
| 15884 | 150 | PurpleAccountOption *option; |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
151 | |
| 15884 | 152 | option = purple_account_option_new(PURPLE_PREF_STRING_LIST, text, pref_name); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
153 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
154 | if (option == NULL) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
155 | return NULL; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
156 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
157 | option->default_value.list = list; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
158 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
159 | return option; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
160 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
161 | |
|
27977
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
162 | static void |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
163 | purple_account_option_list_free(gpointer data, gpointer user_data) |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
164 | { |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
165 | PurpleKeyValuePair *kvp = data; |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
166 | |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
167 | g_free(kvp->value); |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
168 | g_free(kvp->key); |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
169 | g_free(kvp); |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
170 | } |
|
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
171 | |
| 5639 | 172 | void |
| 15884 | 173 | purple_account_option_destroy(PurpleAccountOption *option) |
| 5639 | 174 | { |
| 175 | g_return_if_fail(option != NULL); | |
| 176 | ||
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12172
diff
changeset
|
177 | g_free(option->text); |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12172
diff
changeset
|
178 | g_free(option->pref_name); |
| 5639 | 179 | |
| 15884 | 180 | if (option->type == PURPLE_PREF_STRING) |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
181 | { |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12172
diff
changeset
|
182 | g_free(option->default_value.string); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
183 | g_slist_free_full(option->params.string.hints, &g_free); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
184 | } |
| 15884 | 185 | else if (option->type == PURPLE_PREF_STRING_LIST) |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
186 | { |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
187 | if (option->default_value.list != NULL) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
188 | { |
|
27977
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
189 | g_list_foreach(option->default_value.list, purple_account_option_list_free, NULL); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
190 | g_list_free(option->default_value.list); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
191 | } |
| 5639 | 192 | } |
| 193 | ||
| 194 | g_free(option); | |
| 195 | } | |
| 196 | ||
| 197 | void | |
| 15884 | 198 | purple_account_option_set_default_bool(PurpleAccountOption *option, |
| 5639 | 199 | gboolean value) |
| 200 | { | |
| 201 | g_return_if_fail(option != NULL); | |
| 15884 | 202 | g_return_if_fail(option->type == PURPLE_PREF_BOOLEAN); |
| 5639 | 203 | |
| 204 | option->default_value.boolean = value; | |
| 205 | } | |
| 206 | ||
| 207 | void | |
| 15884 | 208 | purple_account_option_set_default_int(PurpleAccountOption *option, int value) |
| 5639 | 209 | { |
| 210 | g_return_if_fail(option != NULL); | |
| 15884 | 211 | g_return_if_fail(option->type == PURPLE_PREF_INT); |
| 5639 | 212 | |
| 213 | option->default_value.integer = value; | |
| 214 | } | |
| 215 | ||
| 216 | void | |
| 15884 | 217 | purple_account_option_set_default_string(PurpleAccountOption *option, |
| 5639 | 218 | const char *value) |
| 219 | { | |
| 220 | g_return_if_fail(option != NULL); | |
| 15884 | 221 | g_return_if_fail(option->type == PURPLE_PREF_STRING); |
| 5639 | 222 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
223 | g_free(option->default_value.string); |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
224 | option->default_value.string = g_strdup(value); |
| 5639 | 225 | } |
| 226 | ||
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
227 | void |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
228 | purple_account_option_string_set_masked(PurpleAccountOption *option, gboolean masked) |
| 10658 | 229 | { |
| 230 | g_return_if_fail(option != NULL); | |
| 15884 | 231 | g_return_if_fail(option->type == PURPLE_PREF_STRING); |
| 10658 | 232 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
233 | option->params.string.masked = masked; |
| 10658 | 234 | } |
| 235 | ||
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
236 | void |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
237 | purple_account_option_string_set_hints(PurpleAccountOption *option, GSList *hints) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
238 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
239 | g_return_if_fail(option != NULL); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
240 | g_return_if_fail(option->type == PURPLE_PREF_STRING); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
241 | |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
242 | g_slist_free_full(option->params.string.hints, &g_free); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
243 | option->params.string.hints = hints; |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
244 | } |
| 10658 | 245 | |
| 246 | void | |
| 15884 | 247 | purple_account_option_set_list(PurpleAccountOption *option, GList *values) |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
248 | { |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
249 | g_return_if_fail(option != NULL); |
| 15884 | 250 | g_return_if_fail(option->type == PURPLE_PREF_STRING_LIST); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
251 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
252 | if (option->default_value.list != NULL) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
253 | { |
|
27977
79edf3aeaac1
Free the KeyValuePairs associated with accountopt lists. Closes #9115.
Stefan Becker <stefan.becker@nokia.com>
parents:
20147
diff
changeset
|
254 | g_list_foreach(option->default_value.list, purple_account_option_list_free, NULL); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
255 | g_list_free(option->default_value.list); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
256 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
257 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
258 | option->default_value.list = values; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
259 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
260 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
261 | void |
| 15884 | 262 | purple_account_option_add_list_item(PurpleAccountOption *option, |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
263 | const char *key, const char *value) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
264 | { |
| 15884 | 265 | PurpleKeyValuePair *kvp; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
266 | |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
267 | g_return_if_fail(option != NULL); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
268 | g_return_if_fail(key != NULL); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
269 | g_return_if_fail(value != NULL); |
| 15884 | 270 | g_return_if_fail(option->type == PURPLE_PREF_STRING_LIST); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
271 | |
| 15884 | 272 | kvp = g_new0(PurpleKeyValuePair, 1); |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
273 | kvp->key = g_strdup(key); |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
274 | kvp->value = g_strdup(value); |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
275 | |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
276 | option->default_value.list = g_list_append(option->default_value.list, |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
277 | kvp); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
278 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
279 | |
| 15884 | 280 | PurplePrefType |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
33369
diff
changeset
|
281 | purple_account_option_get_pref_type(const PurpleAccountOption *option) |
| 5639 | 282 | { |
| 15884 | 283 | g_return_val_if_fail(option != NULL, PURPLE_PREF_NONE); |
| 5639 | 284 | |
| 285 | return option->type; | |
| 286 | } | |
| 287 | ||
| 288 | const char * | |
| 15884 | 289 | purple_account_option_get_text(const PurpleAccountOption *option) |
| 5639 | 290 | { |
| 291 | g_return_val_if_fail(option != NULL, NULL); | |
| 292 | ||
| 293 | return option->text; | |
| 294 | } | |
| 295 | ||
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
296 | const char * |
| 15884 | 297 | purple_account_option_get_setting(const PurpleAccountOption *option) |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
298 | { |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
299 | g_return_val_if_fail(option != NULL, NULL); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
300 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
301 | return option->pref_name; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
302 | } |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
303 | |
| 5639 | 304 | gboolean |
| 15884 | 305 | purple_account_option_get_default_bool(const PurpleAccountOption *option) |
| 5639 | 306 | { |
| 307 | g_return_val_if_fail(option != NULL, FALSE); | |
| 15884 | 308 | g_return_val_if_fail(option->type == PURPLE_PREF_BOOLEAN, FALSE); |
| 5639 | 309 | |
| 310 | return option->default_value.boolean; | |
| 311 | } | |
| 312 | ||
| 313 | int | |
| 15884 | 314 | purple_account_option_get_default_int(const PurpleAccountOption *option) |
| 5639 | 315 | { |
| 316 | g_return_val_if_fail(option != NULL, -1); | |
| 15884 | 317 | g_return_val_if_fail(option->type == PURPLE_PREF_INT, -1); |
| 5639 | 318 | |
| 319 | return option->default_value.integer; | |
| 320 | } | |
| 321 | ||
| 322 | const char * | |
| 15884 | 323 | purple_account_option_get_default_string(const PurpleAccountOption *option) |
| 5639 | 324 | { |
| 325 | g_return_val_if_fail(option != NULL, NULL); | |
| 15884 | 326 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING, NULL); |
| 5639 | 327 | |
| 328 | return option->default_value.string; | |
| 329 | } | |
| 330 | ||
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
331 | const char * |
| 15884 | 332 | purple_account_option_get_default_list_value(const PurpleAccountOption *option) |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
333 | { |
| 15884 | 334 | PurpleKeyValuePair *kvp; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
335 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
336 | g_return_val_if_fail(option != NULL, NULL); |
| 15884 | 337 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING_LIST, NULL); |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
338 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
339 | if (option->default_value.list == NULL) |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
340 | return NULL; |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
341 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
342 | kvp = option->default_value.list->data; |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
343 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
344 | return (kvp ? kvp->value : NULL); |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
345 | } |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
346 | |
| 10658 | 347 | gboolean |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
348 | purple_account_option_string_get_masked(const PurpleAccountOption *option) |
| 10658 | 349 | { |
| 350 | g_return_val_if_fail(option != NULL, FALSE); | |
| 15884 | 351 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING, FALSE); |
| 10658 | 352 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
353 | return option->params.string.masked; |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
354 | } |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
355 | |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
356 | const GSList * |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
357 | purple_account_option_string_get_hints(const PurpleAccountOption *option) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
358 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
359 | g_return_val_if_fail(option != NULL, FALSE); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
360 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING, FALSE); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
361 | |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
362 | return option->params.string.hints; |
| 10658 | 363 | } |
| 364 | ||
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18099
diff
changeset
|
365 | GList * |
| 15884 | 366 | purple_account_option_get_list(const PurpleAccountOption *option) |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
367 | { |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
368 | g_return_val_if_fail(option != NULL, NULL); |
| 15884 | 369 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING_LIST, NULL); |
| 5639 | 370 | |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
371 | return option->default_value.list; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
372 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
373 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
374 | /************************************************************************** |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
375 | * Account User Split API |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
376 | **************************************************************************/ |
| 15884 | 377 | PurpleAccountUserSplit * |
| 378 | purple_account_user_split_new(const char *text, const char *default_value, | |
| 5639 | 379 | char sep) |
| 380 | { | |
| 15884 | 381 | PurpleAccountUserSplit *split; |
| 5639 | 382 | |
| 383 | g_return_val_if_fail(text != NULL, NULL); | |
| 384 | g_return_val_if_fail(sep != 0, NULL); | |
| 385 | ||
| 15884 | 386 | split = g_new0(PurpleAccountUserSplit, 1); |
| 5639 | 387 | |
| 388 | split->text = g_strdup(text); | |
| 389 | split->field_sep = sep; | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
390 | split->default_value = g_strdup(default_value); |
|
18099
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
391 | split->reverse = TRUE; |
| 5639 | 392 | |
| 393 | return split; | |
| 394 | } | |
| 395 | ||
| 396 | void | |
| 15884 | 397 | purple_account_user_split_destroy(PurpleAccountUserSplit *split) |
| 5639 | 398 | { |
| 399 | g_return_if_fail(split != NULL); | |
| 400 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
401 | g_free(split->text); |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
402 | g_free(split->default_value); |
| 5639 | 403 | g_free(split); |
| 404 | } | |
| 405 | ||
| 406 | const char * | |
| 15884 | 407 | purple_account_user_split_get_text(const PurpleAccountUserSplit *split) |
|
5654
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
408 | { |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
409 | g_return_val_if_fail(split != NULL, NULL); |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
410 | |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
411 | return split->text; |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
412 | } |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
413 | |
|
3a0e6dba1c2f
[gaim-migrate @ 6068]
Christian Hammond <chipx86@chipx86.com>
parents:
5639
diff
changeset
|
414 | const char * |
| 15884 | 415 | purple_account_user_split_get_default_value(const PurpleAccountUserSplit *split) |
| 5639 | 416 | { |
| 417 | g_return_val_if_fail(split != NULL, NULL); | |
| 418 | ||
| 419 | return split->default_value; | |
| 420 | } | |
| 421 | ||
| 422 | char | |
| 15884 | 423 | purple_account_user_split_get_separator(const PurpleAccountUserSplit *split) |
| 5639 | 424 | { |
| 425 | g_return_val_if_fail(split != NULL, 0); | |
| 426 | ||
| 427 | return split->field_sep; | |
| 428 | } | |
|
18099
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
429 | |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
430 | gboolean |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
431 | purple_account_user_split_get_reverse(const PurpleAccountUserSplit *split) |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
432 | { |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
433 | g_return_val_if_fail(split != NULL, FALSE); |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
434 | |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
435 | return split->reverse; |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
436 | } |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
437 | |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
438 | void |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
439 | purple_account_user_split_set_reverse(PurpleAccountUserSplit *split, gboolean reverse) |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
440 | { |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
441 | g_return_if_fail(split != NULL); |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
442 | |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
443 | split->reverse = reverse; |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
444 | } |