[seahorse/refactor: 20/33] Refactor that there's no unnecessary use of SeahorseObject
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse/refactor: 20/33] Refactor that there's no unnecessary use of SeahorseObject
- Date: Tue, 18 Oct 2011 07:09:34 +0000 (UTC)
commit 0af497e0ed6f63f16cc9edc044f24e15b2c646bc
Author: Stef Walter <stefw collabora co uk>
Date: Wed Oct 12 18:53:08 2011 +0200
Refactor that there's no unnecessary use of SeahorseObject
* So that other stuff like GcrCertificate can work in seahorse.
gkr/seahorse-gkr-item-commands.c | 5 +-
gkr/seahorse-gkr-item-properties.c | 12 +++---
gkr/seahorse-gkr-keyring-commands.c | 5 +-
gkr/seahorse-gkr-keyring-properties.c | 8 ++--
gkr/seahorse-gkr-operation.c | 8 ++--
libseahorse/seahorse-collection.c | 52 ++++++++++++------------
libseahorse/seahorse-commands.c | 8 ++-
libseahorse/seahorse-commands.h | 11 +++--
libseahorse/seahorse-context.h | 3 -
libseahorse/seahorse-key-manager-store.c | 30 +++++++-------
libseahorse/seahorse-key-manager-store.h | 4 +-
libseahorse/seahorse-object-model.c | 41 +++++++++++--------
libseahorse/seahorse-object-model.h | 22 +++++-----
libseahorse/seahorse-object-widget.c | 16 +++++---
libseahorse/seahorse-object-widget.h | 14 +++---
libseahorse/seahorse-object.c | 46 ++++++++-------------
libseahorse/seahorse-predicate.h | 6 +--
libseahorse/seahorse-source.c | 9 ++--
libseahorse/seahorse-source.h | 4 --
libseahorse/seahorse-util.c | 58 +++++++++++++-------------
libseahorse/seahorse-util.h | 4 +-
libseahorse/seahorse-view.c | 5 +-
libseahorse/seahorse-view.h | 12 +++---
libseahorse/seahorse-viewer.c | 40 ++++++++----------
libseahorse/seahorse-viewer.h | 27 +++++++-----
pgp/seahorse-gpgme-add-subkey.c | 4 +-
pgp/seahorse-gpgme-add-uid.c | 8 ++--
pgp/seahorse-keyserver-results.c | 11 +++--
pgp/seahorse-pgp-commands.c | 9 ++--
pgp/seahorse-pgp-key-properties.c | 66 +++++++++++++++---------------
pgp/seahorse-pgp-keysets.c | 2 +-
pkcs11/seahorse-pkcs11-commands.c | 3 +-
src/seahorse-key-manager.c | 11 +++--
ssh/seahorse-ssh-commands.c | 8 +--
ssh/seahorse-ssh-key-properties.c | 19 +++++----
35 files changed, 294 insertions(+), 297 deletions(-)
---
diff --git a/gkr/seahorse-gkr-item-commands.c b/gkr/seahorse-gkr-item-commands.c
index 552819e..b35df30 100644
--- a/gkr/seahorse-gkr-item-commands.c
+++ b/gkr/seahorse-gkr-item-commands.c
@@ -49,12 +49,11 @@ static SeahorsePredicate commands_predicate = { 0, };
*/
static void
-seahorse_gkr_item_commands_show_properties (SeahorseCommands* base, SeahorseObject* object)
+seahorse_gkr_item_commands_show_properties (SeahorseCommands* base,
+ GObject* object)
{
GtkWindow *window;
- g_return_if_fail (SEAHORSE_IS_OBJECT (object));
-
window = seahorse_commands_get_window (base);
if (G_OBJECT_TYPE (object) == SEAHORSE_TYPE_GKR_ITEM)
seahorse_gkr_item_properties_show (SEAHORSE_GKR_ITEM (object), window);
diff --git a/gkr/seahorse-gkr-item-properties.c b/gkr/seahorse-gkr-item-properties.c
index afb36c8..db38419 100644
--- a/gkr/seahorse-gkr-item-properties.c
+++ b/gkr/seahorse-gkr-item-properties.c
@@ -222,7 +222,7 @@ static void
password_activate (GtkEntry *entry,
SeahorseWidget *swidget)
{
- SeahorseObject *object;
+ GObject *object;
SeahorseGkrItem *git;
GtkWidget *expander;
GCancellable *cancellable;
@@ -283,7 +283,7 @@ on_item_password_expander_activate (GtkExpander *expander,
gpointer user_data)
{
SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data);
- SeahorseObject *object;
+ GObject *object;
SeahorseGkrItem *git;
GtkWidget *widget;
@@ -350,7 +350,7 @@ on_item_description_activate (GtkWidget *entry,
SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data);
item_description_closure *closure;
GCancellable *cancellable;
- SeahorseObject *object;
+ GObject *object;
SeahorseGkrItem *git;
object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
@@ -391,7 +391,7 @@ on_item_description_focus_out (GtkWidget* widget,
static void
setup_main (SeahorseWidget *swidget)
{
- SeahorseObject *object;
+ GObject *object;
GtkEntryBuffer *buffer;
GtkWidget *widget;
GtkWidget *box;
@@ -506,7 +506,7 @@ transform_item_details (const GValue *from, GValue *to)
static void
setup_details (SeahorseWidget *swidget)
{
- SeahorseObject *object;
+ GObject *object;
GtkWidget *widget;
object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
@@ -537,7 +537,7 @@ properties_response (GtkDialog *dialog, int response, SeahorseWidget *swidget)
void
seahorse_gkr_item_properties_show (SeahorseGkrItem *git, GtkWindow *parent)
{
- SeahorseObject *object = SEAHORSE_OBJECT (git);
+ GObject *object = G_OBJECT (git);
SeahorseWidget *swidget = NULL;
GtkWidget *widget;
diff --git a/gkr/seahorse-gkr-keyring-commands.c b/gkr/seahorse-gkr-keyring-commands.c
index 6d2c0bc..30be44b 100644
--- a/gkr/seahorse-gkr-keyring-commands.c
+++ b/gkr/seahorse-gkr-keyring-commands.c
@@ -312,11 +312,12 @@ on_view_selection_changed (SeahorseView *view, gpointer user_data)
*/
static void
-seahorse_gkr_keyring_commands_show_properties (SeahorseCommands* base, SeahorseObject* object)
+seahorse_gkr_keyring_commands_show_properties (SeahorseCommands* base,
+ GObject* object)
{
GtkWindow *window;
- g_return_if_fail (SEAHORSE_IS_OBJECT (object));
+ g_return_if_fail (G_IS_OBJECT (object));
window = seahorse_commands_get_window (base);
if (G_OBJECT_TYPE (object) == SEAHORSE_TYPE_GKR_KEYRING)
diff --git a/gkr/seahorse-gkr-keyring-properties.c b/gkr/seahorse-gkr-keyring-properties.c
index 41c644d..90a9167 100644
--- a/gkr/seahorse-gkr-keyring-properties.c
+++ b/gkr/seahorse-gkr-keyring-properties.c
@@ -60,8 +60,8 @@ transform_keyring_created (const GValue *from, GValue *to)
static void
setup_main (SeahorseWidget *swidget)
{
- SeahorseObject *object;
-
+ GObject *object;
+
object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
/* Setup the image properly */
@@ -102,9 +102,9 @@ on_keyring_properties_response (GtkDialog *dialog,
void
seahorse_gkr_keyring_properties_show (SeahorseGkrKeyring *gkr, GtkWindow *parent)
{
- SeahorseObject *object = SEAHORSE_OBJECT (gkr);
+ GObject *object = G_OBJECT (gkr);
SeahorseWidget *swidget = NULL;
-
+
swidget = seahorse_object_widget_new ("gkr-keyring", parent, object);
/* This happens if the window is already open */
diff --git a/gkr/seahorse-gkr-operation.c b/gkr/seahorse-gkr-operation.c
index 0387c76..c282fa4 100644
--- a/gkr/seahorse-gkr-operation.c
+++ b/gkr/seahorse-gkr-operation.c
@@ -391,8 +391,8 @@ on_delete_gkr_complete (GnomeKeyringResult result,
GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data);
delete_gkr_closure *closure = g_simple_async_result_get_op_res_gpointer (res);
GError *error = NULL;
- SeahorseObject *object;
- SeahorseGkrKeyring *keyring;
+ GObject *object;
+ SeahorseGkrKeyring *keyring = NULL;
SeahorseGkrItem *item;
closure->request = NULL;
@@ -404,7 +404,7 @@ on_delete_gkr_complete (GnomeKeyringResult result,
g_simple_async_result_complete_in_idle (res);
} else if (SEAHORSE_IS_GKR_ITEM (object)) {
- keyring = SEAHORSE_GKR_KEYRING (seahorse_object_get_source (object));
+ g_object_get (object, "source", &keyring, NULL);
item = SEAHORSE_GKR_ITEM (object);
seahorse_gkr_keyring_remove_item (keyring, seahorse_gkr_item_get_item_id (item));
@@ -433,7 +433,7 @@ static void
delete_gkr_one_object (GSimpleAsyncResult *res)
{
delete_gkr_closure *closure = g_simple_async_result_get_op_res_gpointer (res);
- SeahorseObject *object;
+ GObject *object;
const gchar *keyring;
guint32 item;
diff --git a/libseahorse/seahorse-collection.c b/libseahorse/seahorse-collection.c
index dd579aa..9f50b71 100644
--- a/libseahorse/seahorse-collection.c
+++ b/libseahorse/seahorse-collection.c
@@ -40,35 +40,35 @@ struct _SeahorseCollectionPrivate {
static void seahorse_collection_iface_init (GcrCollectionIface *iface);
static gboolean maybe_add_object (SeahorseCollection *self,
- SeahorseObject *object);
+ GObject *obj);
static gboolean maybe_remove_object (SeahorseCollection *self,
- SeahorseObject *object);
+ GObject *obj);
G_DEFINE_TYPE_WITH_CODE (SeahorseCollection, seahorse_collection, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GCR_TYPE_COLLECTION, seahorse_collection_iface_init);
);
static gboolean
-remove_update (SeahorseObject *object,
+remove_update (GObject *object,
gpointer unused,
SeahorseCollection *self)
{
- gcr_collection_emit_removed (GCR_COLLECTION (self), G_OBJECT (object));
+ gcr_collection_emit_removed (GCR_COLLECTION (self), object);
return TRUE;
}
static void
-on_object_changed (SeahorseObject *object,
+on_object_changed (GObject *obj,
GParamSpec *spec,
gpointer user_data)
{
SeahorseCollection *self = SEAHORSE_COLLECTION (user_data);
- if (g_hash_table_lookup (self->pv->objects, object))
- maybe_remove_object (self, object);
+ if (g_hash_table_lookup (self->pv->objects, obj))
+ maybe_remove_object (self, obj);
else
- maybe_add_object (self, object);
+ maybe_add_object (self, obj);
}
static void
@@ -77,7 +77,7 @@ remove_object (gpointer key,
gpointer user_data)
{
SeahorseCollection *self = SEAHORSE_COLLECTION (user_data);
- SeahorseObject *object = SEAHORSE_OBJECT (key);
+ GObject *object = G_OBJECT (key);
g_hash_table_remove (self->pv->objects, object);
g_signal_handlers_disconnect_by_func (object, on_object_changed, self);
remove_update (object, NULL, self);
@@ -85,47 +85,47 @@ remove_object (gpointer key,
static gboolean
maybe_add_object (SeahorseCollection *self,
- SeahorseObject *object)
+ GObject *obj)
{
- if (g_hash_table_lookup (self->pv->objects, object))
+ if (g_hash_table_lookup (self->pv->objects, obj))
return FALSE;
- if (!self->pv->pred || !seahorse_predicate_match (self->pv->pred, object))
+ if (!self->pv->pred || !seahorse_predicate_match (self->pv->pred, obj))
return FALSE;
- g_hash_table_replace (self->pv->objects, object, GINT_TO_POINTER (TRUE));
- g_signal_connect (object, "notify", G_CALLBACK (on_object_changed), self);
- gcr_collection_emit_added (GCR_COLLECTION (self), G_OBJECT (object));
+ g_hash_table_replace (self->pv->objects, obj, GINT_TO_POINTER (TRUE));
+ g_signal_connect (obj, "notify", G_CALLBACK (on_object_changed), self);
+ gcr_collection_emit_added (GCR_COLLECTION (self), obj);
return TRUE;
}
static gboolean
maybe_remove_object (SeahorseCollection *self,
- SeahorseObject *object)
+ GObject *obj)
{
- if (!g_hash_table_lookup (self->pv->objects, object))
+ if (!g_hash_table_lookup (self->pv->objects, obj))
return FALSE;
- if (self->pv->pred && seahorse_predicate_match (self->pv->pred, object))
+ if (self->pv->pred && seahorse_predicate_match (self->pv->pred, obj))
return FALSE;
- remove_object (object, NULL, self);
+ remove_object (obj, NULL, self);
return TRUE;
}
static void
on_base_added (GcrCollection *base,
- SeahorseObject *object,
+ GObject *obj,
gpointer user_data)
{
SeahorseCollection *self = SEAHORSE_COLLECTION (user_data);
- maybe_add_object (self, object);
+ maybe_add_object (self, obj);
}
static void
on_base_removed (GcrCollection *base,
- SeahorseObject *object,
+ GObject *object,
gpointer user_data)
{
SeahorseCollection *self = SEAHORSE_COLLECTION (user_data);
@@ -135,15 +135,15 @@ on_base_removed (GcrCollection *base,
}
static void
-objects_to_list (SeahorseObject *sobj, gpointer *c, GList **l)
+objects_to_list (GObject *obj, gpointer *c, GList **l)
{
- *l = g_list_append (*l, sobj);
+ *l = g_list_append (*l, obj);
}
static void
-objects_to_hash (SeahorseObject *sobj, gpointer *c, GHashTable *ht)
+objects_to_hash (GObject *obj, gpointer *c, GHashTable *ht)
{
- g_hash_table_replace (ht, sobj, NULL);
+ g_hash_table_replace (ht, obj, NULL);
}
static void
diff --git a/libseahorse/seahorse-commands.c b/libseahorse/seahorse-commands.c
index fcbdbb5..4d7f3cb 100644
--- a/libseahorse/seahorse-commands.c
+++ b/libseahorse/seahorse-commands.c
@@ -45,8 +45,9 @@ G_DEFINE_TYPE (SeahorseCommands, seahorse_commands, G_TYPE_OBJECT);
* OBJECT
*/
-static void
-seahorse_commands_real_show_properties (SeahorseCommands* self, SeahorseObject* obj)
+static void
+seahorse_commands_real_show_properties (SeahorseCommands *self,
+ GObject *obj)
{
g_critical ("Type `%s' does not implement abstract method `seahorse_commands_show_properties'",
g_type_name (G_TYPE_FROM_INSTANCE (self)));
@@ -162,7 +163,8 @@ seahorse_commands_class_init (SeahorseCommandsClass *klass)
*/
void
-seahorse_commands_show_properties (SeahorseCommands* self, SeahorseObject* obj)
+seahorse_commands_show_properties (SeahorseCommands *self,
+ GObject *obj)
{
g_return_if_fail (SEAHORSE_IS_COMMANDS (self));
SEAHORSE_COMMANDS_GET_CLASS (self)->show_properties (self, obj);
diff --git a/libseahorse/seahorse-commands.h b/libseahorse/seahorse-commands.h
index 60d4563..5d795dc 100644
--- a/libseahorse/seahorse-commands.h
+++ b/libseahorse/seahorse-commands.h
@@ -48,20 +48,21 @@ struct _SeahorseCommandsClass {
GObjectClass parent_class;
/* Virtual methods */
-
+
void (*show_properties) (SeahorseCommands *self,
- SeahorseObject *obj);
+ GObject *object);
gboolean (*delete_objects) (SeahorseCommands *self,
- GList *obj);
+ GList *objects);
};
GType seahorse_commands_get_type (void);
-void seahorse_commands_show_properties (SeahorseCommands *self, SeahorseObject *obj);
+void seahorse_commands_show_properties (SeahorseCommands *self,
+ GObject *object);
gboolean seahorse_commands_delete_objects (SeahorseCommands *self,
- GList *obj);
+ GList *objects);
SeahorseView * seahorse_commands_get_view (SeahorseCommands *self);
diff --git a/libseahorse/seahorse-context.h b/libseahorse/seahorse-context.h
index 0e3e853..4424bb4 100644
--- a/libseahorse/seahorse-context.h
+++ b/libseahorse/seahorse-context.h
@@ -68,9 +68,6 @@ struct _SeahorseContextClass {
void (*destroy) (SeahorseContext *self);
};
-typedef void (*SeahorseObjectFunc) (struct _SeahorseObject *obj,
- gpointer user_data);
-
#define SCTX_APP() (seahorse_context_instance ())
GType seahorse_context_get_type (void);
diff --git a/libseahorse/seahorse-key-manager-store.c b/libseahorse/seahorse-key-manager-store.c
index f9a5b69..7978127 100644
--- a/libseahorse/seahorse-key-manager-store.c
+++ b/libseahorse/seahorse-key-manager-store.c
@@ -149,7 +149,7 @@ G_DEFINE_TYPE (SeahorseKeyManagerStore, seahorse_key_manager_store, GCR_TYPE_COL
/* Search through row for text */
static gboolean
-object_contains_filtered_text (SeahorseObject *object,
+object_contains_filtered_text (GObject *object,
const gchar* text)
{
gchar* name = NULL;
@@ -186,7 +186,7 @@ object_contains_filtered_text (SeahorseObject *object,
/* Called to filter each row */
static gboolean
-on_filter_visible (SeahorseObject *object,
+on_filter_visible (GObject *obj,
gpointer user_data)
{
SeahorseKeyManagerStore* self = SEAHORSE_KEY_MANAGER_STORE (user_data);
@@ -196,7 +196,7 @@ on_filter_visible (SeahorseObject *object,
/* Check the row requested */
switch (self->priv->filter_mode) {
case KEY_STORE_MODE_FILTERED:
- ret = object_contains_filtered_text (object, self->priv->filter_text);
+ ret = object_contains_filtered_text (obj, self->priv->filter_text);
break;
case KEY_STORE_MODE_ALL:
@@ -209,8 +209,8 @@ on_filter_visible (SeahorseObject *object,
};
/* If current is not being shown, double check with children */
- if (!ret && GCR_IS_COLLECTION (object)) {
- children = gcr_collection_get_objects (GCR_COLLECTION (object));
+ if (!ret && GCR_IS_COLLECTION (obj)) {
+ children = gcr_collection_get_objects (GCR_COLLECTION (obj));
for (l = children; !ret && l != NULL; l = g_list_next (l))
ret = on_filter_visible (l->data, user_data);
}
@@ -831,7 +831,7 @@ seahorse_key_manager_store_new (GcrCollection *collection,
return self;
}
-SeahorseObject*
+GObject *
seahorse_key_manager_store_get_object_from_path (GtkTreeView *view, GtkTreePath *path)
{
GtkTreeModel *model;
@@ -842,7 +842,7 @@ seahorse_key_manager_store_get_object_from_path (GtkTreeView *view, GtkTreePath
model = gtk_tree_view_get_model (view);
g_return_val_if_fail (gtk_tree_model_get_iter (model, &iter, path), NULL);
- return SEAHORSE_OBJECT (gcr_collection_model_object_for_iter (GCR_COLLECTION_MODEL (model), &iter));
+ return gcr_collection_model_object_for_iter (GCR_COLLECTION_MODEL (model), &iter);
}
GList*
@@ -859,7 +859,7 @@ seahorse_key_manager_store_get_all_objects (GtkTreeView *view)
GList*
seahorse_key_manager_store_get_selected_objects (GtkTreeView *view)
{
- SeahorseObject *sobj;
+ GObject *obj;
GList *l, *objects = NULL;
SeahorseKeyManagerStore* skstore;
GList *list, *paths = NULL;
@@ -874,9 +874,9 @@ seahorse_key_manager_store_get_selected_objects (GtkTreeView *view)
/* make object list */
for (list = paths; list != NULL; list = g_list_next (list)) {
- sobj = seahorse_key_manager_store_get_object_from_path (view, list->data);
- if (sobj != NULL)
- objects = g_list_append (objects, sobj);
+ obj = seahorse_key_manager_store_get_object_from_path (view, list->data);
+ if (obj != NULL)
+ objects = g_list_append (objects, obj);
}
/* free selected paths */
@@ -926,11 +926,11 @@ seahorse_key_manager_store_set_selected_objects (GtkTreeView *view, GList* objec
}
}
-SeahorseObject*
+GObject *
seahorse_key_manager_store_get_selected_object (GtkTreeView *view)
{
SeahorseKeyManagerStore* skstore;
- SeahorseObject *sobj = NULL;
+ GObject *obj = NULL;
GList *paths = NULL;
GtkTreeSelection *selection;
@@ -943,12 +943,12 @@ seahorse_key_manager_store_get_selected_object (GtkTreeView *view)
/* choose first object */
if (paths != NULL) {
- sobj = seahorse_key_manager_store_get_object_from_path (view, paths->data);
+ obj = seahorse_key_manager_store_get_object_from_path (view, paths->data);
/* free selected paths */
g_list_foreach (paths, (GFunc)gtk_tree_path_free, NULL);
g_list_free (paths);
}
- return sobj;
+ return obj;
}
diff --git a/libseahorse/seahorse-key-manager-store.h b/libseahorse/seahorse-key-manager-store.h
index 19495ca..610189f 100644
--- a/libseahorse/seahorse-key-manager-store.h
+++ b/libseahorse/seahorse-key-manager-store.h
@@ -62,7 +62,7 @@ SeahorseKeyManagerStore* seahorse_key_manager_store_new (Gc
GtkTreeView *view,
GSettings *settings);
-SeahorseObject* seahorse_key_manager_store_get_object_from_path (GtkTreeView *view,
+GObject * seahorse_key_manager_store_get_object_from_path (GtkTreeView *view,
GtkTreePath *path);
GList* seahorse_key_manager_store_get_all_objects (GtkTreeView *view);
@@ -72,6 +72,6 @@ void seahorse_key_manager_store_set_selected_objects (Gt
GList* seahorse_key_manager_store_get_selected_objects (GtkTreeView *view);
-SeahorseObject* seahorse_key_manager_store_get_selected_object (GtkTreeView *view);
+GObject * seahorse_key_manager_store_get_selected_object (GtkTreeView *view);
#endif /* __SEAHORSE_KEY_MANAGER_STORE_H__ */
diff --git a/libseahorse/seahorse-object-model.c b/libseahorse/seahorse-object-model.c
index f2a55c5..123e124 100644
--- a/libseahorse/seahorse-object-model.c
+++ b/libseahorse/seahorse-object-model.c
@@ -55,7 +55,7 @@ G_DEFINE_TYPE (SeahorseObjectModel, seahorse_object_model, GTK_TYPE_TREE_STORE);
typedef struct {
SeahorseObjectModel *self;
GPtrArray *refs; /* GtkTreeRowReference pointers */
- SeahorseObject *object; /* The key we're dealing with */
+ GObject *object; /* The key we're dealing with */
gpointer binding;
} SeahorseObjectRow;
@@ -64,7 +64,8 @@ typedef struct {
*/
static void
-key_notify (SeahorseObject *object, SeahorseObjectModel *self)
+key_notify (GObject *object,
+ SeahorseObjectModel *self)
{
SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
SeahorseObjectRow *skrow;
@@ -101,19 +102,22 @@ key_destroyed (gpointer data, GObject *was)
static gboolean
-remove_each (SeahorseObject *object, gchar *path, SeahorseObjectModel *self)
+remove_each (GObject *object,
+ gchar *path,
+ SeahorseObjectModel *self)
{
return TRUE;
}
-static SeahorseObjectRow*
-key_row_new (SeahorseObjectModel *self, SeahorseObject *object)
+static SeahorseObjectRow *
+key_row_new (SeahorseObjectModel *self,
+ GObject *object)
{
SeahorseObjectRow *skrow;
g_assert (SEAHORSE_IS_OBJECT_MODEL (self));
- g_assert (SEAHORSE_IS_OBJECT (object));
-
+ g_assert (G_IS_OBJECT (object));
+
skrow = g_new0 (SeahorseObjectRow, 1);
skrow->refs = g_ptr_array_new ();
skrow->self = self;
@@ -299,8 +303,9 @@ seahorse_object_model_set_column_types (SeahorseObjectModel *self, gint n_column
}
void
-seahorse_object_model_set_row_object (SeahorseObjectModel *self, GtkTreeIter *iter,
- SeahorseObject *object)
+seahorse_object_model_set_row_object (SeahorseObjectModel *self,
+ GtkTreeIter *iter,
+ GObject *object)
{
SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
SeahorseObjectRow *skrow;
@@ -309,7 +314,7 @@ seahorse_object_model_set_row_object (SeahorseObjectModel *self, GtkTreeIter *it
int i;
g_return_if_fail (SEAHORSE_IS_OBJECT_MODEL (self));
- g_return_if_fail (SEAHORSE_IS_OBJECT (object) || object == NULL);
+ g_return_if_fail (G_IS_OBJECT (object) || object == NULL);
g_return_if_fail (pv->data_column >= 0);
/* Add the row/key association */
@@ -365,7 +370,7 @@ seahorse_object_model_set_row_object (SeahorseObjectModel *self, GtkTreeIter *it
key_notify (object, self);
}
-SeahorseObject*
+GObject *
seahorse_object_model_get_row_key (SeahorseObjectModel *self, GtkTreeIter *iter)
{
SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
@@ -377,12 +382,13 @@ seahorse_object_model_get_row_key (SeahorseObjectModel *self, GtkTreeIter *iter)
gtk_tree_model_get (GTK_TREE_MODEL (self), iter, pv->data_column, &skrow, -1);
if (!skrow)
return NULL;
- g_assert (SEAHORSE_IS_OBJECT (skrow->object));
+ g_assert (G_IS_OBJECT (skrow->object));
return skrow->object;
}
void
-seahorse_object_model_remove_rows_for_object (SeahorseObjectModel *self, SeahorseObject *object)
+seahorse_object_model_remove_rows_for_object (SeahorseObjectModel *self,
+ GObject *object)
{
SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
SeahorseObjectRow *skrow;
@@ -391,7 +397,7 @@ seahorse_object_model_remove_rows_for_object (SeahorseObjectModel *self, Seahors
int i;
g_return_if_fail (SEAHORSE_IS_OBJECT_MODEL (self));
- g_return_if_fail (SEAHORSE_IS_OBJECT (object));
+ g_return_if_fail (G_IS_OBJECT (object));
g_return_if_fail (pv->data_column >= 0);
skrow = (SeahorseObjectRow*)g_hash_table_lookup (pv->rows, object);
@@ -413,7 +419,8 @@ seahorse_object_model_remove_rows_for_object (SeahorseObjectModel *self, Seahors
}
GList*
-seahorse_object_model_get_rows_for_object (SeahorseObjectModel *self, SeahorseObject *object)
+seahorse_object_model_get_rows_for_object (SeahorseObjectModel *self,
+ GObject *object)
{
SeahorseObjectModelPrivate *pv = SEAHORSE_OBJECT_MODEL_GET_PRIVATE (self);
GList *rows = NULL;
@@ -423,8 +430,8 @@ seahorse_object_model_get_rows_for_object (SeahorseObjectModel *self, SeahorseOb
int i;
g_return_val_if_fail (SEAHORSE_IS_OBJECT_MODEL (self), NULL);
- g_return_val_if_fail (SEAHORSE_IS_OBJECT (object), NULL);
-
+ g_return_val_if_fail (G_IS_OBJECT (object), NULL);
+
skrow = (SeahorseObjectRow*)g_hash_table_lookup (pv->rows, object);
if (!skrow)
return NULL;
diff --git a/libseahorse/seahorse-object-model.h b/libseahorse/seahorse-object-model.h
index b561da1..3d24785 100644
--- a/libseahorse/seahorse-object-model.h
+++ b/libseahorse/seahorse-object-model.h
@@ -52,12 +52,12 @@ struct _SeahorseObjectModel {
};
struct _SeahorseObjectModelClass {
- GtkTreeStoreClass parent_class;
-
- /* signals --------------------------------------------------------- */
-
- /* A key was added to this view */
- void (*update_row) (SeahorseObjectModel *self, SeahorseObject *object, GtkTreeIter *iter);
+ GtkTreeStoreClass parent_class;
+
+ /* A key was added to this view */
+ void (*update_row) (SeahorseObjectModel *self,
+ GObject *object,
+ GtkTreeIter *iter);
};
GType seahorse_object_model_get_type (void);
@@ -71,16 +71,16 @@ void seahorse_object_model_set_column_types (SeahorseObjec
void seahorse_object_model_set_row_object (SeahorseObjectModel *self,
GtkTreeIter *iter,
- SeahorseObject *object);
+ GObject *object);
-SeahorseObject* seahorse_object_model_get_row_key (SeahorseObjectModel *self,
+GObject* seahorse_object_model_get_row_key (SeahorseObjectModel *self,
GtkTreeIter *iter);
-GList* seahorse_object_model_get_rows_for_object (SeahorseObjectModel *self,
- SeahorseObject *object);
+GList* seahorse_object_model_get_rows_for_object (SeahorseObjectModel *self,
+ GObject *object);
void seahorse_object_model_remove_rows_for_object (SeahorseObjectModel *self,
- SeahorseObject *object);
+ GObject *object);
void seahorse_object_model_free_rows (GList *rows);
diff --git a/libseahorse/seahorse-object-widget.c b/libseahorse/seahorse-object-widget.c
index c62d248..9bcad8b 100644
--- a/libseahorse/seahorse-object-widget.c
+++ b/libseahorse/seahorse-object-widget.c
@@ -103,8 +103,8 @@ seahorse_object_widget_finalize (GObject *gobject)
self = SEAHORSE_OBJECT_WIDGET (gobject);
swidget = SEAHORSE_WIDGET (self);
-
- g_return_if_fail (SEAHORSE_IS_OBJECT (self->object));
+
+ g_return_if_fail (G_IS_OBJECT (self->object));
/* get widgets hash from types */
widgets = g_hash_table_lookup (types, self->object);
@@ -186,8 +186,10 @@ seahorse_object_widget_destroyed (gpointer data, GObject *object)
* Makes use of hash sets to control which widgets can be created and how
* the focus is grabbed.
*/
-static SeahorseWidget*
-seahorse_object_widget_create (gchar *name, GtkWindow *parent, SeahorseObject *object)
+static SeahorseWidget *
+seahorse_object_widget_create (gchar *name,
+ GtkWindow *parent,
+ GObject *object)
{
SeahorseWidget *swidget = NULL; // widget to lookup or create
GHashTable *widgets = NULL; // hash of widgets from types
@@ -249,8 +251,10 @@ seahorse_object_widget_create (gchar *name, GtkWindow *parent, SeahorseObject *o
return swidget;
}
-SeahorseWidget*
-seahorse_object_widget_new (gchar *name, GtkWindow *parent, SeahorseObject *object)
+SeahorseWidget *
+seahorse_object_widget_new (gchar *name,
+ GtkWindow *parent,
+ GObject *object)
{
return seahorse_object_widget_create (name, parent, object);
}
diff --git a/libseahorse/seahorse-object-widget.h b/libseahorse/seahorse-object-widget.h
index 662fc0a..5c527dd 100644
--- a/libseahorse/seahorse-object-widget.h
+++ b/libseahorse/seahorse-object-widget.h
@@ -36,20 +36,20 @@
typedef struct _SeahorseObjectWidget SeahorseObjectWidget;
typedef struct _SeahorseObjectWidgetClass SeahorseObjectWidgetClass;
-
+
struct _SeahorseObjectWidget {
- SeahorseWidget parent;
- SeahorseObject *object;
+ SeahorseWidget parent;
+ GObject *object;
};
struct _SeahorseObjectWidgetClass {
SeahorseWidgetClass parent_class;
};
-GType seahorse_object_widget_get_type (void);
+GType seahorse_object_widget_get_type (void);
-SeahorseWidget* seahorse_object_widget_new (gchar *name,
- GtkWindow *parent,
- SeahorseObject *object);
+SeahorseWidget * seahorse_object_widget_new (gchar *name,
+ GtkWindow *parent,
+ GObject *object);
#endif /* __SEAHORSE_OBJECT_WIDGET_H__ */
diff --git a/libseahorse/seahorse-object.c b/libseahorse/seahorse-object.c
index 2e36faa..4dc84cf 100644
--- a/libseahorse/seahorse-object.c
+++ b/libseahorse/seahorse-object.c
@@ -30,8 +30,7 @@
#include <glib/gi18n.h>
-/**
- * _SeahorseObjectProps:
+/*
* @PROP_0:
* @PROP_SOURCE:
* @PROP_LABEL:
@@ -55,7 +54,6 @@ enum _SeahorseObjectProps {
};
/**
- * _SeahorseObjectPrivate:
* @source: Where did the object come from ?
* @label: DBUS: "display-name"
* @markup: Markup text
@@ -546,40 +544,32 @@ seahorse_object_get_flags (SeahorseObject *self)
*/
gboolean
seahorse_predicate_match (SeahorsePredicate *self,
- SeahorseObject* object)
+ GObject* obj)
{
SeahorseObjectPrivate *pv;
- g_return_val_if_fail (SEAHORSE_IS_OBJECT (object), FALSE);
- pv = object->pv;
+ g_return_val_if_fail (G_IS_OBJECT (obj), FALSE);
/* Check all the fields */
- if (self->type != 0 && !G_TYPE_CHECK_INSTANCE_TYPE (object, self->type))
- return FALSE;
- if (self->usage != 0 && self->usage != pv->usage)
- return FALSE;
- if (self->flags != 0 && (self->flags & pv->flags) == 0)
- return FALSE;
- if (self->nflags != 0 && (self->nflags & pv->flags) != 0)
- return FALSE;
- if (self->source != NULL && self->source != pv->source)
+ if (self->type != 0 && !G_TYPE_CHECK_INSTANCE_TYPE (obj, self->type))
return FALSE;
+ if (SEAHORSE_IS_OBJECT (obj)) {
+ g_return_val_if_fail (SEAHORSE_IS_OBJECT (obj), FALSE);
+ pv = SEAHORSE_OBJECT (obj)->pv;
+ if (self->usage != 0 && self->usage != pv->usage)
+ return FALSE;
+ if (self->flags != 0 && (self->flags & pv->flags) == 0)
+ return FALSE;
+ if (self->nflags != 0 && (self->nflags & pv->flags) != 0)
+ return FALSE;
+ if (self->source != NULL && self->source != pv->source)
+ return FALSE;
+ }
+
/* And any custom stuff */
- if (self->custom != NULL && !self->custom (object, self->custom_target))
+ if (self->custom != NULL && !self->custom (obj, self->custom_target))
return FALSE;
return TRUE;
}
-
-/**
- * seahorse_predicate_clear:
- * @self: The predicate to clean
- *
- * Clears a seahorse predicate (#SeahorsePredicate)
- */
-void
-seahorse_predicate_clear (SeahorsePredicate *self)
-{
- memset (self, 0, sizeof (*self));
-}
diff --git a/libseahorse/seahorse-predicate.h b/libseahorse/seahorse-predicate.h
index 5511165..3fa78bb 100644
--- a/libseahorse/seahorse-predicate.h
+++ b/libseahorse/seahorse-predicate.h
@@ -29,7 +29,7 @@
#include <glib-object.h>
-typedef gboolean (*SeahorsePredicateFunc) (SeahorseObject *object,
+typedef gboolean (*SeahorsePredicateFunc) (GObject *obj,
void *user_data);
typedef struct _SeahorsePredicate SeahorsePredicate;
@@ -44,9 +44,7 @@ struct _SeahorsePredicate {
gpointer custom_target;
};
-void seahorse_predicate_clear (SeahorsePredicate *self);
-
gboolean seahorse_predicate_match (SeahorsePredicate *self,
- SeahorseObject *object);
+ GObject *obj);
#endif /* __SEAHORSE_PREDICATE_H__ */
diff --git a/libseahorse/seahorse-source.c b/libseahorse/seahorse-source.c
index d88308f..28b6603 100644
--- a/libseahorse/seahorse-source.c
+++ b/libseahorse/seahorse-source.c
@@ -184,7 +184,7 @@ seahorse_source_export_auto_async (GList *objects,
GSimpleAsyncResult *res;
export_auto_closure *closure;
SeahorseSource *source;
- SeahorseObject *object;
+ GObject *object;
GList *next;
res = g_simple_async_result_new (NULL, callback, user_data,
@@ -202,11 +202,12 @@ seahorse_source_export_auto_async (GList *objects,
/* Break off one set (same source) */
next = seahorse_util_objects_splice (objects);
- g_assert (SEAHORSE_IS_OBJECT (objects->data));
- object = SEAHORSE_OBJECT (objects->data);
+ g_assert (G_IS_OBJECT (objects->data));
+ object = G_OBJECT (objects->data);
/* Export from this object source */
- source = seahorse_object_get_source (object);
+ source = NULL;
+ g_object_get (object, "source", &source, NULL);
g_return_if_fail (source != NULL);
/* We pass our own data object, to which data is appended */
diff --git a/libseahorse/seahorse-source.h b/libseahorse/seahorse-source.h
index aeec9b1..162b895 100644
--- a/libseahorse/seahorse-source.h
+++ b/libseahorse/seahorse-source.h
@@ -26,8 +26,6 @@
* - A generic interface for accessing sources.
* - Eventually more functionality will be merged from seahorse-op.* into
* this class and derived classes.
- * - Each SeahorseObject has a weak pointer to the SeahorseSource that
- * created it.
*
* Properties base classes must implement:
* ktype: (GQuark) The ktype (ie: SEAHORSE_PGP) of objects originating from this
@@ -52,8 +50,6 @@
#define SEAHORSE_IS_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_SOURCE))
#define SEAHORSE_SOURCE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SEAHORSE_TYPE_SOURCE, SeahorseSourceIface))
-struct _SeahorseObject;
-
typedef struct _SeahorseSource SeahorseSource;
typedef struct _SeahorseSourceIface SeahorseSourceIface;
diff --git a/libseahorse/seahorse-util.c b/libseahorse/seahorse-util.c
index 979b542..3d4d14c 100644
--- a/libseahorse/seahorse-util.c
+++ b/libseahorse/seahorse-util.c
@@ -430,16 +430,14 @@ seahorse_util_printf_fd (int fd, const char* fmt, ...)
gchar*
seahorse_util_filename_for_objects (GList *objects)
{
- SeahorseObject *object;
- const gchar *name;
+ const gchar *name = NULL;
gchar *filename;
-
+
g_return_val_if_fail (g_list_length (objects) > 0, NULL);
if (g_list_length (objects) == 1) {
- g_return_val_if_fail (SEAHORSE_IS_OBJECT (objects->data), NULL);
- object = SEAHORSE_OBJECT (objects->data);
- name = seahorse_object_get_nickname (object);
+ if (SEAHORSE_IS_OBJECT (objects->data))
+ name = seahorse_object_get_nickname (SEAHORSE_OBJECT (objects->data));
if (name == NULL)
name = _("Key Data");
} else {
@@ -817,11 +815,12 @@ seahorse_util_chooser_set_filename_full (GtkDialog *dialog, GList *objects)
/**
* seahorse_util_chooser_set_filename:
* @dialog: set the dialog for this
- * @object: The object to use for the filename. #SeahorseObject
+ * @object: The object to use for the filename. #GObject
*
*/
void
-seahorse_util_chooser_set_filename (GtkDialog *dialog, SeahorseObject *object)
+seahorse_util_chooser_set_filename (GtkDialog *dialog,
+ GObject *object)
{
GList *objects = g_list_append (NULL, object);
seahorse_util_chooser_set_filename_full (dialog, objects);
@@ -906,27 +905,27 @@ seahorse_util_chooser_open_prompt (GtkDialog *dialog)
* Returns: if source of k1<k2 it returns -1,
* 1 will be returned if k1>k2. If the sources are equal it returns 0
*/
-static gint
-sort_objects_by_source (SeahorseObject *k1, SeahorseObject *k2)
+static gint
+sort_objects_by_source (GObject *k1,
+ GObject *k2)
{
- SeahorseSource *sk1, *sk2;
-
- g_assert (SEAHORSE_IS_OBJECT (k1));
- g_assert (SEAHORSE_IS_OBJECT (k2));
-
- sk1 = seahorse_object_get_source (k1);
- sk2 = seahorse_object_get_source (k2);
-
- if (sk1 == sk2)
- return 0;
-
- return sk1 < sk2 ? -1 : 1;
-}
+ SeahorseSource *sk1 = NULL;
+ SeahorseSource *sk2 = NULL;
+ g_assert (G_IS_OBJECT (k1));
+ g_assert (G_IS_OBJECT (k2));
+
+ g_object_get (k1, "source", &sk1, NULL);
+ g_object_get (k2, "source", &sk2, NULL);
+
+ if (sk1 == sk2)
+ return 0;
+ return sk1 < sk2 ? -1 : 1;
+}
/**
* seahorse_util_objects_sort:
- * @objects: #SeahorseObject #GList to sort
+ * @objects: #GObject #GList to sort
*
* The objects are sorted by their source
*
@@ -941,7 +940,7 @@ seahorse_util_objects_sort (GList *objects)
/**
* seahorse_util_objects_splice:
- * @objects: A #GList of #SeahorseObject. Must be sorted
+ * @objects: A #GList of #GObject. Must be sorted
*
* Splices the list at the source disconuity
*
@@ -958,9 +957,12 @@ seahorse_util_objects_splice (GList *objects)
for ( ; objects; objects = g_list_next (objects)) {
- g_return_val_if_fail (SEAHORSE_IS_OBJECT (objects->data), NULL);
- sk = seahorse_object_get_source (SEAHORSE_OBJECT (objects->data));
-
+ g_return_val_if_fail (G_IS_OBJECT (objects->data), NULL);
+
+ sk = NULL;
+ g_object_get (objects->data, "source", &sk, NULL);
+ g_return_val_if_fail (sk != NULL, NULL);
+
/* Found a disconuity */
if (psk && sk != psk) {
g_assert (prev != NULL);
diff --git a/libseahorse/seahorse-util.h b/libseahorse/seahorse-util.h
index 93b24a1..bd0f45e 100644
--- a/libseahorse/seahorse-util.h
+++ b/libseahorse/seahorse-util.h
@@ -36,8 +36,6 @@
const AvahiPoll* seahorse_util_dns_sd_get_poll (void);
#endif
-struct _SeahorseObject;
-
typedef guint64 SeahorseVersion;
#define SEAHORSE_EXT_ASC ".asc"
@@ -110,7 +108,7 @@ void seahorse_util_chooser_set_filename_full (GtkDialog *dialog,
GList *objects);
void seahorse_util_chooser_set_filename (GtkDialog *dialog,
- struct _SeahorseObject *object);
+ GObject *object);
gchar* seahorse_util_chooser_open_prompt (GtkDialog *dialog);
diff --git a/libseahorse/seahorse-view.c b/libseahorse/seahorse-view.c
index 61d349e..9ecb4b7 100644
--- a/libseahorse/seahorse-view.c
+++ b/libseahorse/seahorse-view.c
@@ -45,7 +45,7 @@ seahorse_view_get_selected_matching (SeahorseView *self,
return SEAHORSE_VIEW_GET_INTERFACE (self)->get_selected_matching (self, pred);
}
-SeahorseObject*
+GObject *
seahorse_view_get_selected (SeahorseView* self)
{
g_return_val_if_fail (SEAHORSE_VIEW_GET_INTERFACE (self)->get_selected, NULL);
@@ -54,7 +54,8 @@ seahorse_view_get_selected (SeahorseView* self)
void
-seahorse_view_set_selected (SeahorseView* self, SeahorseObject* value)
+seahorse_view_set_selected (SeahorseView* self,
+ GObject* value)
{
g_return_if_fail (SEAHORSE_VIEW_GET_INTERFACE (self)->set_selected);
SEAHORSE_VIEW_GET_INTERFACE (self)->set_selected (self, value);
diff --git a/libseahorse/seahorse-view.h b/libseahorse/seahorse-view.h
index 46b5598..c047cbd 100644
--- a/libseahorse/seahorse-view.h
+++ b/libseahorse/seahorse-view.h
@@ -51,11 +51,11 @@ struct _SeahorseViewIface {
GList* (*get_selected_matching) (SeahorseView *self,
SeahorsePredicate *pred);
-
- SeahorseObject* (*get_selected) (SeahorseView *self);
-
+
+ GObject * (*get_selected) (SeahorseView *self);
+
void (*set_selected) (SeahorseView *self,
- SeahorseObject *value);
+ GObject *value);
GtkWindow* (*get_window) (SeahorseView *self);
@@ -80,10 +80,10 @@ void seahorse_view_set_selected_objects (SeahorseView *self,
GList* seahorse_view_get_selected_matching (SeahorseView *self,
SeahorsePredicate *pred);
-SeahorseObject* seahorse_view_get_selected (SeahorseView *self);
+GObject * seahorse_view_get_selected (SeahorseView *self);
void seahorse_view_set_selected (SeahorseView *self,
- SeahorseObject *value);
+ GObject *value);
GtkWindow* seahorse_view_get_window (SeahorseView *self);
diff --git a/libseahorse/seahorse-viewer.c b/libseahorse/seahorse-viewer.c
index 62bc38a..06f3d06 100644
--- a/libseahorse/seahorse-viewer.c
+++ b/libseahorse/seahorse-viewer.c
@@ -211,19 +211,18 @@ filter_matching_objects (SeahorsePredicate *pred,
GList** all_objects)
{
GList *results, *next, *here;
- SeahorseObject *object;
+ GObject *obj;
results = NULL;
next = *all_objects;
while ((here = next) != NULL) {
- g_return_val_if_fail (SEAHORSE_IS_OBJECT (here->data), NULL);
- object = SEAHORSE_OBJECT (here->data);
+ obj = G_OBJECT (here->data);
next = g_list_next (here);
/* If it matches then separate it */
- if (seahorse_predicate_match (pred, object)) {
- results = g_list_append (results, object);
+ if (seahorse_predicate_match (pred, obj)) {
+ results = g_list_append (results, obj);
*all_objects = g_list_delete_link (*all_objects, here);
}
}
@@ -235,15 +234,10 @@ static gboolean
has_matching_objects (SeahorsePredicate *pred,
GList *objects)
{
- SeahorseObject *object;
GList *l;
for (l = objects; l; l = g_list_next (l)) {
- g_return_val_if_fail (SEAHORSE_IS_OBJECT (l->data), FALSE);
- object = SEAHORSE_OBJECT (l->data);
-
- /* If it matches then separate it */
- if (seahorse_predicate_match (pred, object))
+ if (seahorse_predicate_match (pred, l->data))
return TRUE;
}
@@ -422,11 +416,13 @@ on_key_delete (GtkAction* action, SeahorseViewer* self)
/* Check for private objects */
for (l = objects; l; l = g_list_next (l)) {
- SeahorseObject* object = l->data;
+ GObject* object = l->data;
- if (seahorse_object_get_usage (object) == SEAHORSE_USAGE_PRIVATE_KEY) {
+ /* TODO: Need to rework this for PKCS#11 keys */
+ if (SEAHORSE_IS_OBJECT (object) &&
+ seahorse_object_get_usage (SEAHORSE_OBJECT (object)) == SEAHORSE_USAGE_PRIVATE_KEY) {
gchar* prompt = g_strdup_printf (_("%s is a private key. Are you sure you want to proceed?"),
- seahorse_object_get_label (object));
+ seahorse_object_get_label (SEAHORSE_OBJECT (object)));
if (!seahorse_util_prompt_delete (prompt, GTK_WIDGET (seahorse_viewer_get_window (self)))) {
g_free (prompt);
g_list_free (objects);
@@ -447,8 +443,6 @@ show_properties_for_selected (SeahorseViewer *self,
SeahorsePredicate *pred,
gpointer user_data)
{
- g_return_val_if_fail (SEAHORSE_IS_OBJECT (user_data), FALSE);
-
/* If not mactched, then continue enumeration */
if (!seahorse_predicate_match (pred, user_data))
return TRUE;
@@ -813,8 +807,9 @@ seahorse_viewer_set_selected_objects (SeahorseViewer* self, GList* objects)
SEAHORSE_VIEWER_GET_CLASS (self)->set_selected_objects (self, objects);
}
-SeahorseObject*
-seahorse_viewer_get_selected_object_and_uid (SeahorseViewer* self, guint* uid)
+GObject *
+seahorse_viewer_get_selected_object_and_uid (SeahorseViewer *self,
+ guint *uid)
{
g_return_val_if_fail (SEAHORSE_IS_VIEWER (self), NULL);
g_return_val_if_fail (SEAHORSE_VIEWER_GET_CLASS (self)->get_selected_object_and_uid, NULL);
@@ -838,10 +833,10 @@ seahorse_viewer_show_context_menu (SeahorseViewer* self, guint button, guint tim
}
void
-seahorse_viewer_show_properties (SeahorseViewer* self, SeahorseObject* obj)
+seahorse_viewer_show_properties (SeahorseViewer* self, GObject* obj)
{
g_return_if_fail (SEAHORSE_IS_VIEWER (self));
- g_return_if_fail (SEAHORSE_IS_OBJECT (obj));
+ g_return_if_fail (G_IS_OBJECT (obj));
for_each_commands (self, show_properties_for_selected, obj);
}
@@ -876,7 +871,7 @@ seahorse_viewer_set_numbered_status (SeahorseViewer* self, const char* text, gin
g_free (message);
}
-SeahorseObject*
+GObject *
seahorse_viewer_get_selected (SeahorseViewer* self)
{
g_return_val_if_fail (SEAHORSE_IS_VIEWER (self), NULL);
@@ -886,7 +881,8 @@ seahorse_viewer_get_selected (SeahorseViewer* self)
}
void
-seahorse_viewer_set_selected (SeahorseViewer* self, SeahorseObject* value)
+seahorse_viewer_set_selected (SeahorseViewer *self,
+ GObject *value)
{
g_return_if_fail (SEAHORSE_IS_VIEWER (self));
g_return_if_fail (SEAHORSE_VIEWER_GET_CLASS (self)->set_selected);
diff --git a/libseahorse/seahorse-viewer.h b/libseahorse/seahorse-viewer.h
index 6b5ef27..4eb75cb 100644
--- a/libseahorse/seahorse-viewer.h
+++ b/libseahorse/seahorse-viewer.h
@@ -48,19 +48,22 @@ struct _SeahorseViewerClass {
/* virtual -------------------------------------------------------- */
- GList* (*get_selected_objects) (SeahorseViewer* self);
+ GList * (*get_selected_objects) (SeahorseViewer *self);
- void (*set_selected_objects) (SeahorseViewer* self, GList* objects);
+ void (*set_selected_objects) (SeahorseViewer *self,
+ GList *objects);
- SeahorseObject* (*get_selected_object_and_uid) (SeahorseViewer* self, guint* uid);
+ GObject * (*get_selected_object_and_uid) (SeahorseViewer* self,
+ guint *uid);
- SeahorseObject* (*get_selected) (SeahorseViewer* self);
+ GObject * (*get_selected) (SeahorseViewer* self);
- void (*set_selected) (SeahorseViewer* self, SeahorseObject* value);
+ void (*set_selected) (SeahorseViewer* self,
+ GObject* value);
/* signals --------------------------------------------------------- */
- void (*signal) (SeahorseViewer *viewer);
+ void (*signal) (SeahorseViewer *viewer);
};
GType seahorse_viewer_get_type (void);
@@ -75,15 +78,15 @@ GList* seahorse_viewer_get_selected_objects (SeahorseVie
void seahorse_viewer_set_selected_objects (SeahorseViewer* self,
GList* objects);
-SeahorseObject* seahorse_viewer_get_selected_object_and_uid (SeahorseViewer* self,
- guint* uid);
+GObject * seahorse_viewer_get_selected_object_and_uid (SeahorseViewer *self,
+ guint *uid);
void seahorse_viewer_show_context_menu (SeahorseViewer* self,
guint button,
guint time);
void seahorse_viewer_show_properties (SeahorseViewer* self,
- SeahorseObject* obj);
+ GObject* obj);
void seahorse_viewer_set_status (SeahorseViewer* self,
const char* text);
@@ -92,10 +95,10 @@ void seahorse_viewer_set_numbered_status (SeahorseVie
const char* text,
gint num);
-SeahorseObject* seahorse_viewer_get_selected (SeahorseViewer* self);
+GObject * seahorse_viewer_get_selected (SeahorseViewer *self);
-void seahorse_viewer_set_selected (SeahorseViewer* self,
- SeahorseObject* value);
+void seahorse_viewer_set_selected (SeahorseViewer *self,
+ GObject *value);
GtkWindow* seahorse_viewer_get_window (SeahorseViewer* self);
diff --git a/pgp/seahorse-gpgme-add-subkey.c b/pgp/seahorse-gpgme-add-subkey.c
index 2c347a2..55be01f 100644
--- a/pgp/seahorse-gpgme-add-subkey.c
+++ b/pgp/seahorse-gpgme-add-subkey.c
@@ -173,8 +173,8 @@ seahorse_gpgme_add_subkey_new (SeahorseGpgmeKey *pkey, GtkWindow *parent)
GtkTreeIter iter;
GtkCellRenderer *renderer;
GtkWidget *widget, *datetime;
-
- swidget = seahorse_object_widget_new ("add-subkey", parent, SEAHORSE_OBJECT (pkey));
+
+ swidget = seahorse_object_widget_new ("add-subkey", parent, G_OBJECT (pkey));
g_return_if_fail (swidget != NULL);
gtk_window_set_title (GTK_WINDOW (seahorse_widget_get_widget (swidget, swidget->name)),
diff --git a/pgp/seahorse-gpgme-add-uid.c b/pgp/seahorse-gpgme-add-uid.c
index 3d37fe6..2415367 100644
--- a/pgp/seahorse-gpgme-add-uid.c
+++ b/pgp/seahorse-gpgme-add-uid.c
@@ -81,10 +81,10 @@ on_gpgme_add_uid_ok_clicked (GtkButton *button,
gpointer user_data)
{
SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data);
- SeahorseObject *object;
+ GObject *object;
const gchar *name, *email, *comment;
gpgme_error_t err;
-
+
object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
name = gtk_entry_get_text (GTK_ENTRY (
@@ -113,8 +113,8 @@ seahorse_gpgme_add_uid_new (SeahorseGpgmeKey *pkey, GtkWindow *parent)
{
SeahorseWidget *swidget;
const gchar *userid;
-
- swidget = seahorse_object_widget_new ("add-uid", parent, SEAHORSE_OBJECT (pkey));
+
+ swidget = seahorse_object_widget_new ("add-uid", parent, G_OBJECT (pkey));
g_return_if_fail (swidget != NULL);
userid = seahorse_object_get_label (SEAHORSE_OBJECT (pkey));
diff --git a/pgp/seahorse-keyserver-results.c b/pgp/seahorse-keyserver-results.c
index cd82d70..59ba31a 100644
--- a/pgp/seahorse-keyserver-results.c
+++ b/pgp/seahorse-keyserver-results.c
@@ -98,7 +98,7 @@ on_view_selection_changed (GtkTreeSelection *selection, SeahorseKeyserverResults
static void
on_row_activated (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, SeahorseKeyserverResults *self)
{
- SeahorseObject *obj;
+ GObject *obj;
g_return_if_fail (SEAHORSE_IS_KEYSERVER_RESULTS (self));
g_return_if_fail (GTK_IS_TREE_VIEW (view));
@@ -123,7 +123,7 @@ on_key_list_button_pressed (GtkTreeView* view, GdkEventButton* event, SeahorseKe
G_MODULE_EXPORT gboolean
on_key_list_popup_menu (GtkTreeView* view, SeahorseKeyserverResults* self)
{
- SeahorseObject* key;
+ GObject* key;
g_return_val_if_fail (SEAHORSE_IS_KEYSERVER_RESULTS (self), FALSE);
g_return_val_if_fail (GTK_IS_TREE_VIEW (view), FALSE);
@@ -308,8 +308,8 @@ seahorse_keyserver_results_set_selected_objects (SeahorseViewer* base, GList* ke
seahorse_key_manager_store_set_selected_objects (self->pv->view, keys);
}
-static SeahorseObject*
-seahorse_keyserver_results_get_selected (SeahorseViewer* base)
+static GObject *
+seahorse_keyserver_results_get_selected (SeahorseViewer *base)
{
SeahorseKeyserverResults* self;
self = SEAHORSE_KEYSERVER_RESULTS (base);
@@ -317,7 +317,8 @@ seahorse_keyserver_results_get_selected (SeahorseViewer* base)
}
static void
-seahorse_keyserver_results_set_selected (SeahorseViewer* base, SeahorseObject* value)
+seahorse_keyserver_results_set_selected (SeahorseViewer *base,
+ GObject *value)
{
SeahorseKeyserverResults* self = SEAHORSE_KEYSERVER_RESULTS (base);
GList* keys = NULL;
diff --git a/pgp/seahorse-pgp-commands.c b/pgp/seahorse-pgp-commands.c
index f7511be..a94b512 100644
--- a/pgp/seahorse-pgp-commands.c
+++ b/pgp/seahorse-pgp-commands.c
@@ -155,12 +155,11 @@ static const GtkActionEntry COMMAND_ENTRIES[] = {
*/
static void
-seahorse_pgp_commands_show_properties (SeahorseCommands* base, SeahorseObject* obj)
+seahorse_pgp_commands_show_properties (SeahorseCommands* base,
+ GObject* obj)
{
- g_return_if_fail (SEAHORSE_IS_OBJECT (obj));
-
if (SEAHORSE_IS_PGP_UID (obj))
- obj = SEAHORSE_OBJECT (seahorse_pgp_uid_get_parent (SEAHORSE_PGP_UID (obj)));
+ obj = G_OBJECT (seahorse_pgp_uid_get_parent (SEAHORSE_PGP_UID (obj)));
g_return_if_fail (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_TYPE_PGP_KEY ||
G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_TYPE_GPGME_KEY);
@@ -354,7 +353,7 @@ seahorse_pgp_commands_class_init (SeahorsePgpCommandsClass *klass)
gobject_class->finalize = seahorse_pgp_commands_finalize;
gobject_class->set_property = seahorse_pgp_commands_set_property;
gobject_class->get_property = seahorse_pgp_commands_get_property;
-
+
SEAHORSE_COMMANDS_CLASS (klass)->show_properties = seahorse_pgp_commands_show_properties;
SEAHORSE_COMMANDS_CLASS (klass)->delete_objects = seahorse_pgp_commands_delete_objects;
diff --git a/pgp/seahorse-pgp-key-properties.c b/pgp/seahorse-pgp-key-properties.c
index 9f01800..d757189 100644
--- a/pgp/seahorse-pgp-key-properties.c
+++ b/pgp/seahorse-pgp-key-properties.c
@@ -237,7 +237,7 @@ on_pgp_signature_row_activated (GtkTreeView *treeview,
gpointer user_data)
{
SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data);
- SeahorseObject *object = NULL;
+ GObject *object = NULL;
GtkTreeModel *model;
GtkTreeIter iter;
@@ -300,7 +300,7 @@ on_pgp_names_add_clicked (GtkWidget *widget,
gpointer user_data)
{
SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data);
- SeahorseObject *obj = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+ GObject *obj = SEAHORSE_OBJECT_WIDGET (swidget)->object;
g_return_if_fail (SEAHORSE_IS_GPGME_KEY (obj));
seahorse_gpgme_add_uid_new (SEAHORSE_GPGME_KEY (obj),
GTK_WINDOW (seahorse_widget_get_widget (swidget, swidget->name)));
@@ -430,7 +430,7 @@ names_update_row (SeahorseObjectModel *skmodel, SeahorseObject *object,
static void
names_populate (SeahorseWidget *swidget, GtkTreeStore *store, SeahorsePgpKey *pkey)
{
- SeahorseObject *object;
+ GObject *object;
GtkTreeIter uiditer, sigiter;
GList *keyids = NULL;
SeahorsePgpUid *uid;
@@ -476,7 +476,7 @@ names_populate (SeahorseWidget *swidget, GtkTreeStore *store, SeahorsePgpKey *pk
/* Add the keys to the store */
for (l = keys; l; l = g_list_next (l)) {
- object = SEAHORSE_OBJECT (l->data);
+ object = G_OBJECT (l->data);
gtk_tree_store_append (store, &sigiter, &uiditer);
/* This calls the 'update-row' callback, to set the values for the key */
@@ -493,8 +493,8 @@ do_names (SeahorseWidget *swidget)
GtkWidget *widget;
GtkTreeStore *store;
GtkCellRenderer *renderer;
-
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
pkey = SEAHORSE_PGP_KEY (object);
if (seahorse_object_get_usage (object) != SEAHORSE_USAGE_PRIVATE_KEY)
@@ -548,9 +548,9 @@ do_names_signals (SeahorseWidget *swidget)
SeahorseObject *object;
GtkTreeSelection *selection;
GtkWidget *widget;
-
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
-
+
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
+
if (seahorse_object_get_usage (object) != SEAHORSE_USAGE_PRIVATE_KEY)
return;
widget = seahorse_widget_get_widget (swidget, "names-tree");
@@ -833,7 +833,7 @@ on_pgp_owner_passphrase_button_clicked (GtkWidget *widget,
gpointer user_data)
{
SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data);
- SeahorseObject *object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+ SeahorseObject *object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
if (seahorse_object_get_usage (object) == SEAHORSE_USAGE_PRIVATE_KEY &&
SEAHORSE_IS_GPGME_KEY (object))
seahorse_gpgme_key_op_change_pass (SEAHORSE_GPGME_KEY (object));
@@ -845,8 +845,8 @@ do_owner_signals (SeahorseWidget *swidget)
SeahorseObject *object;
SeahorseUsage etype;
GtkWidget *frame;
-
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
etype = seahorse_object_get_usage (object);
if (etype == SEAHORSE_USAGE_PRIVATE_KEY ) {
@@ -879,7 +879,7 @@ do_owner (SeahorseWidget *swidget)
GList *uids, *l;
GIcon *icon;
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
pkey = SEAHORSE_PGP_KEY (object);
flags = seahorse_object_get_flags (object);
@@ -1048,7 +1048,7 @@ on_pgp_details_add_subkey_button (GtkButton *button,
gpointer user_data)
{
SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data);
- SeahorseObject *object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+ GObject *object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
g_return_if_fail (SEAHORSE_IS_GPGME_KEY (object));
seahorse_gpgme_add_subkey_new (SEAHORSE_GPGME_KEY (object), GTK_WINDOW (seahorse_widget_get_widget (swidget, swidget->name)));
}
@@ -1114,8 +1114,8 @@ on_pgp_details_trust_changed (GtkComboBox *selection,
set = gtk_combo_box_get_active_iter (selection, &iter);
if (!set)
return;
-
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
g_return_if_fail (SEAHORSE_IS_GPGME_KEY (object));
model = gtk_combo_box_get_model (selection);
@@ -1151,7 +1151,7 @@ on_pgp_details_export_button (GtkWidget *widget,
gpointer user_data)
{
SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data);
- SeahorseObject *object;
+ GObject *object;
GtkDialog *dialog;
gchar* uri = NULL;
GError *err = NULL;
@@ -1162,7 +1162,7 @@ on_pgp_details_export_button (GtkWidget *widget,
gchar *results;
gsize n_results;
gpgme_key_t seckey;
-
+
object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
g_return_if_fail (SEAHORSE_IS_GPGME_KEY (object));
@@ -1252,7 +1252,7 @@ setup_details_trust (SeahorseWidget *swidget)
seahorse_debug ("KeyProperties: Setting up Trust Combo Box Store");
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
etype = seahorse_object_get_usage (object);
widget = GTK_WIDGET (seahorse_widget_get_widget (swidget, "details-trust-combobox"));
@@ -1311,8 +1311,8 @@ do_details_signals (SeahorseWidget *swidget)
SeahorseObject *object;
SeahorseUsage etype;
GtkWidget *widget;
-
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
etype = seahorse_object_get_usage (object);
/*
@@ -1354,7 +1354,7 @@ do_details (SeahorseWidget *swidget)
GList *subkeys, *l;
gboolean valid;
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
pkey = SEAHORSE_PGP_KEY (object);
subkeys = seahorse_pgp_key_get_subkeys (pkey);
@@ -1548,10 +1548,10 @@ on_pgp_trust_marginal_toggled (GtkToggleButton *toggle,
gpointer user_data)
{
SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data);
- SeahorseObject *object;
+ GObject *object;
guint trust;
gpgme_error_t err;
-
+
object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
g_return_if_fail (SEAHORSE_IS_GPGME_KEY (object));
@@ -1596,7 +1596,7 @@ trust_update_row (SeahorseObjectModel *skmodel, SeahorseObject *object,
static void
signatures_populate_model (SeahorseWidget *swidget, SeahorseObjectModel *skmodel)
{
- SeahorseObject *object;
+ GObject *object;
SeahorsePgpKey *pkey;
GtkTreeIter iter;
GtkWidget *widget;
@@ -1645,7 +1645,7 @@ signatures_populate_model (SeahorseWidget *swidget, SeahorseObjectModel *skmodel
/* Add the keys to the store */
for (l = keys; l; l = g_list_next (l)) {
- object = SEAHORSE_OBJECT (l->data);
+ object = G_OBJECT (l->data);
gtk_tree_store_append (GTK_TREE_STORE (skmodel), &iter, NULL);
/* This calls the 'update-row' callback, to set the values for the key */
@@ -1671,7 +1671,7 @@ on_pgp_trust_sign (GtkWidget *widget,
gpointer user_data)
{
SeahorseWidget *swidget = SEAHORSE_WIDGET (user_data);
- SeahorseObject *object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+ GObject *object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
g_return_if_fail (SEAHORSE_IS_GPGME_KEY (object));
seahorse_gpgme_sign_prompt (SEAHORSE_GPGME_KEY (object), GTK_WINDOW (seahorse_widget_get_widget (swidget, swidget->name)));
}
@@ -1682,8 +1682,8 @@ do_trust_signals (SeahorseWidget *swidget)
SeahorseObject *object;
SeahorseUsage etype;
const gchar *user;
-
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
etype = seahorse_object_get_usage (object);
if (etype != SEAHORSE_USAGE_PUBLIC_KEY)
@@ -1747,7 +1747,7 @@ do_trust (SeahorseWidget *swidget)
gboolean sigpersonal;
GtkCellRenderer *renderer;
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
pkey = SEAHORSE_PGP_KEY (object);
if (seahorse_object_get_usage (object) != SEAHORSE_USAGE_PUBLIC_KEY)
@@ -1911,8 +1911,8 @@ setup_public_properties (SeahorsePgpKey *pkey, GtkWindow *parent)
SeahorseWidget *swidget;
GtkWidget *widget;
- swidget = seahorse_object_widget_new ("pgp-public-key-properties", parent, SEAHORSE_OBJECT (pkey));
-
+ swidget = seahorse_object_widget_new ("pgp-public-key-properties", parent, G_OBJECT (pkey));
+
/* This happens if the window is already open */
if (swidget == NULL)
return NULL;
@@ -1946,7 +1946,7 @@ setup_private_properties (SeahorsePgpKey *pkey, GtkWindow *parent)
SeahorseWidget *swidget;
GtkWidget *widget;
- swidget = seahorse_object_widget_new ("pgp-private-key-properties", parent, SEAHORSE_OBJECT (pkey));
+ swidget = seahorse_object_widget_new ("pgp-private-key-properties", parent, G_OBJECT (pkey));
/* This happens if the window is already open */
if (swidget == NULL)
diff --git a/pgp/seahorse-pgp-keysets.c b/pgp/seahorse-pgp-keysets.c
index 2670174..ef8703d 100644
--- a/pgp/seahorse-pgp-keysets.c
+++ b/pgp/seahorse-pgp-keysets.c
@@ -43,7 +43,7 @@ on_settings_default_key_changed (GSettings *settings, const gchar *key, gpointer
}
static gboolean
-pgp_signers_match (SeahorseObject *obj,
+pgp_signers_match (GObject *obj,
gpointer data)
{
SeahorsePgpKey *defkey;
diff --git a/pkcs11/seahorse-pkcs11-commands.c b/pkcs11/seahorse-pkcs11-commands.c
index 6d43eb3..a7e1658 100644
--- a/pkcs11/seahorse-pkcs11-commands.c
+++ b/pkcs11/seahorse-pkcs11-commands.c
@@ -65,7 +65,8 @@ properties_response (GtkDialog *dialog, gint response_id, gpointer user_data)
*/
static void
-seahorse_pkcs11_commands_show_properties (SeahorseCommands *cmds, SeahorseObject *object)
+seahorse_pkcs11_commands_show_properties (SeahorseCommands *cmds,
+ GObject *object)
{
GtkWindow *window;
gpointer previous;
diff --git a/src/seahorse-key-manager.c b/src/seahorse-key-manager.c
index 442e7a6..a49c6d2 100644
--- a/src/seahorse-key-manager.c
+++ b/src/seahorse-key-manager.c
@@ -109,7 +109,7 @@ G_MODULE_EXPORT void
on_keymanager_row_activated (GtkTreeView* view, GtkTreePath* path,
GtkTreeViewColumn* column, SeahorseKeyManager* self)
{
- SeahorseObject* obj;
+ GObject* obj;
g_return_if_fail (SEAHORSE_IS_KEY_MANAGER (self));
g_return_if_fail (GTK_IS_TREE_VIEW (view));
@@ -136,7 +136,7 @@ on_keymanager_key_list_button_pressed (GtkTreeView* view, GdkEventButton* event,
G_MODULE_EXPORT gboolean
on_keymanager_key_list_popup_menu (GtkTreeView* view, SeahorseKeyManager* self)
{
- SeahorseObject* obj;
+ GObject* obj;
g_return_val_if_fail (SEAHORSE_IS_KEY_MANAGER (self), FALSE);
g_return_val_if_fail (GTK_IS_TREE_VIEW (view), FALSE);
@@ -456,15 +456,16 @@ seahorse_key_manager_set_selected_objects (SeahorseViewer* base, GList* objects)
}
-static SeahorseObject*
-seahorse_key_manager_get_selected (SeahorseViewer* base)
+static GObject *
+seahorse_key_manager_get_selected (SeahorseViewer *base)
{
SeahorseKeyManager* self = SEAHORSE_KEY_MANAGER (base);
return seahorse_key_manager_store_get_selected_object (self->pv->view);
}
static void
-seahorse_key_manager_set_selected (SeahorseViewer* base, SeahorseObject* value)
+seahorse_key_manager_set_selected (SeahorseViewer *base,
+ GObject *value)
{
SeahorseKeyManager* self = SEAHORSE_KEY_MANAGER (base);
GList* objects = NULL;
diff --git a/ssh/seahorse-ssh-commands.c b/ssh/seahorse-ssh-commands.c
index aec8068..eb24ea5 100644
--- a/ssh/seahorse-ssh-commands.c
+++ b/ssh/seahorse-ssh-commands.c
@@ -92,12 +92,10 @@ static const GtkActionEntry COMMAND_ENTRIES[] = {
* OBJECT
*/
-static void
-seahorse_ssh_commands_show_properties (SeahorseCommands* base, SeahorseObject* obj)
+static void
+seahorse_ssh_commands_show_properties (SeahorseCommands* base,
+ GObject* obj)
{
- g_return_if_fail (SEAHORSE_IS_OBJECT (obj));
- g_return_if_fail (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_SSH_TYPE_KEY);
-
seahorse_ssh_key_properties_show (SEAHORSE_SSH_KEY (obj), seahorse_commands_get_window (base));
}
diff --git a/ssh/seahorse-ssh-key-properties.c b/ssh/seahorse-ssh-key-properties.c
index 3bf2ac8..5ed60ef 100644
--- a/ssh/seahorse-ssh-key-properties.c
+++ b/ssh/seahorse-ssh-key-properties.c
@@ -175,7 +175,7 @@ G_MODULE_EXPORT void
on_ssh_passphrase_button_clicked (GtkWidget *widget,
SeahorseWidget *swidget)
{
- SeahorseObject *object;
+ GObject *object;
GtkWidget *button;
object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
@@ -209,7 +209,7 @@ G_MODULE_EXPORT void
on_ssh_export_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
{
SeahorseSource *sksrc;
- SeahorseObject *object;
+ GObject *object;
GFile *file;
GtkDialog *dialog;
guchar *results;
@@ -219,9 +219,9 @@ on_ssh_export_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
g_return_if_fail (SEAHORSE_IS_SSH_KEY (object));
- sksrc = seahorse_object_get_source (object);
+ g_object_get (object, "source", &sksrc, NULL);
g_return_if_fail (SEAHORSE_IS_SSH_SOURCE (sksrc));
-
+
dialog = seahorse_util_chooser_save_new (_("Export Complete Key"),
GTK_WINDOW (seahorse_widget_get_toplevel (swidget)));
seahorse_util_chooser_show_key_files (dialog);
@@ -259,7 +259,7 @@ do_main (SeahorseWidget *swidget)
const gchar *label;
const gchar *template;
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
skey = SEAHORSE_SSH_KEY (object);
/* Image */
@@ -309,7 +309,7 @@ do_details (SeahorseWidget *swidget)
const gchar *label;
gchar *text;
- object = SEAHORSE_OBJECT_WIDGET (swidget)->object;
+ object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
skey = SEAHORSE_SSH_KEY (object);
widget = GTK_WIDGET (gtk_builder_get_object (swidget->gtkbuilder, "fingerprint-label"));
@@ -358,9 +358,10 @@ properties_response (GtkDialog *dialog, int response, SeahorseWidget *swidget)
}
void
-seahorse_ssh_key_properties_show (SeahorseSSHKey *skey, GtkWindow *parent)
+seahorse_ssh_key_properties_show (SeahorseSSHKey *skey,
+ GtkWindow *parent)
{
- SeahorseObject *object = SEAHORSE_OBJECT (skey);
+ GObject *object = G_OBJECT (skey);
SeahorseWidget *swidget = NULL;
GtkWidget *widget;
@@ -383,7 +384,7 @@ seahorse_ssh_key_properties_show (SeahorseSSHKey *skey, GtkWindow *parent)
g_return_if_fail (widget != NULL);
/* A public key only */
- if (seahorse_object_get_usage (object) != SEAHORSE_USAGE_PRIVATE_KEY) {
+ if (seahorse_object_get_usage (SEAHORSE_OBJECT (skey)) != SEAHORSE_USAGE_PRIVATE_KEY) {
seahorse_widget_set_visible (swidget, "passphrase-button", FALSE);
seahorse_widget_set_visible (swidget, "export-button", FALSE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]