gimp r25627 - in trunk: . app/core
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25627 - in trunk: . app/core
- Date: Sat, 10 May 2008 19:42:42 +0100 (BST)
Author: mitch
Date: Sat May 10 18:42:41 2008
New Revision: 25627
URL: http://svn.gnome.org/viewvc/gimp?rev=25627&view=rev
Log:
2008-05-10 Michael Natterer <mitch gimp org>
* app/core/gimplist.[ch]: add boolean "append" property which
makes gimp_container_add() append to the list instead of the
default prepend.
* app/core/gimp.c: create the display list with append = TRUE so
the images menu is in a proper order.
Modified:
trunk/ChangeLog
trunk/app/core/gimp.c
trunk/app/core/gimplist.c
trunk/app/core/gimplist.h
Modified: trunk/app/core/gimp.c
==============================================================================
--- trunk/app/core/gimp.c (original)
+++ trunk/app/core/gimp.c Sat May 10 18:42:41 2008
@@ -210,7 +210,11 @@
gimp->next_item_ID = 1;
gimp->item_table = g_hash_table_new (g_direct_hash, NULL);
- gimp->displays = gimp_list_new_weak (GIMP_TYPE_OBJECT, FALSE);
+ gimp->displays = g_object_new (GIMP_TYPE_LIST,
+ "children-type", GIMP_TYPE_OBJECT,
+ "policy", GIMP_CONTAINER_POLICY_WEAK,
+ "append", TRUE,
+ NULL);
gimp_object_set_static_name (GIMP_OBJECT (gimp->displays), "displays");
gimp->next_display_ID = 1;
Modified: trunk/app/core/gimplist.c
==============================================================================
--- trunk/app/core/gimplist.c (original)
+++ trunk/app/core/gimplist.c Sat May 10 18:42:41 2008
@@ -35,7 +35,8 @@
{
PROP_0,
PROP_UNIQUE_NAMES,
- PROP_SORT_FUNC
+ PROP_SORT_FUNC,
+ PROP_APPEND
};
@@ -116,6 +117,13 @@
NULL, NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
+
+ g_object_class_install_property (object_class, PROP_APPEND,
+ g_param_spec_boolean ("append",
+ NULL, NULL,
+ FALSE,
+ GIMP_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
}
static void
@@ -124,6 +132,7 @@
list->list = NULL;
list->unique_names = FALSE;
list->sort_func = NULL;
+ list->append = FALSE;
}
static void
@@ -142,6 +151,10 @@
case PROP_SORT_FUNC:
gimp_list_set_sort_func (list, g_value_get_pointer (value));
break;
+ case PROP_APPEND:
+ list->append = g_value_get_boolean (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -164,6 +177,10 @@
case PROP_SORT_FUNC:
g_value_set_pointer (value, list->sort_func);
break;
+ case PROP_APPEND:
+ g_value_set_boolean (value, list->append);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -209,6 +226,8 @@
if (list->sort_func)
list->list = g_list_insert_sorted (list->list, object, list->sort_func);
+ else if (list->append)
+ list->list = g_list_append (list->list, object);
else
list->list = g_list_prepend (list->list, object);
}
Modified: trunk/app/core/gimplist.h
==============================================================================
--- trunk/app/core/gimplist.h (original)
+++ trunk/app/core/gimplist.h Sat May 10 18:42:41 2008
@@ -43,6 +43,7 @@
GList *list;
gboolean unique_names;
GCompareFunc sort_func;
+ gboolean append;
};
struct _GimpListClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]