Fix code style issues
This commit is contained in:
parent
8ed05f6315
commit
12ce8a7fd9
4 changed files with 27 additions and 30 deletions
|
@ -96,12 +96,10 @@ sort_languages (gconstpointer a,
|
|||
const gchar *la;
|
||||
const gchar *lb;
|
||||
|
||||
if (g_object_get_data (G_OBJECT (a), "locale-id") == NULL) {
|
||||
if (g_object_get_data (G_OBJECT (a), "locale-id") == NULL)
|
||||
return 1;
|
||||
}
|
||||
if (g_object_get_data (G_OBJECT (b), "locale-id") == NULL) {
|
||||
if (g_object_get_data (G_OBJECT (b), "locale-id") == NULL)
|
||||
return -1;
|
||||
}
|
||||
|
||||
la = g_object_get_data (G_OBJECT (a), "locale-name");
|
||||
lb = g_object_get_data (G_OBJECT (b), "locale-name");
|
||||
|
@ -145,9 +143,8 @@ language_widget_new (const gchar *locale_id,
|
|||
check = gtk_image_new ();
|
||||
g_object_set (check, "icon-size", GTK_ICON_SIZE_MENU, NULL);
|
||||
gtk_box_pack_start (GTK_BOX (widget), check, FALSE, FALSE, 0);
|
||||
if (g_strcmp0 (locale_id, current_locale_id) == 0) {
|
||||
if (g_strcmp0 (locale_id, current_locale_id) == 0)
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (check), "object-select-symbolic", GTK_ICON_SIZE_MENU);
|
||||
}
|
||||
|
||||
g_object_set_data (G_OBJECT (widget), "check", check);
|
||||
g_object_set_data_full (G_OBJECT (widget), "locale-id", g_strdup (locale_id), g_free);
|
||||
|
@ -346,14 +343,16 @@ child_activated (EggListBox *box,
|
|||
|
||||
if (child == NULL)
|
||||
return;
|
||||
else if (child == priv->no_results)
|
||||
|
||||
if (child == priv->no_results)
|
||||
return;
|
||||
else if (child == priv->more_item)
|
||||
|
||||
if (child == priv->more_item) {
|
||||
show_more (chooser);
|
||||
else {
|
||||
new_locale_id = g_object_get_data (G_OBJECT (child), "locale-id");
|
||||
set_locale_id (chooser, new_locale_id);
|
||||
return;
|
||||
}
|
||||
new_locale_id = g_object_get_data (G_OBJECT (child), "locale-id");
|
||||
set_locale_id (chooser, new_locale_id);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -106,9 +106,8 @@ update_format_examples (GtkDialog *chooser)
|
|||
setlocale (LC_MONETARY, priv->region);
|
||||
|
||||
num_info = localeconv ();
|
||||
if (num_info != NULL) {
|
||||
if (num_info != NULL)
|
||||
gtk_label_set_text (GTK_LABEL (priv->currency), num_info->currency_symbol);
|
||||
}
|
||||
|
||||
setlocale (LC_MONETARY, locale);
|
||||
g_free (locale);
|
||||
|
@ -191,12 +190,10 @@ sort_regions (gconstpointer a,
|
|||
const gchar *la;
|
||||
const gchar *lb;
|
||||
|
||||
if (g_object_get_data (G_OBJECT (a), "locale-id") == NULL) {
|
||||
if (g_object_get_data (G_OBJECT (a), "locale-id") == NULL)
|
||||
return 1;
|
||||
}
|
||||
if (g_object_get_data (G_OBJECT (b), "locale-id") == NULL) {
|
||||
if (g_object_get_data (G_OBJECT (b), "locale-id") == NULL)
|
||||
return -1;
|
||||
}
|
||||
|
||||
la = g_object_get_data (G_OBJECT (a), "locale-name");
|
||||
lb = g_object_get_data (G_OBJECT (b), "locale-name");
|
||||
|
@ -437,14 +434,16 @@ child_activated (EggListBox *box,
|
|||
|
||||
if (child == NULL)
|
||||
return;
|
||||
else if (child == priv->no_results)
|
||||
|
||||
if (child == priv->no_results)
|
||||
return;
|
||||
else if (child == priv->more_item)
|
||||
|
||||
if (child == priv->more_item) {
|
||||
show_more (chooser);
|
||||
else {
|
||||
new_locale_id = g_object_get_data (G_OBJECT (child), "locale-id");
|
||||
set_locale_id (chooser, new_locale_id);
|
||||
return;
|
||||
}
|
||||
new_locale_id = g_object_get_data (G_OBJECT (child), "locale-id");
|
||||
set_locale_id (chooser, new_locale_id);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#ifdef HAVE_IBUS
|
||||
#include <ibus.h>
|
||||
#include "cc-ibus-utils.h"
|
||||
#endif
|
||||
#endif /* HAVE_IBUS */
|
||||
|
||||
#define INPUT_SOURCE_TYPE_XKB "xkb"
|
||||
#define INPUT_SOURCE_TYPE_IBUS "ibus"
|
||||
|
@ -241,7 +241,7 @@ input_source_widget_new (GtkWidget *chooser,
|
|||
cc_util_normalize_casefold_and_unaccent (display_name), g_free);
|
||||
#else
|
||||
widget = NULL;
|
||||
#endif
|
||||
#endif /* HAVE_IBUS */
|
||||
}
|
||||
|
||||
if (widget)
|
||||
|
@ -573,7 +573,7 @@ strvs_differ (gchar **av,
|
|||
if (!g_str_equal (*a, *b))
|
||||
return TRUE;
|
||||
|
||||
if (!*a && !*b)
|
||||
if (*a == NULL && *b == NULL)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
@ -883,7 +883,7 @@ get_ibus_locale_infos (GtkWidget *chooser)
|
|||
g_free (lang_code);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* HAVE_IBUS */
|
||||
|
||||
static void
|
||||
add_locale_to_table (GHashTable *table,
|
||||
|
@ -1080,7 +1080,7 @@ cc_input_chooser_new (GtkWindow *main_window,
|
|||
get_locale_infos (chooser);
|
||||
#ifdef HAVE_IBUS
|
||||
get_ibus_locale_infos (chooser);
|
||||
#endif
|
||||
#endif /* HAVE_IBUS */
|
||||
show_locale_widgets (chooser);
|
||||
|
||||
/* Try to come up with a sensible width */
|
||||
|
@ -1107,7 +1107,7 @@ cc_input_chooser_set_ibus_engines (GtkWidget *chooser,
|
|||
priv->ibus_engines = ibus_engines;
|
||||
get_ibus_locale_infos (chooser);
|
||||
show_locale_widgets (chooser);
|
||||
#endif
|
||||
#endif /* HAVE_IBUS */
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
|
@ -121,9 +121,8 @@ update_shortcuts (GtkWidget *options)
|
|||
next = g_settings_get_strv (settings, "switch-input-source");
|
||||
|
||||
previous_shortcut = g_strdup (previous[0]);
|
||||
if (!previous_shortcut && next[0]) {
|
||||
if (!previous_shortcut && next[0])
|
||||
previous_shortcut = g_strconcat ("<Shift>", next[0], NULL);
|
||||
}
|
||||
|
||||
update_shortcut_label (priv->previous_source, previous_shortcut);
|
||||
update_shortcut_label (priv->next_source, next[0]);
|
||||
|
|
Loading…
Add table
Reference in a new issue