X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkprinteroptionset.c;h=4041462c220c6531176122e507d9bc15b48b3390;hb=b2340254109d8599244c875fe7bc5e234f64da08;hp=8d097fc293fcc47e970ef49cb910cc7d8a210a03;hpb=fce9c8b7d45145c4556650843218e0b76c065c18;p=~andy%2Fgtk diff --git a/gtk/gtkprinteroptionset.c b/gtk/gtkprinteroptionset.c index 8d097fc29..4041462c2 100644 --- a/gtk/gtkprinteroptionset.c +++ b/gtk/gtkprinteroptionset.c @@ -1,4 +1,4 @@ -/* GTK - The GTK+ Toolkit +/* GTK - The GIMP Toolkit * gtkprintbackend.h: Abstract printer backend interfaces * Copyright (C) 2006, Red Hat, Inc. * @@ -13,9 +13,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #include "config.h" @@ -24,7 +22,6 @@ #include #include "gtkprinteroptionset.h" -#include "gtkalias.h" /***************************************** * GtkPrinterOptionSet * @@ -144,17 +141,11 @@ gtk_printer_option_set_clear_conflicts (GtkPrinterOptionSet *set) NULL); } -static int -safe_strcmp (const char *a, const char *b) -{ - if (a == NULL) - a = ""; - if (b == NULL) - b = ""; - - return strcmp (a, b); -} - +/** + * gtk_printer_option_set_get_groups: + * + * Return value: (element-type utf8) (transfer full): + */ GList * gtk_printer_option_set_get_groups (GtkPrinterOptionSet *set) { @@ -166,7 +157,7 @@ gtk_printer_option_set_get_groups (GtkPrinterOptionSet *set) { option = g_ptr_array_index (set->array, i); - if (g_list_find_custom (list, option->group, (GCompareFunc)safe_strcmp) == NULL) + if (g_list_find_custom (list, option->group, (GCompareFunc)g_strcmp0) == NULL) list = g_list_prepend (list, g_strdup (option->group)); } @@ -186,8 +177,7 @@ gtk_printer_option_set_foreach_in_group (GtkPrinterOptionSet *set, { option = g_ptr_array_index (set->array, i); - if (group == NULL || - (option->group != NULL && strcmp (group, option->group) == 0)) + if (group == NULL || g_strcmp0 (group, option->group) == 0) func (option, user_data); } } @@ -199,7 +189,3 @@ gtk_printer_option_set_foreach (GtkPrinterOptionSet *set, { gtk_printer_option_set_foreach_in_group (set, NULL, func, user_data); } - - -#define __GTK_PRINTER_OPTION_SET_C__ -#include "gtkaliasdef.c"