[gnome-disk-utility] for now, prepend the D-Bus error name to the error string from the daemon



commit 53cf4a6635586e68c7a45030b381bc98d4f9eb1c
Author: David Zeuthen <davidz redhat com>
Date:   Wed Apr 8 12:04:17 2009 -0400

    for now, prepend the D-Bus error name to the error string from the daemon
    
    This is hidden behind a GtkExpander so it's not exactly a big deal. As
    noted we can removed this once we port to PolicyKit 1.0.
---
 src/gdu/gdu-error.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gdu/gdu-error.c b/src/gdu/gdu-error.c
index 956c61c..992c4d8 100644
--- a/src/gdu/gdu-error.c
+++ b/src/gdu/gdu-error.c
@@ -57,6 +57,7 @@ _gdu_error_fixup (GError *error)
 {
         const char *name;
         gboolean matched;
+        gchar *s;
 
         if (error == NULL)
                 return;
@@ -89,6 +90,14 @@ _gdu_error_fixup (GError *error)
 
         if (matched)
                 error->domain = GDU_ERROR;
+
+        /* Always prepend the D-Bus exception name to the message; we need this in
+         * gdu_error_check_polkit_not_authorized() to determine if it's a PolicyKit
+         * exception... when we port to polkit 1.0 this can go away.
+         */
+        s = g_strdup_printf ("%s: %s", name, error->message);
+        g_free (error->message);
+        error->message = s;
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]