mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-24 18:25:50 +00:00
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.
This commit is contained in:
parent
d94e040788
commit
874de18833
32
ChangeLog
32
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.
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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. ***/
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -43,7 +43,6 @@ typedef struct NautilusVFSDirectoryDetails NautilusVFSDirectoryDetails;
|
|||
|
||||
typedef struct {
|
||||
NautilusDirectory parent_slot;
|
||||
NautilusVFSDirectoryDetails *details;
|
||||
} NautilusVFSDirectory;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -43,7 +43,6 @@ typedef struct NautilusVFSFileDetails NautilusVFSFileDetails;
|
|||
|
||||
typedef struct {
|
||||
NautilusFile parent_slot;
|
||||
NautilusVFSFileDetails *details;
|
||||
} NautilusVFSFile;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue