summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2003-03-14 08:25:53 +0000
committerAlexander Larsson <alexl@src.gnome.org>2003-03-14 08:25:53 +0000
commit874de18833bf58f1b3ed70b8b64a0d5de556e1c0 (patch)
tree75ea705bf56a0d7964901204bce09474b8e32dfb
parentd94e040788e4f8ee746df165a87a494fb5250e29 (diff)
downloadnautilus-874de18833bf58f1b3ed70b8b64a0d5de556e1c0.tar.gz
Make NautilusDirectory a GObject.
2003-03-14 Alexander Larsson <alexl@redhat.com> * libnautilus-private/nautilus-directory.h: * libnautilus-private/nautilus-directory.c: (nautilus_directory_new): Make NautilusDirectory a GObject. * libnautilus-private/nautilus-file.h: * libnautilus-private/nautilus-file.c: (nautilus_file_new_from_relative_uri), (nautilus_file_new_from_info): Make NautilusFile a GObject. * libnautilus-private/nautilus-trash-file.c: (trash_callback_remove_file_cover), (trash_finalize), (nautilus_trash_file_class_init): Convert destroy into finalize. * libnautilus-private/nautilus-vfs-directory.h: * libnautilus-private/nautilus-vfs-directory.c: (nautilus_vfs_directory_init), (nautilus_vfs_directory_class_init): * libnautilus-private/nautilus-vfs-file.c: (nautilus_vfs_file_init), (nautilus_vfs_file_class_init): * libnautilus-private/nautilus-vfs-file.h: Remove unused details fields. * src/file-manager/fm-directory-view.c: (disconnect_handler), (disconnect_directory_handler), (disconnect_directory_as_file_handler): * src/file-manager/fm-search-list-view.c: (real_adding_file): Don't cast NautilusFiles and NautilusDirectories to GtkObjects.
-rw-r--r--ChangeLog32
-rw-r--r--libnautilus-private/nautilus-directory.c4
-rw-r--r--libnautilus-private/nautilus-directory.h4
-rw-r--r--libnautilus-private/nautilus-file.c7
-rw-r--r--libnautilus-private/nautilus-file.h4
-rw-r--r--libnautilus-private/nautilus-trash-file.c18
-rw-r--r--libnautilus-private/nautilus-vfs-directory.c26
-rw-r--r--libnautilus-private/nautilus-vfs-directory.h1
-rw-r--r--libnautilus-private/nautilus-vfs-file.c25
-rw-r--r--libnautilus-private/nautilus-vfs-file.h1
-rw-r--r--src/file-manager/fm-directory-view.c6
-rw-r--r--src/file-manager/fm-search-list-view.c2
12 files changed, 56 insertions, 74 deletions
diff --git a/ChangeLog b/ChangeLog
index 810747e7a..8ee07691b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2003-03-14 Alexander Larsson <alexl@redhat.com>
+
+ * libnautilus-private/nautilus-directory.h:
+ * libnautilus-private/nautilus-directory.c:
+ (nautilus_directory_new):
+ Make NautilusDirectory a GObject.
+
+ * libnautilus-private/nautilus-file.h:
+ * libnautilus-private/nautilus-file.c:
+ (nautilus_file_new_from_relative_uri),
+ (nautilus_file_new_from_info):
+ Make NautilusFile a GObject.
+
+ * libnautilus-private/nautilus-trash-file.c:
+ (trash_callback_remove_file_cover), (trash_finalize),
+ (nautilus_trash_file_class_init):
+ Convert destroy into finalize.
+
+ * libnautilus-private/nautilus-vfs-directory.h:
+ * libnautilus-private/nautilus-vfs-directory.c:
+ (nautilus_vfs_directory_init), (nautilus_vfs_directory_class_init):
+ * libnautilus-private/nautilus-vfs-file.c:
+ (nautilus_vfs_file_init), (nautilus_vfs_file_class_init):
+ * libnautilus-private/nautilus-vfs-file.h:
+ Remove unused details fields.
+
+ * src/file-manager/fm-directory-view.c: (disconnect_handler),
+ (disconnect_directory_handler),
+ (disconnect_directory_as_file_handler):
+ * src/file-manager/fm-search-list-view.c: (real_adding_file):
+ Don't cast NautilusFiles and NautilusDirectories to GtkObjects.
+
2003-03-13 Christian Rose <menthos@menthos.com>
* configure.in: Added "ml" to ALL_LINGUAS.
diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c
index 42de29a83..322a86b3b 100644
--- a/libnautilus-private/nautilus-directory.c
+++ b/libnautilus-private/nautilus-directory.c
@@ -74,7 +74,7 @@ static void set_directory_uri (NautilusDirectory
EEL_CLASS_BOILERPLATE (NautilusDirectory,
nautilus_directory,
- GTK_TYPE_OBJECT)
+ G_TYPE_OBJECT)
static void
nautilus_directory_class_init (NautilusDirectoryClass *klass)
@@ -504,8 +504,6 @@ nautilus_directory_new (const char *uri)
} else {
directory = NAUTILUS_DIRECTORY (g_object_new (NAUTILUS_TYPE_VFS_DIRECTORY, NULL));
}
- g_object_ref (directory);
- gtk_object_sink (GTK_OBJECT (directory));
set_directory_uri (directory, uri);
diff --git a/libnautilus-private/nautilus-directory.h b/libnautilus-private/nautilus-directory.h
index fc3fa5af1..8f1865ddd 100644
--- a/libnautilus-private/nautilus-directory.h
+++ b/libnautilus-private/nautilus-directory.h
@@ -61,7 +61,7 @@ typedef struct NautilusDirectoryDetails NautilusDirectoryDetails;
typedef struct
{
- GtkObject object;
+ GObject object;
NautilusDirectoryDetails *details;
} NautilusDirectory;
@@ -71,7 +71,7 @@ typedef void (*NautilusDirectoryCallback) (NautilusDirectory *directory,
typedef struct
{
- GtkObjectClass parent_class;
+ GObjectClass parent_class;
/*** Notification signals for clients to connect to. ***/
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 10fff2e40..054cb1d46 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -114,7 +114,7 @@ static char * nautilus_file_get_display_name_collation_key (NautilusFile *
GNOME_CLASS_BOILERPLATE (NautilusFile, nautilus_file,
- GtkObject, GTK_TYPE_OBJECT)
+ GObject, G_TYPE_OBJECT)
static void
nautilus_file_instance_init (NautilusFile *file)
@@ -138,8 +138,6 @@ nautilus_file_new_from_relative_uri (NautilusDirectory *directory,
} else {
file = NAUTILUS_FILE (g_object_new (NAUTILUS_TYPE_VFS_FILE, NULL));
}
- g_object_ref (file);
- gtk_object_sink (GTK_OBJECT (file));
#ifdef NAUTILUS_FILE_DEBUG_REF
printf("%10p ref'd\n", file);
@@ -254,9 +252,6 @@ nautilus_file_new_from_info (NautilusDirectory *directory,
eazel_dump_stack_trace ("\t", 10);
#endif
- g_object_ref (file);
- gtk_object_sink (GTK_OBJECT (file));
-
nautilus_directory_ref (directory);
file->details->directory = directory;
diff --git a/libnautilus-private/nautilus-file.h b/libnautilus-private/nautilus-file.h
index e0f0c268c..f7c4b2880 100644
--- a/libnautilus-private/nautilus-file.h
+++ b/libnautilus-private/nautilus-file.h
@@ -317,7 +317,7 @@ void nautilus_file_dump (Nautilu
typedef struct NautilusFileDetails NautilusFileDetails;
struct NautilusFile {
- GtkObject parent_slot;
+ GObject parent_slot;
NautilusFileDetails *details;
};
@@ -332,7 +332,7 @@ typedef enum {
} NautilusDateType;
typedef struct {
- GtkObjectClass parent_slot;
+ GObjectClass parent_slot;
/* Called when the file notices any change. */
void (* changed) (NautilusFile *file);
diff --git a/libnautilus-private/nautilus-trash-file.c b/libnautilus-private/nautilus-trash-file.c
index cc71f6891..5b1f67be2 100644
--- a/libnautilus-private/nautilus-trash-file.c
+++ b/libnautilus-private/nautilus-trash-file.c
@@ -78,8 +78,8 @@ static void nautilus_trash_file_init (gpointer object,
static void nautilus_trash_file_class_init (gpointer klass);
EEL_CLASS_BOILERPLATE (NautilusTrashFile,
- nautilus_trash_file,
- NAUTILUS_TYPE_FILE)
+ nautilus_trash_file,
+ NAUTILUS_TYPE_FILE)
static gboolean
is_delegated_attribute (const char *attribute)
@@ -292,8 +292,8 @@ add_real_file (NautilusTrashFile *trash,
static void
trash_callback_remove_file_cover (gpointer key,
- gpointer value,
- gpointer callback_data)
+ gpointer value,
+ gpointer callback_data)
{
trash_callback_remove_file
(value, NAUTILUS_FILE (callback_data));
@@ -759,7 +759,7 @@ nautilus_trash_file_init (gpointer object, gpointer klass)
}
static void
-trash_destroy (GtkObject *object)
+trash_finalize (GObject *object)
{
NautilusTrashFile *trash_file;
NautilusTrashDirectory *trash_directory;
@@ -783,19 +783,19 @@ trash_destroy (GtkObject *object)
nautilus_directory_unref (NAUTILUS_DIRECTORY (trash_directory));
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
static void
nautilus_trash_file_class_init (gpointer klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
NautilusFileClass *file_class;
- object_class = GTK_OBJECT_CLASS (klass);
+ object_class = G_OBJECT_CLASS (klass);
file_class = NAUTILUS_FILE_CLASS (klass);
- object_class->destroy = trash_destroy;
+ object_class->finalize = trash_finalize;
file_class->monitor_add = trash_file_monitor_add;
file_class->monitor_remove = trash_file_monitor_remove;
diff --git a/libnautilus-private/nautilus-vfs-directory.c b/libnautilus-private/nautilus-vfs-directory.c
index dabef3af2..191a1b664 100644
--- a/libnautilus-private/nautilus-vfs-directory.c
+++ b/libnautilus-private/nautilus-vfs-directory.c
@@ -30,12 +30,8 @@
#include <eel/eel-gtk-macros.h>
#include "nautilus-file-private.h"
-struct NautilusVFSDirectoryDetails {
- char dummy; /* ANSI C does not allow empty structs */
-};
-
static void nautilus_vfs_directory_init (gpointer object,
- gpointer klass);
+ gpointer klass);
static void nautilus_vfs_directory_class_init (gpointer klass);
EEL_CLASS_BOILERPLATE (NautilusVFSDirectory,
@@ -48,20 +44,6 @@ nautilus_vfs_directory_init (gpointer object, gpointer klass)
NautilusVFSDirectory *directory;
directory = NAUTILUS_VFS_DIRECTORY (object);
-
- directory->details = g_new0 (NautilusVFSDirectoryDetails, 1);
-}
-
-static void
-vfs_destroy (GtkObject *object)
-{
- NautilusVFSDirectory *directory;
-
- directory = NAUTILUS_VFS_DIRECTORY (object);
-
- g_free (directory->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static gboolean
@@ -172,14 +154,12 @@ vfs_is_not_empty (NautilusDirectory *directory)
static void
nautilus_vfs_directory_class_init (gpointer klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
NautilusDirectoryClass *directory_class;
- object_class = GTK_OBJECT_CLASS (klass);
+ object_class = G_OBJECT_CLASS (klass);
directory_class = NAUTILUS_DIRECTORY_CLASS (klass);
- object_class->destroy = vfs_destroy;
-
directory_class->contains_file = vfs_contains_file;
directory_class->call_when_ready = vfs_call_when_ready;
directory_class->cancel_callback = vfs_cancel_callback;
diff --git a/libnautilus-private/nautilus-vfs-directory.h b/libnautilus-private/nautilus-vfs-directory.h
index b16eb3bdf..d17561b1f 100644
--- a/libnautilus-private/nautilus-vfs-directory.h
+++ b/libnautilus-private/nautilus-vfs-directory.h
@@ -43,7 +43,6 @@ typedef struct NautilusVFSDirectoryDetails NautilusVFSDirectoryDetails;
typedef struct {
NautilusDirectory parent_slot;
- NautilusVFSDirectoryDetails *details;
} NautilusVFSDirectory;
typedef struct {
diff --git a/libnautilus-private/nautilus-vfs-file.c b/libnautilus-private/nautilus-vfs-file.c
index 688bace4c..e8bc76a64 100644
--- a/libnautilus-private/nautilus-vfs-file.c
+++ b/libnautilus-private/nautilus-vfs-file.c
@@ -30,17 +30,13 @@
#include "nautilus-file-private.h"
#include <eel/eel-gtk-macros.h>
-struct NautilusVFSFileDetails {
- char dummy; /* ANSI C does not allow empty structs */
-};
-
static void nautilus_vfs_file_init (gpointer object,
gpointer klass);
static void nautilus_vfs_file_class_init (gpointer klass);
EEL_CLASS_BOILERPLATE (NautilusVFSFile,
- nautilus_vfs_file,
- NAUTILUS_TYPE_FILE)
+ nautilus_vfs_file,
+ NAUTILUS_TYPE_FILE)
static void
vfs_file_monitor_add (NautilusFile *file,
@@ -239,31 +235,14 @@ nautilus_vfs_file_init (gpointer object, gpointer klass)
file = NAUTILUS_VFS_FILE (object);
- file->details = g_new0 (NautilusVFSFileDetails, 1);
-}
-
-static void
-vfs_destroy (GtkObject *object)
-{
- NautilusVFSFile *file;
-
- file = NAUTILUS_VFS_FILE (object);
-
- g_free (file->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
nautilus_vfs_file_class_init (gpointer klass)
{
- GtkObjectClass *object_class;
NautilusFileClass *file_class;
- object_class = GTK_OBJECT_CLASS (klass);
file_class = NAUTILUS_FILE_CLASS (klass);
-
- object_class->destroy = vfs_destroy;
file_class->monitor_add = vfs_file_monitor_add;
file_class->monitor_remove = vfs_file_monitor_remove;
diff --git a/libnautilus-private/nautilus-vfs-file.h b/libnautilus-private/nautilus-vfs-file.h
index 4956c810c..bedbfb903 100644
--- a/libnautilus-private/nautilus-vfs-file.h
+++ b/libnautilus-private/nautilus-vfs-file.h
@@ -43,7 +43,6 @@ typedef struct NautilusVFSFileDetails NautilusVFSFileDetails;
typedef struct {
NautilusFile parent_slot;
- NautilusVFSFileDetails *details;
} NautilusVFSFile;
typedef struct {
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 3d5ba4c3f..e355621f9 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -5529,7 +5529,7 @@ fm_directory_view_merge_menus (FMDirectoryView *view)
}
static void
-disconnect_handler (GtkObject *object, int *id)
+disconnect_handler (GObject *object, int *id)
{
if (*id != 0) {
g_signal_handler_disconnect (object, *id);
@@ -5540,13 +5540,13 @@ disconnect_handler (GtkObject *object, int *id)
static void
disconnect_directory_handler (FMDirectoryView *view, int *id)
{
- disconnect_handler (GTK_OBJECT (view->details->model), id);
+ disconnect_handler (G_OBJECT (view->details->model), id);
}
static void
disconnect_directory_as_file_handler (FMDirectoryView *view, int *id)
{
- disconnect_handler (GTK_OBJECT (view->details->directory_as_file), id);
+ disconnect_handler (G_OBJECT (view->details->directory_as_file), id);
}
static void
diff --git a/src/file-manager/fm-search-list-view.c b/src/file-manager/fm-search-list-view.c
index 5dae8e8e5..a1cc40266 100644
--- a/src/file-manager/fm-search-list-view.c
+++ b/src/file-manager/fm-search-list-view.c
@@ -630,7 +630,7 @@ real_adding_file (FMListView *view, NautilusFile *file)
* and won't be specific to the search directory. Is that OK?
*/
- g_signal_connect_object (GTK_OBJECT (file), "changed",
+ g_signal_connect_object (G_OBJECT (file), "changed",
G_CALLBACK (fm_directory_view_queue_file_change),
view, G_CONNECT_SWAPPED);