Fix some mistakes.

This commit is contained in:
Daiki Ueno
2011-09-15 17:40:47 +09:00
parent 953c35bdac
commit aca9a4dcb6
6 changed files with 34 additions and 33 deletions

View File

@ -360,8 +360,9 @@ eekboard_client_destroy_context (EekboardClient *client,
g_return_if_fail (EEKBOARD_IS_CLIENT(client)); g_return_if_fail (EEKBOARD_IS_CLIENT(client));
g_return_if_fail (EEKBOARD_IS_CONTEXT(context)); g_return_if_fail (EEKBOARD_IS_CONTEXT(context));
send_destroy_context (client, context, cancellable);
priv = EEKBOARD_CLIENT_GET_PRIVATE(client); priv = EEKBOARD_CLIENT_GET_PRIVATE(client);
object_path = g_dbus_proxy_get_object_path (G_DBUS_PROXY(context));
g_hash_table_remove (priv->context_hash, object_path); g_hash_table_remove (priv->context_hash, object_path);
send_destroy_context (client, context, cancellable);
} }

View File

@ -103,17 +103,17 @@ enum FocusListenerType {
}; };
static gboolean static gboolean
set_keyboards (Client *client, set_keyboards (Client *client,
gchar **keyboards) const gchar * const *keyboards)
{ {
if (g_strv_length (keyboards) == 0) { if (g_strv_length ((gchar **)keyboards) == 0) {
if (!client_enable_xkl (client)) { if (!client_enable_xkl (client)) {
g_printerr ("Can't register xklavier event listeners\n"); g_printerr ("Can't register xklavier event listeners\n");
return FALSE; return FALSE;
} }
} else { } else {
if (!client_set_keyboards (client, keyboards)) { if (!client_set_keyboards (client, keyboards)) {
gchar *str = g_strjoinv (", ", keyboards); gchar *str = g_strjoinv (", ", (gchar **)keyboards);
g_printerr ("Can't set keyboards \"%s\"\n", str); g_printerr ("Can't set keyboards \"%s\"\n", str);
g_free (str); g_free (str);
return FALSE; return FALSE;
@ -315,7 +315,7 @@ main (int argc, char **argv)
g_object_unref (eekboard); g_object_unref (eekboard);
keyboards = g_settings_get_strv (settings, "keyboards"); keyboards = g_settings_get_strv (settings, "keyboards");
if (!set_keyboards (client, keyboards)) { if (!set_keyboards (client, (const gchar * const *)keyboards)) {
g_strfreev (keyboards); g_strfreev (keyboards);
retval = 1; retval = 1;
goto out; goto out;

View File

@ -128,7 +128,7 @@ static gboolean keystroke_listener_cb (const AtspiDeviceEvent *stroke,
void *user_data); void *user_data);
#endif /* HAVE_ATSPI */ #endif /* HAVE_ATSPI */
static gboolean set_keyboards (Client *client, static gboolean set_keyboards (Client *client,
const gchar **keyboard); const gchar * const *keyboard);
static gboolean set_keyboards_from_xkl static gboolean set_keyboards_from_xkl
(Client *client); (Client *client);
#ifdef HAVE_XTEST #ifdef HAVE_XTEST
@ -298,8 +298,8 @@ client_init (Client *client)
} }
gboolean gboolean
client_set_keyboards (Client *client, client_set_keyboards (Client *client,
const gchar **keyboards) const gchar * const *keyboards)
{ {
gboolean retval; gboolean retval;
retval = set_keyboards (client, keyboards); retval = set_keyboards (client, keyboards);
@ -707,11 +707,11 @@ on_xkl_config_changed (XklEngine *xklengine,
} }
static gboolean static gboolean
set_keyboards (Client *client, set_keyboards (Client *client,
const gchar **keyboards) const gchar * const *keyboards)
{ {
guint keyboard_id; guint keyboard_id;
gchar **p; const gchar * const *p;
GSList *head = NULL; GSList *head = NULL;
if (client->keyboards) if (client->keyboards)
@ -955,7 +955,7 @@ send_fake_key_events (Client *client,
/* If symbol is a text, convert chars in it to keysym */ /* If symbol is a text, convert chars in it to keysym */
if (EEK_IS_TEXT(symbol)) { if (EEK_IS_TEXT(symbol)) {
gchar *utf8 = eek_text_get_text (EEK_TEXT(symbol)); const gchar *utf8 = eek_text_get_text (EEK_TEXT(symbol));
glong items_written; glong items_written;
gunichar *ucs4 = g_utf8_to_ucs4_fast (utf8, -1, &items_written); gunichar *ucs4 = g_utf8_to_ucs4_fast (utf8, -1, &items_written);
gint i; gint i;

View File

@ -31,25 +31,25 @@ G_BEGIN_DECLS
typedef struct _Client Client; typedef struct _Client Client;
Client *client_new (GDBusConnection *connection); Client *client_new (GDBusConnection *connection);
gboolean client_set_keyboards (Client *client, gboolean client_set_keyboards (Client *client,
const gchar **keyboard); const gchar * const *keyboard);
gboolean client_enable_xkl (Client *client); gboolean client_enable_xkl (Client *client);
void client_disable_xkl (Client *client); void client_disable_xkl (Client *client);
gboolean client_enable_atspi_focus (Client *client); gboolean client_enable_atspi_focus (Client *client);
void client_disable_atspi_focus (Client *client); void client_disable_atspi_focus (Client *client);
gboolean client_enable_atspi_keystroke (Client *client); gboolean client_enable_atspi_keystroke (Client *client);
void client_disable_atspi_keystroke (Client *client); void client_disable_atspi_keystroke (Client *client);
gboolean client_enable_xtest (Client *client); gboolean client_enable_xtest (Client *client);
void client_disable_xtest (Client *client); void client_disable_xtest (Client *client);
gboolean client_enable_ibus_focus (Client *client); gboolean client_enable_ibus_focus (Client *client);
void client_disable_ibus_focus (Client *client); void client_disable_ibus_focus (Client *client);
G_END_DECLS G_END_DECLS
#endif /* CLIENT_H */ #endif /* CLIENT_H */

View File

@ -67,8 +67,8 @@ get_strv (GValue *value,
GVariant *variant, GVariant *variant,
gpointer user_data) gpointer user_data)
{ {
gchar *strv = g_variant_get_strv (variant, NULL); const gchar **strv = g_variant_get_strv (variant, NULL);
gchar *text = g_strjoinv (", ", strv); gchar *text = g_strjoinv (", ", (gchar **)strv);
g_free (strv); g_free (strv);
g_value_set_string (value, text); g_value_set_string (value, text);
return TRUE; return TRUE;
@ -79,14 +79,14 @@ set_strv (const GValue *value,
const GVariantType *expected_type, const GVariantType *expected_type,
gpointer user_data) gpointer user_data)
{ {
gchar *text = g_value_get_string (value); const gchar *text = g_value_get_string (value);
gchar **strv = g_strsplit (text, ",", -1), **p; gchar **strv = g_strsplit (text, ",", -1), **p;
GVariant *variant; GVariant *variant;
for (p = strv; *p != NULL; p++) for (p = strv; *p != NULL; p++)
g_strstrip (*p); g_strstrip (*p);
variant = g_variant_new_strv (strv, -1); variant = g_variant_new_strv ((const gchar * const *)strv, -1);
g_strfreev (strv); g_strfreev (strv);
return variant; return variant;
} }

View File

@ -546,14 +546,14 @@ server_context_service_init (ServerContextService *context)
g_settings_bind_with_mapping (context->settings, "size-constraint-landscape", g_settings_bind_with_mapping (context->settings, "size-constraint-landscape",
context, "size-constraint-landscape", context, "size-constraint-landscape",
G_SETTINGS_BIND_GET, G_SETTINGS_BIND_GET,
(GSettingsBindGetMapping *)g_value_set_variant, (GSettingsBindGetMapping)g_value_set_variant,
NULL, NULL,
NULL, NULL,
NULL); NULL);
g_settings_bind_with_mapping (context->settings, "size-constraint-portrait", g_settings_bind_with_mapping (context->settings, "size-constraint-portrait",
context, "size-constraint-portrait", context, "size-constraint-portrait",
G_SETTINGS_BIND_GET, G_SETTINGS_BIND_GET,
(GSettingsBindGetMapping *)g_value_set_variant, (GSettingsBindGetMapping)g_value_set_variant,
NULL, NULL,
NULL, NULL,
NULL); NULL);