~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/imagemap/imap_mru.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
#include "imap_mru.h"
31
31
 
32
 
MRU_t* 
 
32
MRU_t*
33
33
mru_create(void)
34
34
{
35
35
   MRU_t *mru = g_new(MRU_t, 1);
38
38
   return mru;
39
39
}
40
40
 
41
 
void 
 
41
void
42
42
mru_destruct(MRU_t *mru)
43
43
{
44
44
   g_list_foreach(mru->list, (GFunc) g_free, NULL);
55
55
static GList*
56
56
mru_find_link(MRU_t *mru, const gchar *filename)
57
57
{
58
 
   return g_list_find_custom(mru->list, (gpointer) filename, 
 
58
   return g_list_find_custom(mru->list, (gpointer) filename,
59
59
                             (GCompareFunc) strcmp);
60
60
}
61
61
 
62
 
void 
 
62
void
63
63
mru_add(MRU_t *mru, const gchar *filename)
64
64
{
65
65
   if (g_list_length(mru->list) == mru->max_size)
67
67
   mru->list = g_list_prepend(mru->list, g_strdup(filename));
68
68
}
69
69
 
70
 
void 
 
70
void
71
71
mru_remove(MRU_t *mru, const gchar *filename)
72
72
{
73
73
   mru_remove_link(mru, mru_find_link(mru, filename));
78
78
{
79
79
   GList *link = mru_find_link(mru, filename);
80
80
   if (link)
81
 
      mru->list = g_list_prepend(g_list_remove_link(mru->list, link), 
 
81
      mru->list = g_list_prepend(g_list_remove_link(mru->list, link),
82
82
                                 link->data);
83
83
   else
84
84
      mru_add(mru, filename);
85
85
}
86
86
 
87
 
void 
 
87
void
88
88
mru_set_size(MRU_t *mru, gint size)
89
89
{
90
90
   gint diff;