[gnome-bluetooth] Avoid empty errors coming from obex-client
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] Avoid empty errors coming from obex-client
- Date: Mon, 14 Dec 2009 16:30:01 +0000 (UTC)
commit e4ca2f957d255a73f69cb9a22da85cecd23abc4c
Author: Bastien Nocera <hadess hadess net>
Date: Mon Dec 14 16:27:13 2009 +0000
Avoid empty errors coming from obex-client
sendto/main.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/sendto/main.c b/sendto/main.c
index 0a7b231..79ce233 100644
--- a/sendto/main.c
+++ b/sendto/main.c
@@ -281,7 +281,6 @@ static void create_window(void)
static gchar *get_error_message(GError *error)
{
char *message;
- const gchar *name;
if (error == NULL)
return g_strdup(_("An unknown error occurred"));
@@ -291,8 +290,7 @@ static gchar *get_error_message(GError *error)
goto done;
}
- name = dbus_g_error_get_name(error);
- if (g_str_equal(name, OPENOBEX_CONNECTION_FAILED) == TRUE &&
+ if (dbus_g_error_has_name(error, OPENOBEX_CONNECTION_FAILED) == TRUE &&
is_palm_device(option_device)) {
message = g_strdup(_("Make sure that remote device "
"is switched on and that it "
@@ -300,7 +298,10 @@ static gchar *get_error_message(GError *error)
goto done;
}
- message = g_strdup(error->message);
+ if (*error->message == '\0')
+ message = g_strdup(_("An unknown error occurred"));
+ else
+ message = g_strdup(error->message);
done:
g_error_free(error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]