Commit aca9a4dc authored by Daiki Ueno's avatar Daiki Ueno
Browse files

Fix some mistakes.

parent 953c35bd
......@@ -360,8 +360,9 @@ eekboard_client_destroy_context (EekboardClient *client,
g_return_if_fail (EEKBOARD_IS_CLIENT(client));
g_return_if_fail (EEKBOARD_IS_CONTEXT(context));
send_destroy_context (client, context, cancellable);
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);
send_destroy_context (client, context, cancellable);
}
......@@ -103,17 +103,17 @@ enum FocusListenerType {
};
static gboolean
set_keyboards (Client *client,
gchar **keyboards)
set_keyboards (Client *client,
const gchar * const *keyboards)
{
if (g_strv_length (keyboards) == 0) {
if (g_strv_length ((gchar **)keyboards) == 0) {
if (!client_enable_xkl (client)) {
g_printerr ("Can't register xklavier event listeners\n");
return FALSE;
}
} else {
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_free (str);
return FALSE;
......@@ -315,7 +315,7 @@ main (int argc, char **argv)
g_object_unref (eekboard);
keyboards = g_settings_get_strv (settings, "keyboards");
if (!set_keyboards (client, keyboards)) {
if (!set_keyboards (client, (const gchar * const *)keyboards)) {
g_strfreev (keyboards);
retval = 1;
goto out;
......
......@@ -128,7 +128,7 @@ static gboolean keystroke_listener_cb (const AtspiDeviceEvent *stroke,
void *user_data);
#endif /* HAVE_ATSPI */
static gboolean set_keyboards (Client *client,
const gchar **keyboard);
const gchar * const *keyboard);
static gboolean set_keyboards_from_xkl
(Client *client);
#ifdef HAVE_XTEST
......@@ -298,8 +298,8 @@ client_init (Client *client)
}
gboolean
client_set_keyboards (Client *client,
const gchar **keyboards)
client_set_keyboards (Client *client,
const gchar * const *keyboards)
{
gboolean retval;
retval = set_keyboards (client, keyboards);
......@@ -707,11 +707,11 @@ on_xkl_config_changed (XklEngine *xklengine,
}
static gboolean
set_keyboards (Client *client,
const gchar **keyboards)
set_keyboards (Client *client,
const gchar * const *keyboards)
{
guint keyboard_id;
gchar **p;
const gchar * const *p;
GSList *head = NULL;
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 (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;
gunichar *ucs4 = g_utf8_to_ucs4_fast (utf8, -1, &items_written);
gint i;
......
......@@ -31,25 +31,25 @@ G_BEGIN_DECLS
typedef struct _Client Client;
Client *client_new (GDBusConnection *connection);
Client *client_new (GDBusConnection *connection);
gboolean client_set_keyboards (Client *client,
const gchar **keyboard);
gboolean client_set_keyboards (Client *client,
const gchar * const *keyboard);
gboolean client_enable_xkl (Client *client);
void client_disable_xkl (Client *client);
gboolean client_enable_xkl (Client *client);
void client_disable_xkl (Client *client);
gboolean client_enable_atspi_focus (Client *client);
void client_disable_atspi_focus (Client *client);
gboolean client_enable_atspi_focus (Client *client);
void client_disable_atspi_focus (Client *client);
gboolean client_enable_atspi_keystroke (Client *client);
void client_disable_atspi_keystroke (Client *client);
gboolean client_enable_atspi_keystroke (Client *client);
void client_disable_atspi_keystroke (Client *client);
gboolean client_enable_xtest (Client *client);
void client_disable_xtest (Client *client);
gboolean client_enable_xtest (Client *client);
void client_disable_xtest (Client *client);
gboolean client_enable_ibus_focus (Client *client);
void client_disable_ibus_focus (Client *client);
gboolean client_enable_ibus_focus (Client *client);
void client_disable_ibus_focus (Client *client);
G_END_DECLS
#endif /* CLIENT_H */
......@@ -67,8 +67,8 @@ get_strv (GValue *value,
GVariant *variant,
gpointer user_data)
{
gchar *strv = g_variant_get_strv (variant, NULL);
gchar *text = g_strjoinv (", ", strv);
const gchar **strv = g_variant_get_strv (variant, NULL);
gchar *text = g_strjoinv (", ", (gchar **)strv);
g_free (strv);
g_value_set_string (value, text);
return TRUE;
......@@ -79,14 +79,14 @@ set_strv (const GValue *value,
const GVariantType *expected_type,
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;
GVariant *variant;
for (p = strv; *p != NULL; p++)
g_strstrip (*p);
variant = g_variant_new_strv (strv, -1);
variant = g_variant_new_strv ((const gchar * const *)strv, -1);
g_strfreev (strv);
return variant;
}
......
......@@ -546,14 +546,14 @@ server_context_service_init (ServerContextService *context)
g_settings_bind_with_mapping (context->settings, "size-constraint-landscape",
context, "size-constraint-landscape",
G_SETTINGS_BIND_GET,
(GSettingsBindGetMapping *)g_value_set_variant,
(GSettingsBindGetMapping)g_value_set_variant,
NULL,
NULL,
NULL);
g_settings_bind_with_mapping (context->settings, "size-constraint-portrait",
context, "size-constraint-portrait",
G_SETTINGS_BIND_GET,
(GSettingsBindGetMapping *)g_value_set_variant,
(GSettingsBindGetMapping)g_value_set_variant,
NULL,
NULL,
NULL);
......
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