Commit da272486 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

removed redundant "Gimp" parameter, cleanup.

2003-09-09  Michael Natterer  <mitch@gimp.org>

	* app/gui/menus.c (menus_last_opened_add): removed redundant
	"Gimp" parameter, cleanup.

	* app/gui/image-menu.c (image_menu_setup)
	* app/gui/toolbox-menu.c (toolbox_menu_setup): changed accordingly.
parent 253121ea
2003-09-09 Michael Natterer <mitch@gimp.org>
* app/gui/menus.c (menus_last_opened_add): removed redundant
"Gimp" parameter, cleanup.
* app/gui/image-menu.c (image_menu_setup)
* app/gui/toolbox-menu.c (toolbox_menu_setup): changed accordingly.
2003-09-09 Michael Natterer <mitch@gimp.org>
Got rid of the last global variables except the_gimp:
......@@ -1103,7 +1103,7 @@ image_menu_setup (GimpItemFactory *factory)
"/filters-separator", FALSE);
}
menus_last_opened_add (factory, factory->gimp);
menus_last_opened_add (factory);
/* create tool menu items */
{
......
......@@ -287,16 +287,20 @@ menus_clear (Gimp *gimp)
}
void
menus_last_opened_add (GimpItemFactory *item_factory,
Gimp *gimp)
menus_last_opened_add (GimpItemFactory *item_factory)
{
GimpItemFactoryEntry *last_opened_entries;
gint n_last_opened_entries;
gint i;
gint n = GIMP_GUI_CONFIG (gimp->config)->last_opened_size;
last_opened_entries = g_new (GimpItemFactoryEntry, n);
g_return_if_fail (GIMP_IS_ITEM_FACTORY (item_factory));
for (i = 0; i < n; i++)
n_last_opened_entries =
GIMP_GUI_CONFIG (item_factory->gimp->config)->last_opened_size;
last_opened_entries = g_new (GimpItemFactoryEntry, n_last_opened_entries);
for (i = 0; i < n_last_opened_entries; i++)
{
last_opened_entries[i].entry.path =
g_strdup_printf ("/File/Open Recent/%02d", i + 1);
......@@ -317,14 +321,14 @@ menus_last_opened_add (GimpItemFactory *item_factory,
}
gimp_item_factory_create_items (item_factory,
n, last_opened_entries,
gimp, 2, TRUE, FALSE);
n_last_opened_entries, last_opened_entries,
item_factory->gimp, 2, TRUE, FALSE);
gimp_item_factory_set_sensitive (GTK_ITEM_FACTORY (item_factory),
"/File/Open Recent/(None)",
FALSE);
for (i = 0; i < n; i++)
for (i = 0; i < n_last_opened_entries; i++)
{
GtkWidget *widget;
......@@ -343,17 +347,17 @@ menus_last_opened_add (GimpItemFactory *item_factory,
g_free (last_opened_entries);
g_signal_connect_object (gimp->documents, "add",
g_signal_connect_object (item_factory->gimp->documents, "add",
G_CALLBACK (menus_last_opened_update),
item_factory, 0);
g_signal_connect_object (gimp->documents, "remove",
g_signal_connect_object (item_factory->gimp->documents, "remove",
G_CALLBACK (menus_last_opened_update),
item_factory, 0);
g_signal_connect_object (gimp->documents, "reorder",
g_signal_connect_object (item_factory->gimp->documents, "reorder",
G_CALLBACK (menus_last_opened_reorder),
item_factory, 0);
menus_last_opened_update (gimp->documents, NULL, item_factory);
menus_last_opened_update (item_factory->gimp->documents, NULL, item_factory);
}
void
......
......@@ -36,8 +36,7 @@ void menus_restore (Gimp *gimp);
void menus_save (Gimp *gimp);
void menus_clear (Gimp *gimp);
void menus_last_opened_add (GimpItemFactory *item_factory,
Gimp *gimp);
void menus_last_opened_add (GimpItemFactory *item_factory);
void menus_filters_subdirs_to_top (GtkMenu *menu);
......
......@@ -284,7 +284,7 @@ toolbox_menu_setup (GimpItemFactory *factory)
GList *list;
gint i, pos;
menus_last_opened_add (factory, factory->gimp);
menus_last_opened_add (factory);
plug_in_menus_create (factory, factory->gimp->plug_in_proc_defs);
......
......@@ -1103,7 +1103,7 @@ image_menu_setup (GimpItemFactory *factory)
"/filters-separator", FALSE);
}
menus_last_opened_add (factory, factory->gimp);
menus_last_opened_add (factory);
/* create tool menu items */
{
......
......@@ -287,16 +287,20 @@ menus_clear (Gimp *gimp)
}
void
menus_last_opened_add (GimpItemFactory *item_factory,
Gimp *gimp)
menus_last_opened_add (GimpItemFactory *item_factory)
{
GimpItemFactoryEntry *last_opened_entries;
gint n_last_opened_entries;
gint i;
gint n = GIMP_GUI_CONFIG (gimp->config)->last_opened_size;
last_opened_entries = g_new (GimpItemFactoryEntry, n);
g_return_if_fail (GIMP_IS_ITEM_FACTORY (item_factory));
for (i = 0; i < n; i++)
n_last_opened_entries =
GIMP_GUI_CONFIG (item_factory->gimp->config)->last_opened_size;
last_opened_entries = g_new (GimpItemFactoryEntry, n_last_opened_entries);
for (i = 0; i < n_last_opened_entries; i++)
{
last_opened_entries[i].entry.path =
g_strdup_printf ("/File/Open Recent/%02d", i + 1);
......@@ -317,14 +321,14 @@ menus_last_opened_add (GimpItemFactory *item_factory,
}
gimp_item_factory_create_items (item_factory,
n, last_opened_entries,
gimp, 2, TRUE, FALSE);
n_last_opened_entries, last_opened_entries,
item_factory->gimp, 2, TRUE, FALSE);
gimp_item_factory_set_sensitive (GTK_ITEM_FACTORY (item_factory),
"/File/Open Recent/(None)",
FALSE);
for (i = 0; i < n; i++)
for (i = 0; i < n_last_opened_entries; i++)
{
GtkWidget *widget;
......@@ -343,17 +347,17 @@ menus_last_opened_add (GimpItemFactory *item_factory,
g_free (last_opened_entries);
g_signal_connect_object (gimp->documents, "add",
g_signal_connect_object (item_factory->gimp->documents, "add",
G_CALLBACK (menus_last_opened_update),
item_factory, 0);
g_signal_connect_object (gimp->documents, "remove",
g_signal_connect_object (item_factory->gimp->documents, "remove",
G_CALLBACK (menus_last_opened_update),
item_factory, 0);
g_signal_connect_object (gimp->documents, "reorder",
g_signal_connect_object (item_factory->gimp->documents, "reorder",
G_CALLBACK (menus_last_opened_reorder),
item_factory, 0);
menus_last_opened_update (gimp->documents, NULL, item_factory);
menus_last_opened_update (item_factory->gimp->documents, NULL, item_factory);
}
void
......
......@@ -36,8 +36,7 @@ void menus_restore (Gimp *gimp);
void menus_save (Gimp *gimp);
void menus_clear (Gimp *gimp);
void menus_last_opened_add (GimpItemFactory *item_factory,
Gimp *gimp);
void menus_last_opened_add (GimpItemFactory *item_factory);
void menus_filters_subdirs_to_top (GtkMenu *menu);
......
......@@ -284,7 +284,7 @@ toolbox_menu_setup (GimpItemFactory *factory)
GList *list;
gint i, pos;
menus_last_opened_add (factory, factory->gimp);
menus_last_opened_add (factory);
plug_in_menus_create (factory, factory->gimp->plug_in_proc_defs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment