[seahorse] Premtively fix 'bogus' handling of the flags type



commit c65ba7c1554859f3c919f1020ec5caa4379adb12
Author: Adam Schreiber <sadam gnome org>
Date:   Sun Oct 4 20:25:26 2009 -0400

    Premtively fix 'bogus' handling of the flags type

 common/seahorse-bind.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/common/seahorse-bind.c b/common/seahorse-bind.c
index c5d567e..a1e23de 100644
--- a/common/seahorse-bind.c
+++ b/common/seahorse-bind.c
@@ -108,15 +108,6 @@ value_equal (const GValue *a, const GValue *b)
 		else
 			retval = FALSE;
 		break;
-	case G_TYPE_FLAGS:
-		/* this is even more bogus. */
-		if (g_value_get_flags (a) < g_value_get_flags (b))
-			retval = FALSE;
-		else if (g_value_get_flags (a) == g_value_get_flags (b))
-			retval = TRUE;
-		else
-			retval = FALSE;
-		break;
 	case G_TYPE_FLOAT:
 		if (g_value_get_float (a) < g_value_get_float (b))
 			retval = FALSE;
@@ -155,6 +146,8 @@ value_equal (const GValue *a, const GValue *b)
 	default:
         if (G_VALUE_HOLDS_ENUM (a)) {
             retval = (g_value_get_enum (a) == g_value_get_enum (b));
+        } else if (G_VALUE_HOLDS_FLAGS (a)) {
+            retval = (g_value_get_flags (a) == g_value_get_flags (b));
         } else {
             /* Default case is not equal */
             retval = FALSE;



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