X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgdbus-tool.c;h=f24dd71159ec846898b03755c635db7de748f424;hb=d9ad40b4eaf1a9197ab363de4346a8d84f45f5c1;hp=bd71d1ecf52881ff5e248622c9965bd23397d582;hpb=3ac6cfaeaadc82ce7d8b9dba7134d5ea7272c70c;p=platform%2Fupstream%2Fglib.git
diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c
index bd71d1e..f24dd71 100644
--- a/gio/gdbus-tool.c
+++ b/gio/gdbus-tool.c
@@ -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.
+ * Public License along with this library; if not, see .
*
* Author: David Zeuthen
*/
@@ -225,7 +223,7 @@ print_paths (GDBusConnection *c,
}
g_variant_get (result, "(&s)", &xml_data);
- //g_printerr ("xml=`%s'", xml_data);
+ //g_printerr ("xml='%s'", xml_data);
error = NULL;
node = g_dbus_node_info_new_for_xml (xml_data, &error);
@@ -237,7 +235,7 @@ print_paths (GDBusConnection *c,
goto out;
}
- //g_printerr ("bar `%s'\n", path);
+ //g_printerr ("bar '%s'\n", path);
if (node->interfaces != NULL)
g_print ("%s \n", path);
@@ -246,7 +244,7 @@ print_paths (GDBusConnection *c,
{
gchar *s;
- //g_printerr ("foo `%s'\n", node->nodes[n].path);
+ //g_printerr ("foo '%s'\n", node->nodes[n].path);
if (g_strcmp0 (path, "/") == 0)
s = g_strdup_printf ("/%s", node->nodes[n]->path);
@@ -464,7 +462,7 @@ call_helper_get_method_in_signature (GDBusConnection *c,
if (interface_info == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Warning: According to introspection data, interface `%s' does not exist\n"),
+ _("Warning: According to introspection data, interface '%s' does not exist\n"),
interface_name);
goto out;
}
@@ -473,7 +471,7 @@ call_helper_get_method_in_signature (GDBusConnection *c,
if (method_info == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Warning: According to introspection data, method `%s' does not exist on interface `%s'\n"),
+ _("Warning: According to introspection data, method '%s' does not exist on interface '%s'\n"),
method_name,
interface_name);
goto out;
@@ -671,18 +669,24 @@ handle_emit (gint *argc,
&error);
if (value == NULL)
{
+ gchar *context;
+
+ context = g_variant_parse_error_print_context (error, (*argv)[n]);
g_error_free (error);
error = NULL;
value = _g_variant_parse_me_harder (NULL, (*argv)[n], &error);
if (value == NULL)
{
+ /* Use the original non-"parse-me-harder" error */
g_printerr (_("Error parsing parameter %d: %s\n"),
n,
- error->message);
+ context);
g_error_free (error);
+ g_free (context);
g_variant_builder_clear (&builder);
goto out;
}
+ g_free (context);
}
g_variant_builder_add_value (&builder, value);
}
@@ -916,7 +920,7 @@ handle_call (gint *argc,
s = strrchr (opt_call_method, '.');
if (!request_completion && s == NULL)
{
- g_printerr (_("Error: Method name `%s' is invalid\n"), opt_call_method);
+ g_printerr (_("Error: Method name '%s' is invalid\n"), opt_call_method);
goto out;
}
method_name = g_strdup (s + 1);
@@ -973,6 +977,9 @@ handle_call (gint *argc,
&error);
if (value == NULL)
{
+ gchar *context;
+
+ context = g_variant_parse_error_print_context (error, (*argv)[n]);
g_error_free (error);
error = NULL;
value = _g_variant_parse_me_harder (type, (*argv)[n], &error);
@@ -981,22 +988,24 @@ handle_call (gint *argc,
if (type != NULL)
{
s = g_variant_type_dup_string (type);
- g_printerr (_("Error parsing parameter %d of type `%s': %s\n"),
+ g_printerr (_("Error parsing parameter %d of type '%s': %s\n"),
n,
s,
- error->message);
+ context);
g_free (s);
}
else
{
g_printerr (_("Error parsing parameter %d: %s\n"),
n,
- error->message);
+ context);
}
g_error_free (error);
g_variant_builder_clear (&builder);
+ g_free (context);
goto out;
}
+ g_free (context);
}
g_variant_builder_add_value (&builder, value);
}
@@ -1017,8 +1026,11 @@ handle_call (gint *argc,
&error);
if (result == NULL)
{
- g_printerr (_("Error: %s\n"), error->message);
- g_error_free (error);
+ if (error)
+ {
+ g_printerr (_("Error: %s\n"), error->message);
+ g_error_free (error);
+ }
if (in_signature_types != NULL)
{
GString *s;
@@ -1030,7 +1042,7 @@ handle_call (gint *argc,
g_variant_type_peek_string (type),
g_variant_type_get_string_length (type));
}
- g_printerr ("(According to introspection data, you need to pass `%s')\n", s->str);
+ g_printerr ("(According to introspection data, you need to pass '%s')\n", s->str);
g_string_free (s, TRUE);
}
goto out;
@@ -1723,16 +1735,12 @@ handle_monitor (gint *argc,
gchar *s;
GError *error;
GDBusConnection *c;
- GVariant *result;
- GDBusNodeInfo *node;
gboolean complete_names;
gboolean complete_paths;
GMainLoop *loop;
ret = FALSE;
c = NULL;
- node = NULL;
- result = NULL;
modify_argv0_for_command (argc, argv, "monitor");
@@ -1875,10 +1883,6 @@ handle_monitor (gint *argc,
ret = TRUE;
out:
- if (node != NULL)
- g_dbus_node_info_unref (node);
- if (result != NULL)
- g_variant_unref (result);
if (c != NULL)
g_object_unref (c);
g_option_context_free (o);
@@ -2039,7 +2043,7 @@ main (gint argc, gchar *argv[])
completion_debug ("completion_point=%d", completion_point);
completion_debug ("----");
completion_debug (" 0123456789012345678901234567890123456789012345678901234567890123456789");
- completion_debug ("`%s'", completion_line);
+ completion_debug ("'%s'", completion_line);
completion_debug (" %*s^",
completion_point, "");
completion_debug ("----");
@@ -2073,8 +2077,8 @@ main (gint argc, gchar *argv[])
}
}
#if 0
- completion_debug (" cur=`%s'", completion_cur);
- completion_debug ("prev=`%s'", completion_prev);
+ completion_debug (" cur='%s'", completion_cur);
+ completion_debug ("prev='%s'", completion_prev);
#endif
argc = completion_argc;
@@ -2094,7 +2098,7 @@ main (gint argc, gchar *argv[])
}
else
{
- g_printerr ("Unknown command `%s'\n", command);
+ g_printerr ("Unknown command '%s'\n", command);
usage (&argc, &argv, FALSE);
goto out;
}