Mon, 30 Jun 2025 14:22:13 -0500
Update the flatpak to gnome 48 and to the matching birb version
The birb version was missed here when it was updated.
Testing Done:
Built the flatpak with the instructions in the readme.
Reviewed at https://reviews.imfreedom.org/r/4038/
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
1 | /* |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
| 5639 | 4 | * |
| 15884 | 5 | * Purple is the legal property of its developers, whose names are too numerous |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 8046 | 7 | * source distribution. |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
8 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
12 | * any later version. |
| 5639 | 13 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
17 | * more details. |
| 5639 | 18 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
| 5639 | 21 | */ |
|
18265
9f26190d7f46
Move the define in internal.h instead.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18190
diff
changeset
|
22 | |
|
40350
72271baf92bc
Split PurpleKeyValuePair out to it's own file and try to do some cleanup in the files that need to include it.
Gary Kramlich <grim@reaperworld.com>
parents:
40331
diff
changeset
|
23 | #include "prefs.h" |
|
39970
cc7d4ff5a205
rename accountopt.[ch] to purpleaccountoption.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39968
diff
changeset
|
24 | #include "purpleaccountoption.h" |
|
40350
72271baf92bc
Split PurpleKeyValuePair out to it's own file and try to do some cleanup in the files that need to include it.
Gary Kramlich <grim@reaperworld.com>
parents:
40331
diff
changeset
|
25 | #include "purplekeyvaluepair.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 | { |
|
39972
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
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 | |
|
42841
fbb5c5cb37f4
Modernize files that start with purplea
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
37 | char *text; /* The text that will appear to the user. */ |
|
fbb5c5cb37f4
Modernize files that start with purplea
Gary Kramlich <grim@reaperworld.com>
parents:
42767
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. */ |
|
42841
fbb5c5cb37f4
Modernize files that start with purplea
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
43 | int integer; /* The default integer value. */ |
|
fbb5c5cb37f4
Modernize files that start with purplea
Gary Kramlich <grim@reaperworld.com>
parents:
42767
diff
changeset
|
44 | char *string; /* The default string value. */ |
|
35470
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 | |
|
39972
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
62 | G_DEFINE_BOXED_TYPE( |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
63 | PurpleAccountOption, |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
64 | purple_account_option, |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
65 | purple_account_option_copy, |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
66 | purple_account_option_destroy |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
67 | ); |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
68 | |
| 15884 | 69 | PurpleAccountOption * |
| 70 | purple_account_option_new(PurplePrefType type, const char *text, | |
| 5639 | 71 | const char *pref_name) |
| 72 | { | |
| 15884 | 73 | PurpleAccountOption *option; |
| 5639 | 74 | |
| 15884 | 75 | g_return_val_if_fail(type != PURPLE_PREF_NONE, NULL); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
76 | g_return_val_if_fail(text != NULL, NULL); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
77 | g_return_val_if_fail(pref_name != NULL, NULL); |
| 5639 | 78 | |
| 15884 | 79 | option = g_new0(PurpleAccountOption, 1); |
| 5639 | 80 | |
| 81 | option->type = type; | |
| 82 | option->text = g_strdup(text); | |
| 83 | option->pref_name = g_strdup(pref_name); | |
| 84 | ||
| 85 | return option; | |
| 86 | } | |
| 87 | ||
| 15884 | 88 | PurpleAccountOption * |
|
39972
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
89 | purple_account_option_copy(PurpleAccountOption *option) { |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
90 | PurpleAccountOption *opt = NULL; |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
91 | |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
92 | g_return_val_if_fail(option, NULL); |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
93 | |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
94 | opt = g_new0(PurpleAccountOption, 1); |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
95 | *opt = *option; |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
96 | |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
97 | opt->text = g_strdup(option->text); |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
98 | opt->pref_name = g_strdup(option->pref_name); |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
99 | |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
100 | if(opt->type == PURPLE_PREF_STRING) { |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
101 | opt->default_value.string = g_strdup(option->default_value.string); |
|
39980
54284ab06efd
Fix some minor new warnings.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39972
diff
changeset
|
102 | opt->params.string.hints = g_slist_copy(option->params.string.hints); |
|
39972
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
103 | } |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
104 | |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
105 | return opt; |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
106 | } |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
107 | |
|
347a24c5363d
register PurpleAccountOption as a boxed type
Gary Kramlich <grim@reaperworld.com>
parents:
39970
diff
changeset
|
108 | PurpleAccountOption * |
| 15884 | 109 | purple_account_option_bool_new(const char *text, const char *pref_name, |
| 5639 | 110 | gboolean default_value) |
| 111 | { | |
| 15884 | 112 | PurpleAccountOption *option; |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
113 | |
| 15884 | 114 | option = purple_account_option_new(PURPLE_PREF_BOOLEAN, text, pref_name); |
| 5639 | 115 | |
| 116 | if (option == NULL) | |
| 117 | return NULL; | |
| 118 | ||
| 119 | option->default_value.boolean = default_value; | |
| 120 | ||
| 121 | return option; | |
| 122 | } | |
| 123 | ||
| 15884 | 124 | PurpleAccountOption * |
| 125 | purple_account_option_int_new(const char *text, const char *pref_name, | |
| 5639 | 126 | int default_value) |
| 127 | { | |
| 15884 | 128 | PurpleAccountOption *option; |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
129 | |
| 15884 | 130 | option = purple_account_option_new(PURPLE_PREF_INT, text, pref_name); |
| 5639 | 131 | |
| 132 | if (option == NULL) | |
| 133 | return NULL; | |
| 134 | ||
| 135 | option->default_value.integer = default_value; | |
| 136 | ||
| 137 | return option; | |
| 138 | } | |
| 139 | ||
| 15884 | 140 | PurpleAccountOption * |
| 141 | purple_account_option_string_new(const char *text, const char *pref_name, | |
| 5639 | 142 | const char *default_value) |
| 143 | { | |
| 15884 | 144 | PurpleAccountOption *option; |
|
6902
bf0a4376750f
[gaim-migrate @ 7449]
Christian Hammond <chipx86@chipx86.com>
parents:
5663
diff
changeset
|
145 | |
| 15884 | 146 | option = purple_account_option_new(PURPLE_PREF_STRING, text, pref_name); |
| 5639 | 147 | |
| 148 | if (option == NULL) | |
| 149 | return NULL; | |
| 150 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13234
diff
changeset
|
151 | option->default_value.string = g_strdup(default_value); |
| 5639 | 152 | |
| 153 | return option; | |
| 154 | } | |
| 155 | ||
| 15884 | 156 | PurpleAccountOption * |
| 157 | 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
|
158 | GList *list) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
159 | { |
| 15884 | 160 | PurpleAccountOption *option; |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
161 | |
| 15884 | 162 | 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
|
163 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
164 | if (option == NULL) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
165 | return NULL; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
166 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
167 | option->default_value.list = list; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
168 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
169 | return option; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
170 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
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 | { |
|
39897
16b440d4ab36
Use g_list_free_full instead of g_list_foreach+g_list_free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37144
diff
changeset
|
187 | g_list_free_full(option->default_value.list, |
|
40331
684befe3ae5d
Add purple_key_value_pair_new_full with free function for value in PurpleKeyValuePair
qarkai <qarkai@gmail.com>
parents:
40329
diff
changeset
|
188 | (GDestroyNotify)purple_key_value_pair_free); |
| 5639 | 189 | } |
| 190 | ||
| 191 | g_free(option); | |
| 192 | } | |
| 193 | ||
| 194 | void | |
| 15884 | 195 | purple_account_option_set_default_bool(PurpleAccountOption *option, |
| 5639 | 196 | gboolean value) |
| 197 | { | |
| 198 | g_return_if_fail(option != NULL); | |
| 15884 | 199 | g_return_if_fail(option->type == PURPLE_PREF_BOOLEAN); |
| 5639 | 200 | |
| 201 | option->default_value.boolean = value; | |
| 202 | } | |
| 203 | ||
| 204 | void | |
| 15884 | 205 | purple_account_option_set_default_int(PurpleAccountOption *option, int value) |
| 5639 | 206 | { |
| 207 | g_return_if_fail(option != NULL); | |
| 15884 | 208 | g_return_if_fail(option->type == PURPLE_PREF_INT); |
| 5639 | 209 | |
| 210 | option->default_value.integer = value; | |
| 211 | } | |
| 212 | ||
| 213 | void | |
| 15884 | 214 | purple_account_option_set_default_string(PurpleAccountOption *option, |
| 5639 | 215 | const char *value) |
| 216 | { | |
| 217 | g_return_if_fail(option != NULL); | |
| 15884 | 218 | g_return_if_fail(option->type == PURPLE_PREF_STRING); |
| 5639 | 219 | |
|
42767
8cf1d11b59c1
Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42594
diff
changeset
|
220 | g_set_str(&option->default_value.string, value); |
| 5639 | 221 | } |
| 222 | ||
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
223 | void |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
224 | purple_account_option_string_set_masked(PurpleAccountOption *option, gboolean masked) |
| 10658 | 225 | { |
| 226 | g_return_if_fail(option != NULL); | |
| 15884 | 227 | g_return_if_fail(option->type == PURPLE_PREF_STRING); |
| 10658 | 228 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
229 | option->params.string.masked = masked; |
| 10658 | 230 | } |
| 231 | ||
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
232 | void |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
233 | 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
|
234 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
235 | 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
|
236 | 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
|
237 | |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
238 | 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
|
239 | 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
|
240 | } |
| 10658 | 241 | |
| 242 | void | |
| 15884 | 243 | purple_account_option_set_list(PurpleAccountOption *option, GList *values) |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
244 | { |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
245 | g_return_if_fail(option != NULL); |
| 15884 | 246 | g_return_if_fail(option->type == PURPLE_PREF_STRING_LIST); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
247 | |
|
39897
16b440d4ab36
Use g_list_free_full instead of g_list_foreach+g_list_free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37144
diff
changeset
|
248 | g_list_free_full(option->default_value.list, |
|
40331
684befe3ae5d
Add purple_key_value_pair_new_full with free function for value in PurpleKeyValuePair
qarkai <qarkai@gmail.com>
parents:
40329
diff
changeset
|
249 | (GDestroyNotify)purple_key_value_pair_free); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
250 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
251 | option->default_value.list = values; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
252 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
253 | |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
254 | void |
| 15884 | 255 | purple_account_option_add_list_item(PurpleAccountOption *option, |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
256 | const char *key, const char *value) |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
257 | { |
| 15884 | 258 | PurpleKeyValuePair *kvp; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
259 | |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
260 | g_return_if_fail(option != NULL); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
261 | g_return_if_fail(key != NULL); |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
262 | g_return_if_fail(value != NULL); |
| 15884 | 263 | g_return_if_fail(option->type == PURPLE_PREF_STRING_LIST); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
264 | |
|
40331
684befe3ae5d
Add purple_key_value_pair_new_full with free function for value in PurpleKeyValuePair
qarkai <qarkai@gmail.com>
parents:
40329
diff
changeset
|
265 | kvp = purple_key_value_pair_new_full(key, g_strdup(value), g_free); |
|
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 | 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
|
268 | kvp); |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
269 | } |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
270 | |
| 15884 | 271 | 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
|
272 | purple_account_option_get_pref_type(const PurpleAccountOption *option) |
| 5639 | 273 | { |
| 15884 | 274 | g_return_val_if_fail(option != NULL, PURPLE_PREF_NONE); |
| 5639 | 275 | |
| 276 | return option->type; | |
| 277 | } | |
| 278 | ||
| 279 | const char * | |
| 15884 | 280 | purple_account_option_get_text(const PurpleAccountOption *option) |
| 5639 | 281 | { |
| 282 | g_return_val_if_fail(option != NULL, NULL); | |
| 283 | ||
| 284 | return option->text; | |
| 285 | } | |
| 286 | ||
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
287 | const char * |
| 15884 | 288 | purple_account_option_get_setting(const PurpleAccountOption *option) |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
289 | { |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
290 | g_return_val_if_fail(option != NULL, NULL); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
291 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
292 | return option->pref_name; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
293 | } |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5654
diff
changeset
|
294 | |
| 5639 | 295 | gboolean |
| 15884 | 296 | purple_account_option_get_default_bool(const PurpleAccountOption *option) |
| 5639 | 297 | { |
| 298 | g_return_val_if_fail(option != NULL, FALSE); | |
| 15884 | 299 | g_return_val_if_fail(option->type == PURPLE_PREF_BOOLEAN, FALSE); |
| 5639 | 300 | |
| 301 | return option->default_value.boolean; | |
| 302 | } | |
| 303 | ||
| 304 | int | |
| 15884 | 305 | purple_account_option_get_default_int(const PurpleAccountOption *option) |
| 5639 | 306 | { |
| 307 | g_return_val_if_fail(option != NULL, -1); | |
| 15884 | 308 | g_return_val_if_fail(option->type == PURPLE_PREF_INT, -1); |
| 5639 | 309 | |
| 310 | return option->default_value.integer; | |
| 311 | } | |
| 312 | ||
| 313 | const char * | |
| 15884 | 314 | purple_account_option_get_default_string(const PurpleAccountOption *option) |
| 5639 | 315 | { |
| 316 | g_return_val_if_fail(option != NULL, NULL); | |
| 15884 | 317 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING, NULL); |
| 5639 | 318 | |
| 319 | return option->default_value.string; | |
| 320 | } | |
| 321 | ||
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
322 | const char * |
| 15884 | 323 | purple_account_option_get_default_list_value(const PurpleAccountOption *option) |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
324 | { |
| 15884 | 325 | PurpleKeyValuePair *kvp; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
326 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
327 | g_return_val_if_fail(option != NULL, NULL); |
| 15884 | 328 | 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
|
329 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
330 | if (option->default_value.list == NULL) |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
331 | return NULL; |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
332 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
333 | kvp = option->default_value.list->data; |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
334 | |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
335 | return (kvp ? kvp->value : NULL); |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
336 | } |
|
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10658
diff
changeset
|
337 | |
| 10658 | 338 | gboolean |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
339 | purple_account_option_string_get_masked(const PurpleAccountOption *option) |
| 10658 | 340 | { |
| 341 | g_return_val_if_fail(option != NULL, FALSE); | |
| 15884 | 342 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING, FALSE); |
| 10658 | 343 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
344 | 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
|
345 | } |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
346 | |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
347 | const GSList * |
|
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_hints(const PurpleAccountOption *option) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
349 | { |
|
39980
54284ab06efd
Fix some minor new warnings.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39972
diff
changeset
|
350 | g_return_val_if_fail(option != NULL, NULL); |
|
54284ab06efd
Fix some minor new warnings.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39972
diff
changeset
|
351 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING, NULL); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
352 | |
|
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.hints; |
| 10658 | 354 | } |
| 355 | ||
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18099
diff
changeset
|
356 | GList * |
| 15884 | 357 | purple_account_option_get_list(const PurpleAccountOption *option) |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
358 | { |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
359 | g_return_val_if_fail(option != NULL, NULL); |
| 15884 | 360 | g_return_val_if_fail(option->type == PURPLE_PREF_STRING_LIST, NULL); |
| 5639 | 361 | |
|
8570
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
362 | return option->default_value.list; |
|
bce05cb55dbc
[gaim-migrate @ 9318]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
363 | } |