~ubuntu-branches/ubuntu/gutsy/gimp/gutsy

« back to all changes in this revision

Viewing changes to app/config/gimprc-unknown.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-06-22 17:33:56 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070622173356-ncevaebpjiwyxkif
Tags: 2.3.18-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/control: Maintainer change.
  - debian/patches/02_help-message.patch,
    debian/patches/03_gimp.desktop.in.in.patch,
    debian/patches/10_dont_show_wizard.patch: Distro patches.
  - debian/rules:
    - use dh_iconcache,
    - i18n magic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
  if (!value)
113
113
    return;
114
114
 
115
 
  token = g_new (GimpConfigToken, 1);
 
115
  token = g_slice_new (GimpConfigToken);
116
116
  token->key   = g_strdup (key);
117
117
  token->value = g_strdup (value);
118
118
 
127
127
      g_object_set_data_full (G_OBJECT (config),
128
128
                              GIMP_RC_UNKNOWN_TOKENS,
129
129
                              unknown_tokens,
130
 
             (GDestroyNotify) gimp_rc_destroy_unknown_tokens);
 
130
                              (GDestroyNotify) gimp_rc_destroy_unknown_tokens);
131
131
    }
132
132
}
133
133
 
146
146
gimp_rc_lookup_unknown_token (GimpConfig  *config,
147
147
                              const gchar *key)
148
148
{
149
 
  GimpConfigToken *token;
150
149
  GSList          *unknown_tokens;
151
150
  GSList          *list;
152
151
 
153
152
  g_return_val_if_fail (GIMP_IS_CONFIG (config), NULL);
154
153
  g_return_val_if_fail (key != NULL, NULL);
155
154
 
156
 
  unknown_tokens = (GSList *) g_object_get_data (G_OBJECT (config),
157
 
                                                 GIMP_RC_UNKNOWN_TOKENS);
 
155
  unknown_tokens = g_object_get_data (G_OBJECT (config),
 
156
                                      GIMP_RC_UNKNOWN_TOKENS);
158
157
 
159
158
  for (list = unknown_tokens; list; list = g_slist_next (list))
160
159
    {
161
 
      token = (GimpConfigToken *) list->data;
 
160
      GimpConfigToken *token = list->data;
162
161
 
163
162
      if (strcmp (token->key, key) == 0)
164
163
        return token->value;
181
180
                               GimpConfigForeachFunc  func,
182
181
                               gpointer               user_data)
183
182
{
184
 
  GimpConfigToken *token;
185
 
  GSList          *unknown_tokens;
186
 
  GSList          *list;
 
183
  GSList *unknown_tokens;
 
184
  GSList *list;
187
185
 
188
186
  g_return_if_fail (GIMP_IS_CONFIG (config));
189
187
  g_return_if_fail (func != NULL);
190
188
 
191
 
  unknown_tokens = (GSList *) g_object_get_data (G_OBJECT (config),
192
 
                                                 GIMP_RC_UNKNOWN_TOKENS);
 
189
  unknown_tokens = g_object_get_data (G_OBJECT (config),
 
190
                                      GIMP_RC_UNKNOWN_TOKENS);
193
191
 
194
192
  for (list = unknown_tokens; list; list = g_slist_next (list))
195
193
    {
196
 
      token = (GimpConfigToken *) list->data;
 
194
      GimpConfigToken *token = list->data;
197
195
 
198
196
      func (token->key, token->value, user_data);
199
197
    }
202
200
static void
203
201
gimp_rc_destroy_unknown_tokens (GSList *unknown_tokens)
204
202
{
205
 
  GimpConfigToken *token;
206
 
  GSList          *list;
 
203
  GSList *list;
207
204
 
208
205
  for (list = unknown_tokens; list; list = g_slist_next (list))
209
206
    {
210
 
      token = (GimpConfigToken *) list->data;
 
207
      GimpConfigToken *token = list->data;
211
208
 
212
209
      g_free (token->key);
213
210
      g_free (token->value);
214
 
      g_free (token);
 
211
      g_slice_free (GimpConfigToken, token);
215
212
    }
216
213
 
217
214
  g_slist_free (unknown_tokens);