[Xfce4-commits] thunar:nick/gseal+clean Drop usage of GtkObject and use GObject.

2012-09-16 Thread Nick Schermer
Updating branch refs/heads/nick/gseal+clean
 to 0bf9ab24e8a4cb578bd24d80d67de97ff06755cf (commit)
   from 57ff06dc5b27dc8e1d40561a747c785ef68cf526 (commit)

commit 0bf9ab24e8a4cb578bd24d80d67de97ff06755cf
Author: Nick Schermer n...@xfce.org
Date:   Fri May 25 19:23:37 2012 +0200

Drop usage of GtkObject and use GObject.

Implement the destroy signal in ThunarFolder so we can
drop the usage of GtkObject.

 thunar/thunar-folder.c |   78 ++-
 thunar/thunar-folder.h |2 +
 2 files changed, 71 insertions(+), 9 deletions(-)

diff --git a/thunar/thunar-folder.c b/thunar/thunar-folder.c
index 9ea6939..e9da360 100644
--- a/thunar/thunar-folder.c
+++ b/thunar/thunar-folder.c
@@ -44,6 +44,7 @@ enum
 /* signal identifiers */
 enum
 {
+  DESTROY,
   ERROR,
   FILES_ADDED,
   FILES_REMOVED,
@@ -52,6 +53,7 @@ enum
 
 
 
+static void thunar_folder_dispose (GObject 
   *object);
 static void thunar_folder_finalize(GObject 
   *object);
 static void thunar_folder_get_property(GObject 
   *object,
guint   
prop_id,
@@ -61,6 +63,7 @@ static void thunar_folder_set_property
(GObject
guint   
prop_uid,
const GValue
   *value,
GParamSpec  
   *pspec);
+static void thunar_folder_real_destroy(ThunarFolder
   *folder);
 static void thunar_folder_error   (ExoJob  
   *job,
GError  
   *error,
ThunarFolder
   *folder);
@@ -85,9 +88,10 @@ static void thunar_folder_monitor 
(GFileMonitor
 
 struct _ThunarFolderClass
 {
-  GtkObjectClass __parent__;
+  GObjectClass __parent__;
 
   /* signals */
+  void (*destroy)   (ThunarFolder *folder);
   void (*error) (ThunarFolder *folder,
  const GError *error);
   void (*files_added)   (ThunarFolder *folder,
@@ -98,7 +102,7 @@ struct _ThunarFolderClass
 
 struct _ThunarFolder
 {
-  GtkObject __parent__;
+  GObject __parent__;
 
   ThunarJob *job;
 
@@ -106,6 +110,8 @@ struct _ThunarFolder
   GList *new_files;
   GList *files;
 
+  guint  in_destruction : 1;
+
   ThunarFileMonitor *file_monitor;
 
   GFileMonitor  *monitor;
@@ -118,7 +124,7 @@ static GQuark thunar_folder_quark;
 
 
 
-G_DEFINE_TYPE (ThunarFolder, thunar_folder, GTK_TYPE_OBJECT)
+G_DEFINE_TYPE (ThunarFolder, thunar_folder, G_TYPE_OBJECT)
 
 
 
@@ -128,10 +134,13 @@ thunar_folder_class_init (ThunarFolderClass *klass)
   GObjectClass *gobject_class;
 
   gobject_class = G_OBJECT_CLASS (klass);
+  gobject_class-dispose = thunar_folder_dispose;
   gobject_class-finalize = thunar_folder_finalize;
   gobject_class-get_property = thunar_folder_get_property;
   gobject_class-set_property = thunar_folder_set_property;
 
+  klass-destroy = thunar_folder_real_destroy;
+
   /**
* ThunarFolder::corresponding-file:
*
@@ -143,7 +152,7 @@ thunar_folder_class_init (ThunarFolderClass *klass)
 corresponding-file,
 corresponding-file,
 THUNAR_TYPE_FILE,
-G_PARAM_READABLE 
+G_PARAM_READABLE
 | G_PARAM_WRITABLE
 | 
G_PARAM_CONSTRUCT_ONLY));
 
@@ -160,6 +169,20 @@ thunar_folder_class_init (ThunarFolderClass *klass)
  loading,
  FALSE,
  EXO_PARAM_READABLE));
+  /**
+   * ThunarFolder::destroy:
+   * @folder : a #ThunarFolder.
+   *
+   * Emitted when the #ThunarFolder is destroyed.
+   **/
+  folder_signals[DESTROY] =
+g_signal_new (I_(destroy),
+  G_TYPE_FROM_CLASS (gobject_class),
+  G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE | 
G_SIGNAL_NO_HOOKS,
+  G_STRUCT_OFFSET (ThunarFolderClass, destroy),
+  NULL, NULL,
+  g_cclosure_marshal_VOID__VOID,
+  G_TYPE_NONE, 0);
 
   /**
* ThunarFolder::error:
@@ -227,6 +250,23 @@ thunar_folder_init (ThunarFolder *folder)
 
 
 static void
+thunar_folder_dispose (GObject 

[Xfce4-commits] thunar:nick/gseal+clean Drop usage of GtkObject and use GObject.

2012-05-25 Thread Nick Schermer
Updating branch refs/heads/nick/gseal+clean
 to 268e8303540e9268e90e2c9532a4eea86bcfa673 (commit)
   from f9e93fe89a1e6ba531b97991cfd664976ddf42b2 (commit)

commit 268e8303540e9268e90e2c9532a4eea86bcfa673
Author: Nick Schermer n...@xfce.org
Date:   Fri May 25 19:23:37 2012 +0200

Drop usage of GtkObject and use GObject.

Implement the destroy signal in ThunarFolder so we can
drop the usage of GtkObject.

 thunar/thunar-folder.c |   78 ++-
 thunar/thunar-folder.h |2 +
 2 files changed, 71 insertions(+), 9 deletions(-)

diff --git a/thunar/thunar-folder.c b/thunar/thunar-folder.c
index 9ea6939..e9da360 100644
--- a/thunar/thunar-folder.c
+++ b/thunar/thunar-folder.c
@@ -44,6 +44,7 @@ enum
 /* signal identifiers */
 enum
 {
+  DESTROY,
   ERROR,
   FILES_ADDED,
   FILES_REMOVED,
@@ -52,6 +53,7 @@ enum
 
 
 
+static void thunar_folder_dispose (GObject 
   *object);
 static void thunar_folder_finalize(GObject 
   *object);
 static void thunar_folder_get_property(GObject 
   *object,
guint   
prop_id,
@@ -61,6 +63,7 @@ static void thunar_folder_set_property
(GObject
guint   
prop_uid,
const GValue
   *value,
GParamSpec  
   *pspec);
+static void thunar_folder_real_destroy(ThunarFolder
   *folder);
 static void thunar_folder_error   (ExoJob  
   *job,
GError  
   *error,
ThunarFolder
   *folder);
@@ -85,9 +88,10 @@ static void thunar_folder_monitor 
(GFileMonitor
 
 struct _ThunarFolderClass
 {
-  GtkObjectClass __parent__;
+  GObjectClass __parent__;
 
   /* signals */
+  void (*destroy)   (ThunarFolder *folder);
   void (*error) (ThunarFolder *folder,
  const GError *error);
   void (*files_added)   (ThunarFolder *folder,
@@ -98,7 +102,7 @@ struct _ThunarFolderClass
 
 struct _ThunarFolder
 {
-  GtkObject __parent__;
+  GObject __parent__;
 
   ThunarJob *job;
 
@@ -106,6 +110,8 @@ struct _ThunarFolder
   GList *new_files;
   GList *files;
 
+  guint  in_destruction : 1;
+
   ThunarFileMonitor *file_monitor;
 
   GFileMonitor  *monitor;
@@ -118,7 +124,7 @@ static GQuark thunar_folder_quark;
 
 
 
-G_DEFINE_TYPE (ThunarFolder, thunar_folder, GTK_TYPE_OBJECT)
+G_DEFINE_TYPE (ThunarFolder, thunar_folder, G_TYPE_OBJECT)
 
 
 
@@ -128,10 +134,13 @@ thunar_folder_class_init (ThunarFolderClass *klass)
   GObjectClass *gobject_class;
 
   gobject_class = G_OBJECT_CLASS (klass);
+  gobject_class-dispose = thunar_folder_dispose;
   gobject_class-finalize = thunar_folder_finalize;
   gobject_class-get_property = thunar_folder_get_property;
   gobject_class-set_property = thunar_folder_set_property;
 
+  klass-destroy = thunar_folder_real_destroy;
+
   /**
* ThunarFolder::corresponding-file:
*
@@ -143,7 +152,7 @@ thunar_folder_class_init (ThunarFolderClass *klass)
 corresponding-file,
 corresponding-file,
 THUNAR_TYPE_FILE,
-G_PARAM_READABLE 
+G_PARAM_READABLE
 | G_PARAM_WRITABLE
 | 
G_PARAM_CONSTRUCT_ONLY));
 
@@ -160,6 +169,20 @@ thunar_folder_class_init (ThunarFolderClass *klass)
  loading,
  FALSE,
  EXO_PARAM_READABLE));
+  /**
+   * ThunarFolder::destroy:
+   * @folder : a #ThunarFolder.
+   *
+   * Emitted when the #ThunarFolder is destroyed.
+   **/
+  folder_signals[DESTROY] =
+g_signal_new (I_(destroy),
+  G_TYPE_FROM_CLASS (gobject_class),
+  G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE | 
G_SIGNAL_NO_HOOKS,
+  G_STRUCT_OFFSET (ThunarFolderClass, destroy),
+  NULL, NULL,
+  g_cclosure_marshal_VOID__VOID,
+  G_TYPE_NONE, 0);
 
   /**
* ThunarFolder::error:
@@ -227,6 +250,23 @@ thunar_folder_init (ThunarFolder *folder)
 
 
 static void
+thunar_folder_dispose (GObject