[seahorse] Remove the 'description' property from objects.



commit 117f062ef433f3d2f89ed431a46b7da88c47fa7c
Author: Stef Walter <stefw collabora co uk>
Date:   Mon Aug 29 13:31:25 2011 +0200

    Remove the 'description' property from objects.
    
     * This is not used by seahorse (used to be used by seahorse-daemon)

 gkr/seahorse-gkr-item.c       |    9 ---
 gkr/seahorse-gkr-keyring.c    |    1 -
 libseahorse/seahorse-object.c |  141 +----------------------------------------
 libseahorse/seahorse-object.h |    7 --
 pgp/seahorse-gpgme-expires.c  |    2 +-
 pgp/seahorse-pgp-key.c        |    5 +-
 pgp/seahorse-pgp-subkey.c     |    4 +-
 pgp/seahorse-pgp-subkey.h     |    4 +-
 ssh/seahorse-ssh-key.c        |   12 +---
 9 files changed, 11 insertions(+), 174 deletions(-)
---
diff --git a/gkr/seahorse-gkr-item.c b/gkr/seahorse-gkr-item.c
index d1cbd97..8e14c02 100644
--- a/gkr/seahorse-gkr-item.c
+++ b/gkr/seahorse-gkr-item.c
@@ -426,19 +426,11 @@ calc_item_type (SeahorseGkrItem *self)
 void
 seahorse_gkr_item_realize (SeahorseGkrItem *self)
 {
-	const gchar *description;
 	gchar *display;
 	gchar *markup;
 	gchar *identifier;
 	const gchar *icon;
 
-	if (is_network_item (self, "http")) 
-		description = _("Web Password");
-	else if (is_network_item (self, NULL)) 
-		description = _("Network Password");
-	else
-		description = _("Password");
-
 	display = calc_display_name (self, TRUE);
 	markup = calc_name_markup(self);
 	identifier = g_strdup_printf ("%u", self->pv->item_id);
@@ -465,7 +457,6 @@ seahorse_gkr_item_realize (SeahorseGkrItem *self)
 		      "icon", icon,
 		      "markup", markup,
 		      "identifier", identifier,
-		      "description", description,
 		      "flags", SEAHORSE_FLAG_DELETABLE,
 		      NULL);
 	
diff --git a/gkr/seahorse-gkr-keyring.c b/gkr/seahorse-gkr-keyring.c
index 5e15cb0..0c820bc 100644
--- a/gkr/seahorse-gkr-keyring.c
+++ b/gkr/seahorse-gkr-keyring.c
@@ -125,7 +125,6 @@ seahorse_gkr_keyring_realize (SeahorseGkrKeyring *self)
 	              "markup", markup,
 	              "nickname", self->pv->keyring_name,
 	              "identifier", "",
-	              "description", "",
 	              "flags", SEAHORSE_FLAG_DELETABLE,
 	              "icon", "folder",
 	              "usage", SEAHORSE_USAGE_OTHER,
diff --git a/libseahorse/seahorse-object.c b/libseahorse/seahorse-object.c
index 6de1e79..3bf8076 100644
--- a/libseahorse/seahorse-object.c
+++ b/libseahorse/seahorse-object.c
@@ -43,7 +43,6 @@
  * @PROP_LABEL:
  * @PROP_MARKUP:
  * @PROP_NICKNAME:
- * @PROP_DESCRIPTION:
  * @PROP_ICON:
  * @PROP_IDENTIFIER:
  * @PROP_LOCATION:
@@ -61,7 +60,6 @@ enum _SeahorseObjectProps {
 	PROP_LABEL,
 	PROP_MARKUP,
 	PROP_NICKNAME,
-	PROP_DESCRIPTION,
 	PROP_ICON,
 	PROP_IDENTIFIER,
 	PROP_LOCATION,
@@ -84,8 +82,6 @@ enum _SeahorseObjectProps {
  * @markup_explicit: If TRUE the markup will not be set automatically
  * @nickname: DBUS: "simple-name"
  * @nickname_explicit: If TRUE the nickname will not be set automatically
- * @description:  Description text DBUS: "key-desc"
- * @description_explicit: If TRUE the description will not be set automatically
  * @icon: DBUS: "stock-id"
  * @identifier: DBUS: "key-id", "display-id", "raw-id"
  * @identifier_explicit:
@@ -109,8 +105,6 @@ struct _SeahorseObjectPrivate {
     gboolean markup_explicit;
     gchar *nickname;
     gboolean nickname_explicit;
-    gchar *description;
-    gboolean description_explicit;
     gchar *icon;
     gchar *identifier;
     gboolean identifier_explicit;
@@ -293,52 +287,6 @@ recalculate_label (SeahorseObject *self)
 	}
 }
 
-/**
- * recalculate_usage:
- * @self: The #SeahorseObject to recalculate the usage decription for
- *
- * Basing on the usage identifiere this function will calculate a usage
- * description and store it in the object.
- *
- */
-static void
-recalculate_usage (SeahorseObject *self)
-{
-	const gchar *desc;
-	
-	if (!self->pv->description_explicit) {
-		
-		switch (self->pv->usage) {
-		case SEAHORSE_USAGE_SYMMETRIC_KEY:
-			desc = _("Symmetric Key");
-			break;
-		case SEAHORSE_USAGE_PUBLIC_KEY:
-			desc = _("Public Key");
-			break;
-		case SEAHORSE_USAGE_PRIVATE_KEY:
-			desc = _("Private Key");
-			break;
-		case SEAHORSE_USAGE_CREDENTIALS:
-			desc = _("Credentials");
-			break;
-		case SEAHORSE_USAGE_IDENTITY:
-		    /*
-		     * Translators: "This object is a means of storing items such as 
-		     * name, email address, etc. that make up one's digital identity.
-		     */
-			desc = _("Identity");
-			break;
-		default:
-			desc = "";
-			break;
-		}
-		
-		if (set_string_storage (desc, &self->pv->description))
-			g_object_notify (G_OBJECT (self), "description");
-	}
-}
-
-
 /* -----------------------------------------------------------------------------
  * OBJECT 
  */
@@ -357,7 +305,6 @@ seahorse_object_init (SeahorseObject *self)
 	                                        SeahorseObjectPrivate);
 	self->pv->label = g_strdup ("");
 	self->pv->markup = g_strdup ("");
-	self->pv->description = g_strdup ("");
 	self->pv->icon = g_strdup ("gtk-missing-image");
 	self->pv->identifier = g_strdup ("");
 	self->pv->location = SEAHORSE_LOCATION_INVALID;
@@ -446,10 +393,7 @@ seahorse_object_finalize (GObject *obj)
 	
 	g_free (self->pv->nickname);
 	self->pv->nickname = NULL;
-	
-	g_free (self->pv->description);
-	self->pv->description = NULL;
-	
+
 	g_free (self->pv->icon);
 	self->pv->icon = NULL;
 	
@@ -504,9 +448,6 @@ seahorse_object_get_property (GObject *obj, guint prop_id, GValue *value,
 	case PROP_MARKUP:
 		g_value_set_string (value, seahorse_object_get_markup (self));
 		break;
-	case PROP_DESCRIPTION:
-		g_value_set_string (value, seahorse_object_get_description (self));
-		break;
 	case PROP_ICON:
 		g_value_set_string (value, seahorse_object_get_icon (self));
 		break;
@@ -604,12 +545,6 @@ seahorse_object_set_property (GObject *obj, guint prop_id, const GValue *value,
 			g_object_notify (obj, "markup");
 		}
 		break;
-	case PROP_DESCRIPTION:
-		if (set_string_storage (g_value_get_string (value), &self->pv->description)) {
-			self->pv->description_explicit = TRUE;
-			g_object_notify (obj, "description");
-		}
-		break;
 	case PROP_ICON:
 		if (set_string_storage (g_value_get_string (value), &self->pv->icon))
 			g_object_notify (obj, "icon");
@@ -633,7 +568,6 @@ seahorse_object_set_property (GObject *obj, guint prop_id, const GValue *value,
 			self->pv->usage = usage;
 			g_object_freeze_notify (obj);
 			g_object_notify (obj, "usage");
-			recalculate_usage (self);
 			g_object_thaw_notify (obj);
 		}
 		break;
@@ -709,11 +643,7 @@ seahorse_object_class_init (SeahorseObjectClass *klass)
 	g_object_class_install_property (gobject_class, PROP_MARKUP,
 	           g_param_spec_string ("markup", "Object Display Markup", "This object's displayable markup.", 
 	                                "", G_PARAM_READWRITE));
-	
-	g_object_class_install_property (gobject_class, PROP_DESCRIPTION,
-	           g_param_spec_string ("description", "Object Description", "Description of the type of object", 
-	                                "", G_PARAM_READWRITE));
-	
+
 	g_object_class_install_property (gobject_class, PROP_IDENTIFIER,
 	           g_param_spec_string ("identifier", "Object Identifier", "Displayable ID for the object.", 
 	                                "", G_PARAM_READWRITE));
@@ -960,19 +890,6 @@ seahorse_object_get_nickname (SeahorseObject *self)
 }
 
 /**
- * seahorse_object_get_description:
- * @self: Object
- *
- * Returns: the description of the object @self
- */
-const gchar*
-seahorse_object_get_description (SeahorseObject *self)
-{
-	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
-	return self->pv->description;
-}
-
-/**
  * seahorse_object_get_icon:
  * @self: Object
  *
@@ -1038,60 +955,6 @@ seahorse_object_get_flags (SeahorseObject *self)
 }
 
 /**
- * seahorse_object_lookup_property:
- * @self: the object to look up the property
- * @field: the field to lookup
- * @value: the returned value
- *
- * Looks up the property @field in the object @self and returns it in @value
- *
- * Returns: TRUE if a property was found
- */
-gboolean
-seahorse_object_lookup_property (SeahorseObject *self, const gchar *field, GValue *value)
-{
-	GParamSpec *spec;
-	
-	g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), FALSE);
-	g_return_val_if_fail (field, FALSE);
-	g_return_val_if_fail (value, FALSE);
-	
-	spec = g_object_class_find_property (G_OBJECT_GET_CLASS (self), field);
-	if (!spec) {
-		/* Some name mapping to new style names */
-		if (g_str_equal (field, "simple-name"))
-			field = "nickname";
-		else if (g_str_equal (field, "key-id"))
-			field = "identifier";
-		else if (g_str_equal (field, "display-name"))
-			field = "label";
-		else if (g_str_equal (field, "key-desc"))
-			field = "description";
-		else if (g_str_equal (field, "ktype"))
-			field = "tag";
-		else if (g_str_equal (field, "etype"))
-			field = "usage";
-		else if (g_str_equal (field, "display-id"))
-			field = "identifier";
-		else if (g_str_equal (field, "stock-id"))
-			field = "icon";
-		else if (g_str_equal (field, "raw-id"))
-			field = "identifier";
-		else 
-			return FALSE;
-	
-		/* Try again */
-		spec = g_object_class_find_property (G_OBJECT_GET_CLASS (self), field);
-		if (!spec)
-			return FALSE;
-	}
-
-	g_value_init (value, spec->value_type);
-	g_object_get_property (G_OBJECT (self), field, value);
-	return TRUE; 
-}
-
-/**
  * seahorse_object_predicate_match:
  * @self: the object to test
  * @obj: The predicate to match
diff --git a/libseahorse/seahorse-object.h b/libseahorse/seahorse-object.h
index 178f8e2..4f50fae 100644
--- a/libseahorse/seahorse-object.h
+++ b/libseahorse/seahorse-object.h
@@ -36,7 +36,6 @@
  * 
  * markup: string: The markup string label of this object.
  * identifier: string: The displayable key identifier for this object.
- * description: string: The description of the type of object.
  *
  * The following can optionally be set:
  *  
@@ -106,8 +105,6 @@ const gchar*        seahorse_object_get_markup             (SeahorseObject *self
 
 const gchar*        seahorse_object_get_identifier         (SeahorseObject *self);
 
-const gchar*        seahorse_object_get_description        (SeahorseObject *self);
-
 const gchar*        seahorse_object_get_nickname           (SeahorseObject *self);
 
 const gchar*        seahorse_object_get_icon               (SeahorseObject *self);
@@ -119,10 +116,6 @@ SeahorseUsage       seahorse_object_get_usage              (SeahorseObject *self
 
 guint               seahorse_object_get_flags              (SeahorseObject *self);
 
-gboolean            seahorse_object_lookup_property        (SeahorseObject *self, 
-                                                            const gchar *field, 
-                                                            GValue *value);
-
 typedef gboolean (*SeahorseObjectPredicateFunc) (SeahorseObject *obj, void *user_data);
 
 typedef struct _SeahorseObjectPredicate SeahorseObjectPredicate;
diff --git a/pgp/seahorse-gpgme-expires.c b/pgp/seahorse-gpgme-expires.c
index 51f42eb..bb057cc 100644
--- a/pgp/seahorse-gpgme-expires.c
+++ b/pgp/seahorse-gpgme-expires.c
@@ -125,7 +125,7 @@ seahorse_gpgme_expires_new (SeahorseGpgmeSubkey *subkey, GtkWindow *parent)
 			gtk_calendar_select_day (GTK_CALENDAR (date), t.tm_mday);
 		}
 	}
-	
+
 	label = seahorse_pgp_subkey_get_description (SEAHORSE_PGP_SUBKEY (subkey));
 	title = g_strdup_printf (_("Expiry: %s"), label);
 	gtk_window_set_title (GTK_WINDOW (seahorse_widget_get_widget (swidget, swidget->name)), title);
diff --git a/pgp/seahorse-pgp-key.c b/pgp/seahorse-pgp-key.c
index 530957b..8437b6e 100644
--- a/pgp/seahorse-pgp-key.c
+++ b/pgp/seahorse-pgp-key.c
@@ -172,7 +172,7 @@ void
 seahorse_pgp_key_realize (SeahorsePgpKey *self)
 {
 	const gchar *nickname, *keyid;
-	const gchar *description, *icon;
+	const gchar *icon;
 	gchar *markup, *name, *identifier;
 	SeahorseUsage usage;
 	GList *subkeys;
@@ -193,10 +193,8 @@ seahorse_pgp_key_realize (SeahorsePgpKey *self)
 
 	/* The type */
 	if (usage == SEAHORSE_USAGE_PRIVATE_KEY) {
-		description = _("Private PGP Key");
 		icon = SEAHORSE_STOCK_SECRET;
 	} else {
-		description = _("Public PGP Key");
 		icon = SEAHORSE_STOCK_KEY;
 		if (usage == SEAHORSE_USAGE_NONE)
 			g_object_set (self, "usage", SEAHORSE_USAGE_PUBLIC_KEY, NULL);
@@ -207,7 +205,6 @@ seahorse_pgp_key_realize (SeahorsePgpKey *self)
 		      "markup", markup,
 		      "nickname", nickname,
 		      "identifier", identifier,
-		      "description", description,
 		      "icon", icon,
 		      NULL);
 		
diff --git a/pgp/seahorse-pgp-subkey.c b/pgp/seahorse-pgp-subkey.c
index e222e56..abf94b7 100644
--- a/pgp/seahorse-pgp-subkey.c
+++ b/pgp/seahorse-pgp-subkey.c
@@ -364,10 +364,10 @@ seahorse_pgp_subkey_calc_description (const gchar *name, guint index)
 {
 	if (name == NULL)
 		name = _("Key");
-	
+
 	if (index == 0)
 		return g_strdup (name);
-	
+
 	return g_strdup_printf (_("Subkey %d of %s"), index, name);
 }
 
diff --git a/pgp/seahorse-pgp-subkey.h b/pgp/seahorse-pgp-subkey.h
index ab64ee2..c44f87c 100644
--- a/pgp/seahorse-pgp-subkey.h
+++ b/pgp/seahorse-pgp-subkey.h
@@ -91,8 +91,8 @@ const gchar*        seahorse_pgp_subkey_get_description   (SeahorsePgpSubkey *se
 void                seahorse_pgp_subkey_set_description   (SeahorsePgpSubkey *self,
                                                            const gchar *description);
 
-gchar*              seahorse_pgp_subkey_calc_description  (const gchar *name, 
-                                                           guint index); 
+gchar*              seahorse_pgp_subkey_calc_description  (const gchar *name,
+                                                           guint index);
 
 const gchar*        seahorse_pgp_subkey_get_fingerprint   (SeahorsePgpSubkey *self);
 
diff --git a/ssh/seahorse-ssh-key.c b/ssh/seahorse-ssh-key.c
index 2bc7222..655e4f6 100644
--- a/ssh/seahorse-ssh-key.c
+++ b/ssh/seahorse-ssh-key.c
@@ -71,7 +71,6 @@ changed_key (SeahorseSSHKey *self)
 {
 	SeahorseObject *obj = SEAHORSE_OBJECT (self);
 	SeahorseUsage usage;
-	const gchar *description = NULL;
 	const gchar *display = NULL;
 	gchar *identifier;
 	gchar *simple = NULL;
@@ -103,7 +102,6 @@ changed_key (SeahorseSSHKey *self)
 		              "label", "",
 		              "icon", NULL,
 		              "usage", SEAHORSE_USAGE_NONE,
-		              "description", _("Invalid"),		              
 		              "nickname", "",
 		              "location", SEAHORSE_LOCATION_INVALID,
 		              "flags", SEAHORSE_FLAG_DISABLED,
@@ -112,14 +110,11 @@ changed_key (SeahorseSSHKey *self)
 		
 	} 
 
-	if (self->keydata->privfile) {
+	if (self->keydata->privfile)
 		usage = SEAHORSE_USAGE_PRIVATE_KEY;
-		description = _("Private Secure Shell Key");
-	} else {
+	else
 		usage = SEAHORSE_USAGE_PUBLIC_KEY;
-		description = _("Public Secure Shell Key");
-	}
-	
+
 	identifier = seahorse_ssh_key_calc_identifier (self->keydata->fingerprint);
 
 	g_object_set (obj,
@@ -128,7 +123,6 @@ changed_key (SeahorseSSHKey *self)
 	              "icon", SEAHORSE_STOCK_KEY_SSH,
 	              "usage", usage,
 	              "nickname", simple,
-	              "description", description,
 	              "location", SEAHORSE_LOCATION_LOCAL,
 	              "identifier", identifier,
 	              "flags", (self->keydata->authorized ? SEAHORSE_FLAG_TRUSTED : 0) | SEAHORSE_FLAG_EXPORTABLE | SEAHORSE_FLAG_DELETABLE,



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