Formatting fixes

This commit is contained in:
Matthias Clasen
2014-12-23 18:37:28 -05:00
parent 79ada68f8c
commit a7cf67f201

View File

@ -1,5 +1,4 @@
/* /* gtkappchooserbutton.c: an app-chooser combobox
* gtkappchooserbutton.h: an app-chooser combobox
* *
* Copyright (C) 2010 Red Hat, Inc. * Copyright (C) 2010 Red Hat, Inc.
* *
@ -172,7 +171,8 @@ select_application_func_cb (GtkTreeModel *model,
gpointer user_data) gpointer user_data)
{ {
SelectAppData *data = user_data; SelectAppData *data = user_data;
GAppInfo *app_to_match = data->info, *app = NULL; GAppInfo *app_to_match = data->info;
GAppInfo *app = NULL;
gboolean custom; gboolean custom;
gboolean result; gboolean result;
@ -251,7 +251,8 @@ other_application_item_activated_cb (GtkAppChooserButton *self)
GtkWindow *toplevel; GtkWindow *toplevel;
toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))); toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self)));
dialog = gtk_app_chooser_dialog_new_for_content_type (toplevel, GTK_DIALOG_DESTROY_WITH_PARENT, dialog = gtk_app_chooser_dialog_new_for_content_type (toplevel,
GTK_DIALOG_DESTROY_WITH_PARENT,
self->priv->content_type); self->priv->content_type);
gtk_window_set_modal (GTK_WINDOW (dialog), gtk_window_get_modal (toplevel)); gtk_window_set_modal (GTK_WINDOW (dialog), gtk_window_get_modal (toplevel));
@ -575,7 +576,6 @@ gtk_app_chooser_button_finalize (GObject *obj)
g_hash_table_destroy (self->priv->custom_item_names); g_hash_table_destroy (self->priv->custom_item_names);
g_free (self->priv->content_type); g_free (self->priv->content_type);
g_free (self->priv->heading); g_free (self->priv->heading);
g_object_unref (self->priv->store); g_object_unref (self->priv->store);
G_OBJECT_CLASS (gtk_app_chooser_button_parent_class)->finalize (obj); G_OBJECT_CLASS (gtk_app_chooser_button_parent_class)->finalize (obj);
@ -636,7 +636,6 @@ gtk_app_chooser_button_class_init (GtkAppChooserButtonClass *klass)
G_PARAM_READWRITE|G_PARAM_CONSTRUCT|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY); G_PARAM_READWRITE|G_PARAM_CONSTRUCT|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_property (oclass, PROP_SHOW_DEFAULT_ITEM, pspec); g_object_class_install_property (oclass, PROP_SHOW_DEFAULT_ITEM, pspec);
/** /**
* GtkAppChooserButton:heading: * GtkAppChooserButton:heading:
* *
@ -650,7 +649,6 @@ gtk_app_chooser_button_class_init (GtkAppChooserButtonClass *klass)
G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY); G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_property (oclass, PROP_HEADING, pspec); g_object_class_install_property (oclass, PROP_HEADING, pspec);
/** /**
* GtkAppChooserButton::custom-item-activated: * GtkAppChooserButton::custom-item-activated:
* @self: the object which received the signal * @self: the object which received the signal
@ -676,9 +674,7 @@ gtk_app_chooser_button_init (GtkAppChooserButton *self)
{ {
self->priv = gtk_app_chooser_button_get_instance_private (self); self->priv = gtk_app_chooser_button_get_instance_private (self);
self->priv->custom_item_names = self->priv->custom_item_names =
g_hash_table_new_full (g_str_hash, g_str_equal, g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
g_free, NULL);
self->priv->store = gtk_list_store_new (NUM_COLUMNS, self->priv->store = gtk_list_store_new (NUM_COLUMNS,
G_TYPE_APP_INFO, G_TYPE_APP_INFO,
G_TYPE_STRING, /* name */ G_TYPE_STRING, /* name */
@ -696,8 +692,7 @@ app_chooser_button_iter_from_custom_name (GtkAppChooserButton *self,
GtkTreeIter iter; GtkTreeIter iter;
gchar *custom_name = NULL; gchar *custom_name = NULL;
if (!gtk_tree_model_get_iter_first if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (self->priv->store), &iter))
(GTK_TREE_MODEL (self->priv->store), &iter))
return FALSE; return FALSE;
do { do {
@ -729,8 +724,7 @@ real_insert_custom_item (GtkAppChooserButton *self,
{ {
if (custom) if (custom)
{ {
if (g_hash_table_lookup (self->priv->custom_item_names, if (g_hash_table_lookup (self->priv->custom_item_names, name) != NULL)
name) != NULL)
{ {
g_warning ("Attempting to add custom item %s to GtkAppChooserButton, " g_warning ("Attempting to add custom item %s to GtkAppChooserButton, "
"when there's already an item with the same name", name); "when there's already an item with the same name", name);
@ -855,11 +849,10 @@ gtk_app_chooser_button_set_active_custom_item (GtkAppChooserButton *self,
g_return_if_fail (GTK_IS_APP_CHOOSER_BUTTON (self)); g_return_if_fail (GTK_IS_APP_CHOOSER_BUTTON (self));
g_return_if_fail (name != NULL); g_return_if_fail (name != NULL);
if (g_hash_table_lookup (self->priv->custom_item_names, name) == NULL || if (!g_hash_table_contains (self->priv->custom_item_names, name) ||
!app_chooser_button_iter_from_custom_name (self, name, &iter)) !app_chooser_button_iter_from_custom_name (self, name, &iter))
{ {
g_warning ("Can't find the item named %s in the app chooser.", g_warning ("Can't find the item named %s in the app chooser.", name);
name);
return; return;
} }