diff options
author | Alexander Larsson <alexl@redhat.com> | 2007-09-17 14:25:37 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2007-09-17 14:25:37 +0000 |
commit | ed88dc9e0519e1d35c0819f8672888dbd41d5fe1 (patch) | |
tree | 9e6637fe66c800259ea28afd98e9ba2d91f462c4 | |
parent | 944ba0f90d0934be141ec8bdaf92822913e01d1a (diff) | |
download | gvfs-ed88dc9e0519e1d35c0819f8672888dbd41d5fe1.tar.gz |
Removed. Removed. Added. Added.
2007-09-17 Alexander Larsson <alexl@redhat.com>
* client/gdaemonfile.c:
* client/gdaemonfileinputstream.c:
* client/gdaemonfileoutputstream.c:
* client/gvfsfusedaemon.c:
* common/gvfsdaemonprotocol.h:
* daemon/Makefile.am:
* daemon/gvfsbackend.[ch]:
* daemon/gvfsbackendftp.c:
* daemon/gvfsbackendsftp.c:
* daemon/gvfsbackendsmb.c:
* daemon/gvfsbackendsmbbrowse.c:
* daemon/gvfsbackendtest.c:
* daemon/gvfsjobenumerate.h:
* daemon/gvfsjobgetfsinfo.[ch]: Removed.
* daemon/gvfsjobgetinfo.[ch]: Removed.
* daemon/gvfsjobqueryfsinfo.[ch]: Added.
* daemon/gvfsjobqueryinfo.[ch]: Added.
* daemon/gvfsjobsetattribute.[ch]:
* test/benchmark-gvfs-big-files.c:
* test/benchmark-gvfs-small-files.c:
Update with the get_info -> query_info rename in gio
svn path=/trunk/; revision=955
25 files changed, 360 insertions, 336 deletions
@@ -1,5 +1,29 @@ 2007-09-17 Alexander Larsson <alexl@redhat.com> + * client/gdaemonfile.c: + * client/gdaemonfileinputstream.c: + * client/gdaemonfileoutputstream.c: + * client/gvfsfusedaemon.c: + * common/gvfsdaemonprotocol.h: + * daemon/Makefile.am: + * daemon/gvfsbackend.[ch]: + * daemon/gvfsbackendftp.c: + * daemon/gvfsbackendsftp.c: + * daemon/gvfsbackendsmb.c: + * daemon/gvfsbackendsmbbrowse.c: + * daemon/gvfsbackendtest.c: + * daemon/gvfsjobenumerate.h: + * daemon/gvfsjobgetfsinfo.[ch]: Removed. + * daemon/gvfsjobgetinfo.[ch]: Removed. + * daemon/gvfsjobqueryfsinfo.[ch]: Added. + * daemon/gvfsjobqueryinfo.[ch]: Added. + * daemon/gvfsjobsetattribute.[ch]: + * test/benchmark-gvfs-big-files.c: + * test/benchmark-gvfs-small-files.c: + Update with the get_info -> query_info rename in gio + +2007-09-17 Alexander Larsson <alexl@redhat.com> + * daemon/gvfsbackendsftp.c: Update to new GDataInputStream function names diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c index 13bbe824..ddc17676 100644 --- a/client/gdaemonfile.c +++ b/client/gdaemonfile.c @@ -567,7 +567,7 @@ do_async_path_call (GFile *file, static GFileEnumerator * g_daemon_file_enumerate_children (GFile *file, const char *attributes, - GFileGetInfoFlags flags, + GFileQueryInfoFlags flags, GCancellable *cancellable, GError **error) { @@ -610,11 +610,11 @@ g_daemon_file_enumerate_children (GFile *file, } static GFileInfo * -g_daemon_file_get_info (GFile *file, - const char *attributes, - GFileGetInfoFlags flags, - GCancellable *cancellable, - GError **error) +g_daemon_file_query_info (GFile *file, + const char *attributes, + GFileQueryInfoFlags flags, + GCancellable *cancellable, + GError **error) { DBusMessage *reply; dbus_uint32_t flags_dbus; @@ -625,7 +625,7 @@ g_daemon_file_get_info (GFile *file, attributes = ""; flags_dbus = flags; reply = do_sync_path_call (file, - G_VFS_DBUS_MOUNT_OP_GET_INFO, + G_VFS_DBUS_MOUNT_OP_QUERY_INFO, NULL, cancellable, error, DBUS_TYPE_STRING, &attributes, DBUS_TYPE_UINT32, &flags, @@ -651,11 +651,11 @@ g_daemon_file_get_info (GFile *file, } static void -get_info_async_cb (DBusMessage *reply, - DBusConnection *connection, - GSimpleAsyncResult *result, - GCancellable *cancellable, - gpointer callback_data) +query_info_async_cb (DBusMessage *reply, + DBusConnection *connection, + GSimpleAsyncResult *result, + GCancellable *cancellable, + gpointer callback_data) { DBusMessageIter iter; GFileInfo *info; @@ -668,7 +668,7 @@ get_info_async_cb (DBusMessage *reply, { g_simple_async_result_set_error (result, G_IO_ERROR, G_IO_ERROR_FAILED, - _("Invalid return value from get_info")); + _("Invalid return value from query_info")); g_simple_async_result_complete (result); return; } @@ -688,28 +688,28 @@ get_info_async_cb (DBusMessage *reply, } static void -g_daemon_file_get_info_async (GFile *file, - const char *attributes, - GFileGetInfoFlags flags, - int io_priority, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) +g_daemon_file_query_info_async (GFile *file, + const char *attributes, + GFileQueryInfoFlags flags, + int io_priority, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) { do_async_path_call (file, - G_VFS_DBUS_MOUNT_OP_GET_INFO, + G_VFS_DBUS_MOUNT_OP_QUERY_INFO, cancellable, callback, user_data, - get_info_async_cb, NULL, NULL, + query_info_async_cb, NULL, NULL, DBUS_TYPE_STRING, &attributes, DBUS_TYPE_UINT32, &flags, 0); } static GFileInfo * -g_daemon_file_get_info_finish (GFile *file, - GAsyncResult *res, - GError **error) +g_daemon_file_query_info_finish (GFile *file, + GAsyncResult *res, + GError **error) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res); GFileInfo *info; @@ -1236,10 +1236,10 @@ g_daemon_file_mount_for_location_finish (GFile *location, } static GFileInfo * -g_daemon_file_get_filesystem_info (GFile *file, - const char *attributes, - GCancellable *cancellable, - GError **error) +g_daemon_file_query_filesystem_info (GFile *file, + const char *attributes, + GCancellable *cancellable, + GError **error) { DBusMessage *reply; DBusMessageIter iter; @@ -1248,7 +1248,7 @@ g_daemon_file_get_filesystem_info (GFile *file, if (attributes == NULL) attributes = ""; reply = do_sync_path_call (file, - G_VFS_DBUS_MOUNT_OP_GET_FILESYSTEM_INFO, + G_VFS_DBUS_MOUNT_OP_QUERY_FILESYSTEM_INFO, NULL, cancellable, error, DBUS_TYPE_STRING, &attributes, 0); @@ -1339,7 +1339,7 @@ g_daemon_file_set_display_name (GFile *file, 0)) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - _("Invalid return value from get_filesystem_info")); + _("Invalid return value from query_filesystem_info")); goto out; } @@ -1487,7 +1487,7 @@ static gboolean g_daemon_file_set_attribute (GFile *file, const char *attribute, const GFileAttributeValue *value, - GFileGetInfoFlags flags, + GFileQueryInfoFlags flags, GCancellable *cancellable, GError **error) { @@ -1670,9 +1670,9 @@ g_daemon_file_file_iface_init (GFileIface *iface) iface->resolve_relative = g_daemon_file_resolve_relative; iface->get_child_for_display_name = g_daemon_file_get_child_for_display_name; iface->enumerate_children = g_daemon_file_enumerate_children; - iface->get_info = g_daemon_file_get_info; - iface->get_info_async = g_daemon_file_get_info_async; - iface->get_info_finish = g_daemon_file_get_info_finish; + iface->query_info = g_daemon_file_query_info; + iface->query_info_async = g_daemon_file_query_info_async; + iface->query_info_finish = g_daemon_file_query_info_finish; iface->read = g_daemon_file_read; iface->append_to = g_daemon_file_append_to; iface->create = g_daemon_file_create; @@ -1683,7 +1683,7 @@ g_daemon_file_file_iface_init (GFileIface *iface) iface->mount_for_location_finish = g_daemon_file_mount_for_location_finish; iface->mount_mountable = g_daemon_file_mount_mountable; iface->mount_mountable_finish = g_daemon_file_mount_mountable_finish; - iface->get_filesystem_info = g_daemon_file_get_filesystem_info; + iface->query_filesystem_info = g_daemon_file_query_filesystem_info; iface->set_display_name = g_daemon_file_set_display_name; iface->delete_file = g_daemon_file_delete; iface->trash = g_daemon_file_trash; diff --git a/client/gdaemonfileinputstream.c b/client/gdaemonfileinputstream.c index f284fccf..71b27530 100644 --- a/client/gdaemonfileinputstream.c +++ b/client/gdaemonfileinputstream.c @@ -155,7 +155,7 @@ static gssize g_daemon_file_input_stream_skip (GInputStream static gboolean g_daemon_file_input_stream_close (GInputStream *stream, GCancellable *cancellable, GError **error); -static GFileInfo *g_daemon_file_input_stream_get_file_info (GFileInputStream *stream, +static GFileInfo *g_daemon_file_input_stream_query_info (GFileInputStream *stream, char *attributes, GCancellable *cancellable, GError **error); @@ -243,7 +243,7 @@ g_daemon_file_input_stream_class_init (GDaemonFileInputStreamClass *klass) file_stream_class->tell = g_daemon_file_input_stream_tell; file_stream_class->can_seek = g_daemon_file_input_stream_can_seek; file_stream_class->seek = g_daemon_file_input_stream_seek; - file_stream_class->get_file_info = g_daemon_file_input_stream_get_file_info; + file_stream_class->query_info = g_daemon_file_input_stream_query_info; } @@ -1182,10 +1182,10 @@ g_daemon_file_input_stream_seek (GFileInputStream *stream, } static GFileInfo * -g_daemon_file_input_stream_get_file_info (GFileInputStream *stream, - char *attributes, - GCancellable *cancellable, - GError **error) +g_daemon_file_input_stream_query_info (GFileInputStream *stream, + char *attributes, + GCancellable *cancellable, + GError **error) { GDaemonFileInputStream *file; diff --git a/client/gdaemonfileoutputstream.c b/client/gdaemonfileoutputstream.c index 8dd784e4..187354fe 100644 --- a/client/gdaemonfileoutputstream.c +++ b/client/gdaemonfileoutputstream.c @@ -138,7 +138,7 @@ static gssize g_daemon_file_output_stream_write (GOutputStream static gboolean g_daemon_file_output_stream_close (GOutputStream *stream, GCancellable *cancellable, GError **error); -static GFileInfo *g_daemon_file_output_stream_get_file_info (GFileOutputStream *stream, +static GFileInfo *g_daemon_file_output_stream_query_info (GFileOutputStream *stream, char *attributes, GCancellable *cancellable, GError **error); @@ -213,7 +213,7 @@ g_daemon_file_output_stream_class_init (GDaemonFileOutputStreamClass *klass) file_stream_class->tell = g_daemon_file_output_stream_tell; file_stream_class->can_seek = g_daemon_file_output_stream_can_seek; file_stream_class->seek = g_daemon_file_output_stream_seek; - file_stream_class->get_file_info = g_daemon_file_output_stream_get_file_info; + file_stream_class->query_info = g_daemon_file_output_stream_query_info; file_stream_class->get_etag = g_daemon_file_output_stream_get_etag; } @@ -950,10 +950,10 @@ g_daemon_file_output_stream_get_etag (GFileOutputStream *stream) } static GFileInfo * -g_daemon_file_output_stream_get_file_info (GFileOutputStream *stream, - char *attributes, - GCancellable *cancellable, - GError **error) +g_daemon_file_output_stream_query_info (GFileOutputStream *stream, + char *attributes, + GCancellable *cancellable, + GError **error) { GDaemonFileOutputStream *file; diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c index e4f9409a..339c7d88 100644 --- a/client/gvfsfusedaemon.c +++ b/client/gvfsfusedaemon.c @@ -827,7 +827,7 @@ getattr_for_file (GFile *file, struct stat *sbuf) GError *error = NULL; gint result = 0; - file_info = g_file_get_info (file, "*", 0, NULL, &error); + file_info = g_file_query_info (file, "*", 0, NULL, &error); if (file_info) { @@ -1042,7 +1042,7 @@ vfs_open (const gchar *path, struct fuse_file_info *fi) GFileInfo *file_info; GError *error = NULL; - file_info = g_file_get_info (file, "*", 0, NULL, &error); + file_info = g_file_query_info (file, "*", 0, NULL, &error); if (file_info) { @@ -1118,7 +1118,7 @@ vfs_create (const gchar *path, mode_t mode, struct fuse_file_info *fi) GFileInfo *file_info; GError *error = NULL; - file_info = g_file_get_info (file, "*", 0, NULL, &error); + file_info = g_file_query_info (file, "*", 0, NULL, &error); if (file_info) { @@ -1738,7 +1738,7 @@ vfs_rmdir (const gchar *path) { GFileInfo *file_info; - file_info = g_file_get_info (file, "*", 0, NULL, &error); + file_info = g_file_query_info (file, "*", 0, NULL, &error); if (file_info) { if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY) @@ -1941,7 +1941,7 @@ vfs_access (const gchar *path, gint mode) { GFileInfo *file_info; - file_info = g_file_get_info (file, "*", 0, NULL, &error); + file_info = g_file_query_info (file, "*", 0, NULL, &error); if (file_info) { if ((mode & R_OK && (g_file_info_has_attribute (file_info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ) && diff --git a/common/gvfsdaemonprotocol.h b/common/gvfsdaemonprotocol.h index fe7ca73a..2554ab77 100644 --- a/common/gvfsdaemonprotocol.h +++ b/common/gvfsdaemonprotocol.h @@ -23,8 +23,8 @@ G_BEGIN_DECLS #define G_VFS_DBUS_MOUNT_INTERFACE "org.gtk.vfs.Mount" #define G_VFS_DBUS_MOUNT_OP_OPEN_FOR_READ "OpenForRead" #define G_VFS_DBUS_MOUNT_OP_OPEN_FOR_WRITE "OpenForWrite" -#define G_VFS_DBUS_MOUNT_OP_GET_INFO "GetInfo" -#define G_VFS_DBUS_MOUNT_OP_GET_FILESYSTEM_INFO "GetFilesystemInfo" +#define G_VFS_DBUS_MOUNT_OP_QUERY_INFO "QueryInfo" +#define G_VFS_DBUS_MOUNT_OP_QUERY_FILESYSTEM_INFO "QueryFilesystemInfo" #define G_VFS_DBUS_MOUNT_OP_ENUMERATE "Enumerate" #define G_VFS_DBUS_MOUNT_OP_MOUNT_MOUNTABLE "MountMountable" #define G_VFS_DBUS_MOUNT_OP_SET_DISPLAY_NAME "SetDisplayName" diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3f83bda2..49c51eae 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -70,8 +70,8 @@ libdaemon_la_SOURCES = \ gvfsjobwrite.c gvfsjobwrite.h \ gvfsjobseekwrite.c gvfsjobseekwrite.h \ gvfsjobclosewrite.c gvfsjobclosewrite.h \ - gvfsjobgetinfo.c gvfsjobgetinfo.h \ - gvfsjobgetfsinfo.c gvfsjobgetfsinfo.h \ + gvfsjobqueryinfo.c gvfsjobqueryinfo.h \ + gvfsjobqueryfsinfo.c gvfsjobqueryfsinfo.h \ gvfsjobenumerate.c gvfsjobenumerate.h \ gvfsjobsetdisplayname.c gvfsjobsetdisplayname.h \ gvfsjobtrash.c gvfsjobtrash.h \ diff --git a/daemon/gvfsbackend.c b/daemon/gvfsbackend.c index a3d6f265..213be100 100644 --- a/daemon/gvfsbackend.c +++ b/daemon/gvfsbackend.c @@ -14,8 +14,8 @@ #include "gvfsdaemonprotocol.h" #include <gvfsjobopenforread.h> #include <gvfsjobopenforwrite.h> -#include <gvfsjobgetinfo.h> -#include <gvfsjobgetfsinfo.h> +#include <gvfsjobqueryinfo.h> +#include <gvfsjobqueryfsinfo.h> #include <gvfsjobsetdisplayname.h> #include <gvfsjobenumerate.h> #include <gvfsjobdelete.h> @@ -292,12 +292,12 @@ backend_dbus_handler (DBusConnection *connection, job = g_vfs_job_open_for_read_new (connection, message, backend); else if (dbus_message_is_method_call (message, G_VFS_DBUS_MOUNT_INTERFACE, - G_VFS_DBUS_MOUNT_OP_GET_INFO)) - job = g_vfs_job_get_info_new (connection, message, backend); + G_VFS_DBUS_MOUNT_OP_QUERY_INFO)) + job = g_vfs_job_query_info_new (connection, message, backend); else if (dbus_message_is_method_call (message, G_VFS_DBUS_MOUNT_INTERFACE, - G_VFS_DBUS_MOUNT_OP_GET_FILESYSTEM_INFO)) - job = g_vfs_job_get_fs_info_new (connection, message, backend); + G_VFS_DBUS_MOUNT_OP_QUERY_FILESYSTEM_INFO)) + job = g_vfs_job_query_fs_info_new (connection, message, backend); else if (dbus_message_is_method_call (message, G_VFS_DBUS_MOUNT_INTERFACE, G_VFS_DBUS_MOUNT_OP_ENUMERATE)) diff --git a/daemon/gvfsbackend.h b/daemon/gvfsbackend.h index 07ad4211..be77f563 100644 --- a/daemon/gvfsbackend.h +++ b/daemon/gvfsbackend.h @@ -33,8 +33,8 @@ typedef struct _GVfsJobOpenForWrite GVfsJobOpenForWrite; typedef struct _GVfsJobWrite GVfsJobWrite; typedef struct _GVfsJobSeekWrite GVfsJobSeekWrite; typedef struct _GVfsJobCloseWrite GVfsJobCloseWrite; -typedef struct _GVfsJobGetInfo GVfsJobGetInfo; -typedef struct _GVfsJobGetFsInfo GVfsJobGetFsInfo; +typedef struct _GVfsJobQueryInfo GVfsJobQueryInfo; +typedef struct _GVfsJobQueryFsInfo GVfsJobQueryFsInfo; typedef struct _GVfsJobEnumerate GVfsJobEnumerate; typedef struct _GVfsJobSetDisplayName GVfsJobSetDisplayName; typedef struct _GVfsJobTrash GVfsJobTrash; @@ -167,25 +167,25 @@ struct _GVfsBackendClass GVfsBackendHandle handle, goffset offset, GSeekType type); - void (*get_info) (GVfsBackend *backend, - GVfsJobGetInfo *job, + void (*query_info) (GVfsBackend *backend, + GVfsJobQueryInfo *job, const char *filename, - GFileGetInfoFlags flags, + GFileQueryInfoFlags flags, GFileInfo *info, GFileAttributeMatcher *attribute_matcher); - gboolean (*try_get_info) (GVfsBackend *backend, - GVfsJobGetInfo *job, + gboolean (*try_query_info) (GVfsBackend *backend, + GVfsJobQueryInfo *job, const char *filename, - GFileGetInfoFlags flags, + GFileQueryInfoFlags flags, GFileInfo *info, GFileAttributeMatcher *attribute_matcher); - void (*get_fs_info) (GVfsBackend *backend, - GVfsJobGetFsInfo *job, + void (*query_fs_info) (GVfsBackend *backend, + GVfsJobQueryFsInfo *job, const char *filename, GFileInfo *info, GFileAttributeMatcher *attribute_matcher); - gboolean (*try_get_fs_info) (GVfsBackend *backend, - GVfsJobGetFsInfo *job, + gboolean (*try_query_fs_info) (GVfsBackend *backend, + GVfsJobQueryFsInfo *job, const char *filename, GFileInfo *info, GFileAttributeMatcher *attribute_matcher); @@ -193,12 +193,12 @@ struct _GVfsBackendClass GVfsJobEnumerate *job, const char *filename, GFileAttributeMatcher *attribute_matcher, - GFileGetInfoFlags flags); + GFileQueryInfoFlags flags); gboolean (*try_enumerate) (GVfsBackend *backend, GVfsJobEnumerate *job, const char *filename, GFileAttributeMatcher *attribute_matcher, - GFileGetInfoFlags flags); + GFileQueryInfoFlags flags); void (*set_display_name) (GVfsBackend *backend, GVfsJobSetDisplayName *job, const char *filename, @@ -266,13 +266,13 @@ struct _GVfsBackendClass const char *filename, const char *attribute, GFileAttributeValue *value, - GFileGetInfoFlags flags); + GFileQueryInfoFlags flags); gboolean (*try_set_attribute) (GVfsBackend *backend, GVfsJobSetAttribute *set_attribute, const char *filename, const char *attribute, GFileAttributeValue *value, - GFileGetInfoFlags flags); + GFileQueryInfoFlags flags); void (*query_settable_attributes) (GVfsBackend *backend, GVfsJobQueryAttributes *job, const char *filename); diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c index 9bcac76e..29e0caea 100644 --- a/daemon/gvfsbackendftp.c +++ b/daemon/gvfsbackendftp.c @@ -22,8 +22,8 @@ #include "gvfsjobwrite.h" #include "gvfsjobseekwrite.h" #include "gvfsjobsetdisplayname.h" -#include "gvfsjobgetinfo.h" -#include "gvfsjobgetfsinfo.h" +#include "gvfsjobqueryinfo.h" +#include "gvfsjobqueryfsinfo.h" #include "gvfsjobqueryattributes.h" #include "gvfsjobenumerate.h" #include "gvfsdaemonprotocol.h" @@ -321,11 +321,11 @@ do_close_write (GVfsBackend *backend, } static void -do_get_info (GVfsBackend *backend, - GVfsJobGetInfo *job, - const char *filename, - const char *attributes, - GFileGetInfoFlags flags) +do_query_info (GVfsBackend *backend, + GVfsJobQueryInfo *job, + const char *filename, + const char *attributes, + GFileQueryInfoFlags flags) { GVfsBackendFtp *op_backend = G_VFS_BACKEND_FTP (backend); @@ -333,10 +333,10 @@ do_get_info (GVfsBackend *backend, } static void -do_get_fs_info (GVfsBackend *backend, - GVfsJobGetFsInfo *job, - const char *filename, - const char *attributes) +do_query_fs_info (GVfsBackend *backend, + GVfsJobQueryFsInfo *job, + const char *filename, + const char *attributes) { /* TODO */ } @@ -353,10 +353,10 @@ try_query_settable_attributes (GVfsBackend *backend, static void do_enumerate (GVfsBackend *backend, - GVfsJobEnumerate *job, - const char *filename, - const char *attributes, - GFileGetInfoFlags flags) + GVfsJobEnumerate *job, + const char *filename, + const char *attributes, + GFileQueryInfoFlags flags) { GVfsBackendFtp *op_backend = G_VFS_BACKEND_FTP (backend); @@ -365,9 +365,9 @@ do_enumerate (GVfsBackend *backend, static void do_set_display_name (GVfsBackend *backend, - GVfsJobSetDisplayName *job, - const char *filename, - const char *display_name) + GVfsJobSetDisplayName *job, + const char *filename, + const char *display_name) { GVfsBackendFtp *op_backend = G_VFS_BACKEND_FTP (backend); @@ -428,8 +428,8 @@ g_vfs_backend_ftp_class_init (GVfsBackendFtpClass *klass) backend_class->write = do_write; backend_class->seek_on_write = do_seek_on_write; backend_class->close_write = do_close_write; - backend_class->get_info = do_get_info; - backend_class->get_fs_info = do_get_fs_info; + backend_class->query_info = do_query_info; + backend_class->query_fs_info = do_query_fs_info; backend_class->enumerate = do_enumerate; backend_class->set_display_name = do_set_display_name; backend_class->delete = do_delete; diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c index 15836221..602f5120 100644 --- a/daemon/gvfsbackendsftp.c +++ b/daemon/gvfsbackendsftp.c @@ -30,9 +30,9 @@ #include "gvfsjobclosewrite.h" #include "gvfsjobseekwrite.h" #include "gvfsjobsetdisplayname.h" -#include "gvfsjobgetinfo.h" +#include "gvfsjobqueryinfo.h" #include "gvfsjobdelete.h" -#include "gvfsjobgetfsinfo.h" +#include "gvfsjobqueryfsinfo.h" #include "gvfsjobqueryattributes.h" #include "gvfsjobenumerate.h" #include "gvfsdaemonprotocol.h" @@ -2654,7 +2654,7 @@ read_dir_reply (GVfsBackendSftp *backend, parse_attributes (backend, info, name, reply, enum_job->attribute_matcher); if (g_file_info_get_file_type (info) == G_FILE_TYPE_SYMBOLIC_LINK && - ! (enum_job->flags & G_FILE_GET_INFO_NOFOLLOW_SYMLINKS)) + ! (enum_job->flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS)) { /* Default (at least for openssh) is for readdir to not follow symlinks. This was a symlink, and follow links was requested, so we need to manually follow it */ @@ -2730,7 +2730,7 @@ try_enumerate (GVfsBackend *backend, GVfsJobEnumerate *job, const char *filename, GFileAttributeMatcher *attribute_matcher, - GFileGetInfoFlags flags) + GFileQueryInfoFlags flags) { GVfsBackendSftp *op_backend = G_VFS_BACKEND_SFTP (backend); guint32 id; @@ -2757,10 +2757,10 @@ typedef struct { GError *stat_error; char *symlink_target; int cb_count; -} GetInfoData; +} QueryInfoData; static void -get_info_data_free (GetInfoData *data) +query_info_data_free (QueryInfoData *data) { if (data->lstat_info) g_object_unref (data->lstat_info); @@ -2773,15 +2773,15 @@ get_info_data_free (GetInfoData *data) g_free (data->symlink_target); - g_slice_free (GetInfoData, data); + g_slice_free (QueryInfoData, data); } static void -get_info_finish (GVfsBackendSftp *backend, - GVfsJob *job) +query_info_finish (GVfsBackendSftp *backend, + GVfsJob *job) { - GVfsJobGetInfo *op_job; - GetInfoData *data; + GVfsJobQueryInfo *op_job; + QueryInfoData *data; data = job->backend_data; @@ -2792,8 +2792,8 @@ get_info_finish (GVfsBackendSftp *backend, return; } - op_job = G_VFS_JOB_GET_INFO (job); - if (op_job->flags & G_FILE_GET_INFO_NOFOLLOW_SYMLINKS) + op_job = G_VFS_JOB_QUERY_INFO (job); + if (op_job->flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) { g_file_info_copy_into (data->lstat_info, op_job->file_info); @@ -2820,7 +2820,7 @@ get_info_finish (GVfsBackendSftp *backend, } static void -get_info_stat_reply (GVfsBackendSftp *backend, +query_info_stat_reply (GVfsBackendSftp *backend, int reply_type, GDataInputStream *reply, guint32 len, @@ -2828,7 +2828,7 @@ get_info_stat_reply (GVfsBackendSftp *backend, gpointer user_data) { char *basename; - GetInfoData *data; + QueryInfoData *data; data = job->backend_data; @@ -2840,26 +2840,26 @@ get_info_stat_reply (GVfsBackendSftp *backend, else { data->stat_info = g_file_info_new (); - basename = g_path_get_basename (G_VFS_JOB_GET_INFO (job)->filename); + basename = g_path_get_basename (G_VFS_JOB_QUERY_INFO (job)->filename); parse_attributes (backend, data->stat_info, basename, - reply, G_VFS_JOB_GET_INFO (job)->attribute_matcher); + reply, G_VFS_JOB_QUERY_INFO (job)->attribute_matcher); g_free (basename); } if (--data->cb_count == 0) - get_info_finish (backend, job); + query_info_finish (backend, job); } static void -get_info_lstat_reply (GVfsBackendSftp *backend, - int reply_type, - GDataInputStream *reply, - guint32 len, - GVfsJob *job, - gpointer user_data) +query_info_lstat_reply (GVfsBackendSftp *backend, + int reply_type, + GDataInputStream *reply, + guint32 len, + GVfsJob *job, + gpointer user_data) { char *basename; - GetInfoData *data; + QueryInfoData *data; data = job->backend_data; @@ -2871,25 +2871,25 @@ get_info_lstat_reply (GVfsBackendSftp *backend, else { data->lstat_info = g_file_info_new (); - basename = g_path_get_basename (G_VFS_JOB_GET_INFO (job)->filename); + basename = g_path_get_basename (G_VFS_JOB_QUERY_INFO (job)->filename); parse_attributes (backend, data->lstat_info, basename, - reply, G_VFS_JOB_GET_INFO (job)->attribute_matcher); + reply, G_VFS_JOB_QUERY_INFO (job)->attribute_matcher); g_free (basename); } if (--data->cb_count == 0) - get_info_finish (backend, job); + query_info_finish (backend, job); } static void -get_info_readlink_reply (GVfsBackendSftp *backend, - int reply_type, - GDataInputStream *reply, - guint32 len, - GVfsJob *job, - gpointer user_data) +query_info_readlink_reply (GVfsBackendSftp *backend, + int reply_type, + GDataInputStream *reply, + guint32 len, + GVfsJob *job, + gpointer user_data) { - GetInfoData *data; + QueryInfoData *data; guint32 count; data = job->backend_data; @@ -2901,33 +2901,33 @@ get_info_readlink_reply (GVfsBackendSftp *backend, } if (--data->cb_count == 0) - get_info_finish (backend, job); + query_info_finish (backend, job); } static gboolean -try_get_info (GVfsBackend *backend, - GVfsJobGetInfo *job, - const char *filename, - GFileGetInfoFlags flags, - GFileInfo *info, - GFileAttributeMatcher *matcher) +try_query_info (GVfsBackend *backend, + GVfsJobQueryInfo *job, + const char *filename, + GFileQueryInfoFlags flags, + GFileInfo *info, + GFileAttributeMatcher *matcher) { GVfsBackendSftp *op_backend = G_VFS_BACKEND_SFTP (backend); guint32 id; GDataOutputStream *command; - GetInfoData *data; + QueryInfoData *data; - data = g_slice_new0 (GetInfoData); - g_vfs_job_set_backend_data (G_VFS_JOB (job), data, (GDestroyNotify)get_info_data_free); + data = g_slice_new0 (QueryInfoData); + g_vfs_job_set_backend_data (G_VFS_JOB (job), data, (GDestroyNotify)query_info_data_free); data->cb_count = 1; command = new_command_stream (op_backend, SSH_FXP_LSTAT, &id); put_string (command, filename); - queue_command_stream_and_free (op_backend, command, id, get_info_lstat_reply, G_VFS_JOB (job), NULL); + queue_command_stream_and_free (op_backend, command, id, query_info_lstat_reply, G_VFS_JOB (job), NULL); - if (! (job->flags & G_FILE_GET_INFO_NOFOLLOW_SYMLINKS)) + if (! (job->flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS)) { data->cb_count++; @@ -2935,7 +2935,7 @@ try_get_info (GVfsBackend *backend, SSH_FXP_STAT, &id); put_string (command, filename); - queue_command_stream_and_free (op_backend, command, id, get_info_stat_reply, G_VFS_JOB (job), NULL); + queue_command_stream_and_free (op_backend, command, id, query_info_stat_reply, G_VFS_JOB (job), NULL); } if (g_file_attribute_matcher_matches (job->attribute_matcher, @@ -2947,7 +2947,7 @@ try_get_info (GVfsBackend *backend, SSH_FXP_READLINK, &id); put_string (command, filename); - queue_command_stream_and_free (op_backend, command, id, get_info_readlink_reply, G_VFS_JOB (job), NULL); + queue_command_stream_and_free (op_backend, command, id, query_info_readlink_reply, G_VFS_JOB (job), NULL); } return TRUE; @@ -3221,7 +3221,7 @@ g_vfs_backend_sftp_class_init (GVfsBackendSftpClass *klass) backend_class->try_seek_on_read = try_seek_on_read; backend_class->try_close_read = try_close_read; backend_class->try_close_write = try_close_write; - backend_class->try_get_info = try_get_info; + backend_class->try_query_info = try_query_info; backend_class->try_enumerate = try_enumerate; backend_class->try_create = try_create; backend_class->try_append_to = try_append_to; diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c index f1204c29..8587b304 100644 --- a/daemon/gvfsbackendsmb.c +++ b/daemon/gvfsbackendsmb.c @@ -21,8 +21,8 @@ #include "gvfsjobclosewrite.h" #include "gvfsjobseekwrite.h" #include "gvfsjobsetdisplayname.h" -#include "gvfsjobgetinfo.h" -#include "gvfsjobgetfsinfo.h" +#include "gvfsjobqueryinfo.h" +#include "gvfsjobqueryfsinfo.h" #include "gvfsjobqueryattributes.h" #include "gvfsjobenumerate.h" #include "gvfsdaemonprotocol.h" @@ -1186,12 +1186,12 @@ set_info_from_stat (GFileInfo *info, struct stat *statbuf, } static void -do_get_info (GVfsBackend *backend, - GVfsJobGetInfo *job, - const char *filename, - GFileGetInfoFlags flags, - GFileInfo *info, - GFileAttributeMatcher *matcher) +do_query_info (GVfsBackend *backend, + GVfsJobQueryInfo *job, + const char *filename, + GFileQueryInfoFlags flags, + GFileInfo *info, + GFileAttributeMatcher *matcher) { GVfsBackendSmb *op_backend = G_VFS_BACKEND_SMB (backend); struct stat st = {0}; @@ -1215,11 +1215,11 @@ do_get_info (GVfsBackend *backend, } static void -do_get_fs_info (GVfsBackend *backend, - GVfsJobGetFsInfo *job, - const char *filename, - GFileInfo *info, - GFileAttributeMatcher *attribute_matcher) +do_query_fs_info (GVfsBackend *backend, + GVfsJobQueryFsInfo *job, + const char *filename, + GFileInfo *info, + GFileAttributeMatcher *attribute_matcher) { g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FS_TYPE, "cifs"); @@ -1255,7 +1255,7 @@ do_enumerate (GVfsBackend *backend, GVfsJobEnumerate *job, const char *filename, GFileAttributeMatcher *matcher, - GFileGetInfoFlags flags) + GFileQueryInfoFlags flags) { GVfsBackendSmb *op_backend = G_VFS_BACKEND_SMB (backend); struct stat st; @@ -1606,8 +1606,8 @@ g_vfs_backend_smb_class_init (GVfsBackendSmbClass *klass) backend_class->write = do_write; backend_class->seek_on_write = do_seek_on_write; backend_class->close_write = do_close_write; - backend_class->get_info = do_get_info; - backend_class->get_fs_info = do_get_fs_info; + backend_class->query_info = do_query_info; + backend_class->query_fs_info = do_query_fs_info; backend_class->enumerate = do_enumerate; backend_class->set_display_name = do_set_display_name; backend_class->delete = do_delete; diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c index 99ee4138..fcc4527c 100644 --- a/daemon/gvfsbackendsmbbrowse.c +++ b/daemon/gvfsbackendsmbbrowse.c @@ -17,7 +17,7 @@ #include "gvfsjobopenforread.h" #include "gvfsjobread.h" #include "gvfsjobseekread.h" -#include "gvfsjobgetinfo.h" +#include "gvfsjobqueryinfo.h" #include "gvfsjobenumerate.h" #include "gvfsdaemonprotocol.h" #include "gmounttracker.h" @@ -954,11 +954,11 @@ get_file_info_from_entry (GVfsBackendSmbBrowse *backend, BrowseEntry *entry, GFi } static void -run_get_info (GVfsBackendSmbBrowse *backend, - GVfsJobGetInfo *job, - const char *filename, - GFileInfo *info, - GFileAttributeMatcher *matcher) +run_query_info (GVfsBackendSmbBrowse *backend, + GVfsJobQueryInfo *job, + const char *filename, + GFileInfo *info, + GFileAttributeMatcher *matcher) { BrowseEntry *entry; @@ -980,28 +980,28 @@ run_get_info (GVfsBackendSmbBrowse *backend, } static void -do_get_info (GVfsBackend *backend, - GVfsJobGetInfo *job, - const char *filename, - GFileGetInfoFlags flags, - GFileInfo *info, - GFileAttributeMatcher *matcher) +do_query_info (GVfsBackend *backend, + GVfsJobQueryInfo *job, + const char *filename, + GFileQueryInfoFlags flags, + GFileInfo *info, + GFileAttributeMatcher *matcher) { GVfsBackendSmbBrowse *op_backend = G_VFS_BACKEND_SMB_BROWSE (backend); update_cache (op_backend); - run_get_info (op_backend, job, filename, info, matcher); + run_query_info (op_backend, job, filename, info, matcher); } static gboolean -try_get_info (GVfsBackend *backend, - GVfsJobGetInfo *job, - const char *filename, - GFileGetInfoFlags flags, - GFileInfo *info, - GFileAttributeMatcher *matcher) +try_query_info (GVfsBackend *backend, + GVfsJobQueryInfo *job, + const char *filename, + GFileQueryInfoFlags flags, + GFileInfo *info, + GFileAttributeMatcher *matcher) { GVfsBackendSmbBrowse *op_backend = G_VFS_BACKEND_SMB_BROWSE (backend); @@ -1017,7 +1017,7 @@ try_get_info (GVfsBackend *backend, if (cache_needs_updating (op_backend)) return FALSE; - run_get_info (op_backend, job, filename, info, matcher); + run_query_info (op_backend, job, filename, info, matcher); return TRUE; } @@ -1074,7 +1074,7 @@ do_enumerate (GVfsBackend *backend, GVfsJobEnumerate *job, const char *filename, GFileAttributeMatcher *matcher, - GFileGetInfoFlags flags) + GFileQueryInfoFlags flags) { GVfsBackendSmbBrowse *op_backend = G_VFS_BACKEND_SMB_BROWSE (backend); @@ -1088,7 +1088,7 @@ try_enumerate (GVfsBackend *backend, GVfsJobEnumerate *job, const char *filename, GFileAttributeMatcher *matcher, - GFileGetInfoFlags flags) + GFileQueryInfoFlags flags) { GVfsBackendSmbBrowse *op_backend = G_VFS_BACKEND_SMB_BROWSE (backend); @@ -1117,8 +1117,8 @@ g_vfs_backend_smb_browse_class_init (GVfsBackendSmbBrowseClass *klass) backend_class->try_read = try_read; backend_class->try_seek_on_read = try_seek_on_read; backend_class->try_close_read = try_close_read; - backend_class->get_info = do_get_info; - backend_class->try_get_info = try_get_info; + backend_class->query_info = do_query_info; + backend_class->try_query_info = try_query_info; backend_class->enumerate = do_enumerate; backend_class->try_enumerate = try_enumerate; } diff --git a/daemon/gvfsbackendtest.c b/daemon/gvfsbackendtest.c index 4c8542ae..9e725419 100644 --- a/daemon/gvfsbackendtest.c +++ b/daemon/gvfsbackendtest.c @@ -17,7 +17,7 @@ #include "gvfsjobopenforread.h" #include "gvfsjobread.h" #include "gvfsjobseekread.h" -#include "gvfsjobgetinfo.h" +#include "gvfsjobqueryinfo.h" #include "gvfsjobenumerate.h" G_DEFINE_TYPE (GVfsBackendTest, g_vfs_backend_test, G_VFS_TYPE_BACKEND); @@ -243,12 +243,12 @@ do_close_read (GVfsBackend *backend, } static void -do_get_info (GVfsBackend *backend, - GVfsJobGetInfo *job, - const char *filename, - GFileGetInfoFlags flags, - GFileInfo *info, - GFileAttributeMatcher *matcher) +do_query_info (GVfsBackend *backend, + GVfsJobQueryInfo *job, + const char *filename, + GFileQueryInfoFlags flags, + GFileInfo *info, + GFileAttributeMatcher *matcher) { GFile *file; GFileInfo *info2; @@ -261,8 +261,8 @@ do_get_info (GVfsBackend *backend, file = g_vfs_get_file_for_path (local_vfs, filename); error = NULL; - info2 = g_file_get_info (file, NULL, flags, - NULL, &error); + info2 = g_file_query_info (file, NULL, flags, + NULL, &error); if (info2) { @@ -281,7 +281,7 @@ try_enumerate (GVfsBackend *backend, GVfsJobEnumerate *job, const char *filename, GFileAttributeMatcher *matcher, - GFileGetInfoFlags flags) + GFileQueryInfoFlags flags) { GFileInfo *info1, *info2;; GList *l; @@ -325,6 +325,6 @@ g_vfs_backend_test_class_init (GVfsBackendTestClass *klass) backend_class->try_read = try_read; backend_class->seek_on_read = do_seek_on_read; backend_class->close_read = do_close_read; - backend_class->get_info = do_get_info; + backend_class->query_info = do_query_info; backend_class->try_enumerate = try_enumerate; } diff --git a/daemon/gvfsjobenumerate.h b/daemon/gvfsjobenumerate.h index 1dfc4c4b..9784609a 100644 --- a/daemon/gvfsjobenumerate.h +++ b/daemon/gvfsjobenumerate.h @@ -25,7 +25,7 @@ struct _GVfsJobEnumerate char *filename; char *object_path; GFileAttributeMatcher *attribute_matcher; - GFileGetInfoFlags flags; + GFileQueryInfoFlags flags; DBusMessage *building_infos; DBusMessageIter building_iter; diff --git a/daemon/gvfsjobgetfsinfo.h b/daemon/gvfsjobgetfsinfo.h deleted file mode 100644 index d0ec6fa3..00000000 --- a/daemon/gvfsjobgetfsinfo.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __G_VFS_JOB_GET_FS_INFO_H__ -#define __G_VFS_JOB_GET_FS_INFO_H__ - -#include <gio/gfileinfo.h> -#include <gvfsjob.h> -#include <gvfsjobdbus.h> -#include <gvfsbackend.h> - -G_BEGIN_DECLS - -#define G_VFS_TYPE_JOB_GET_FS_INFO (g_vfs_job_get_fs_info_get_type ()) -#define G_VFS_JOB_GET_FS_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_VFS_TYPE_JOB_GET_FS_INFO, GVfsJobGetFsInfo)) -#define G_VFS_JOB_GET_FS_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_JOB_GET_FS_INFO, GVfsJobGetFsInfoClass)) -#define G_VFS_IS_JOB_GET_FS_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_VFS_TYPE_JOB_GET_FS_INFO)) -#define G_VFS_IS_JOB_GET_FS_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_VFS_TYPE_JOB_GET_FS_INFO)) -#define G_VFS_JOB_GET_FS_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_VFS_TYPE_JOB_GET_FS_INFO, GVfsJobGetFsInfoClass)) - -typedef struct _GVfsJobGetFsInfoClass GVfsJobGetFsInfoClass; - -struct _GVfsJobGetFsInfo -{ - GVfsJobDBus parent_instance; - - GVfsBackend *backend; - char *filename; - GFileAttributeMatcher *attribute_matcher; - - GFileInfo *file_info; -}; - -struct _GVfsJobGetFsInfoClass -{ - GVfsJobDBusClass parent_class; -}; - -GType g_vfs_job_get_fs_info_get_type (void) G_GNUC_CONST; - -GVfsJob *g_vfs_job_get_fs_info_new (DBusConnection *connection, - DBusMessage *message, - GVfsBackend *backend); - -G_END_DECLS - -#endif /* __G_VFS_JOB_GET_FS_INFO_H__ */ diff --git a/daemon/gvfsjobgetinfo.h b/daemon/gvfsjobgetinfo.h deleted file mode 100644 index 26fb5830..00000000 --- a/daemon/gvfsjobgetinfo.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __G_VFS_JOB_GET_INFO_H__ -#define __G_VFS_JOB_GET_INFO_H__ - -#include <gio/gfileinfo.h> -#include <gvfsjob.h> -#include <gvfsjobdbus.h> -#include <gvfsbackend.h> - -G_BEGIN_DECLS - -#define G_VFS_TYPE_JOB_GET_INFO (g_vfs_job_get_info_get_type ()) -#define G_VFS_JOB_GET_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_VFS_TYPE_JOB_GET_INFO, GVfsJobGetInfo)) -#define G_VFS_JOB_GET_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_JOB_GET_INFO, GVfsJobGetInfoClass)) -#define G_VFS_IS_JOB_GET_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_VFS_TYPE_JOB_GET_INFO)) -#define G_VFS_IS_JOB_GET_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_VFS_TYPE_JOB_GET_INFO)) -#define G_VFS_JOB_GET_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_VFS_TYPE_JOB_GET_INFO, GVfsJobGetInfoClass)) - -typedef struct _GVfsJobGetInfoClass GVfsJobGetInfoClass; - -struct _GVfsJobGetInfo -{ - GVfsJobDBus parent_instance; - - GVfsBackend *backend; - char *filename; - GFileAttributeMatcher *attribute_matcher; - GFileGetInfoFlags flags; - - GFileInfo *file_info; -}; - -struct _GVfsJobGetInfoClass -{ - GVfsJobDBusClass parent_class; -}; - -GType g_vfs_job_get_info_get_type (void) G_GNUC_CONST; - -GVfsJob *g_vfs_job_get_info_new (DBusConnection *connection, - DBusMessage *message, - GVfsBackend *backend); - -G_END_DECLS - -#endif /* __G_VFS_JOB_GET_INFO_H__ */ diff --git a/daemon/gvfsjobgetfsinfo.c b/daemon/gvfsjobqueryfsinfo.c index d95a6ebb..dc7a4f36 100644 --- a/daemon/gvfsjobgetfsinfo.c +++ b/daemon/gvfsjobqueryfsinfo.c @@ -8,11 +8,11 @@ #include <glib.h> #include <dbus/dbus.h> #include <glib/gi18n.h> -#include "gvfsjobgetfsinfo.h" +#include "gvfsjobqueryfsinfo.h" #include "gdbusutils.h" #include "gvfsdaemonprotocol.h" -G_DEFINE_TYPE (GVfsJobGetFsInfo, g_vfs_job_get_fs_info, G_VFS_TYPE_JOB_DBUS); +G_DEFINE_TYPE (GVfsJobQueryFsInfo, g_vfs_job_query_fs_info, G_VFS_TYPE_JOB_DBUS); static void run (GVfsJob *job); static gboolean try (GVfsJob *job); @@ -21,45 +21,45 @@ static DBusMessage *create_reply (GVfsJob *job, DBusMessage *message); static void -g_vfs_job_get_fs_info_finalize (GObject *object) +g_vfs_job_query_fs_info_finalize (GObject *object) { - GVfsJobGetFsInfo *job; + GVfsJobQueryFsInfo *job; - job = G_VFS_JOB_GET_FS_INFO (object); + job = G_VFS_JOB_QUERY_FS_INFO (object); g_object_unref (job->file_info); g_free (job->filename); g_file_attribute_matcher_unref (job->attribute_matcher); - if (G_OBJECT_CLASS (g_vfs_job_get_fs_info_parent_class)->finalize) - (*G_OBJECT_CLASS (g_vfs_job_get_fs_info_parent_class)->finalize) (object); + if (G_OBJECT_CLASS (g_vfs_job_query_fs_info_parent_class)->finalize) + (*G_OBJECT_CLASS (g_vfs_job_query_fs_info_parent_class)->finalize) (object); } static void -g_vfs_job_get_fs_info_class_init (GVfsJobGetFsInfoClass *klass) +g_vfs_job_query_fs_info_class_init (GVfsJobQueryFsInfoClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GVfsJobClass *job_class = G_VFS_JOB_CLASS (klass); GVfsJobDBusClass *job_dbus_class = G_VFS_JOB_DBUS_CLASS (klass); - gobject_class->finalize = g_vfs_job_get_fs_info_finalize; + gobject_class->finalize = g_vfs_job_query_fs_info_finalize; job_class->run = run; job_class->try = try; job_dbus_class->create_reply = create_reply; } static void -g_vfs_job_get_fs_info_init (GVfsJobGetFsInfo *job) +g_vfs_job_query_fs_info_init (GVfsJobQueryFsInfo *job) { } GVfsJob * -g_vfs_job_get_fs_info_new (DBusConnection *connection, +g_vfs_job_query_fs_info_new (DBusConnection *connection, DBusMessage *message, GVfsBackend *backend) { - GVfsJobGetFsInfo *job; + GVfsJobQueryFsInfo *job; DBusMessage *reply; DBusError derror; int path_len; @@ -82,7 +82,7 @@ g_vfs_job_get_fs_info_new (DBusConnection *connection, return NULL; } - job = g_object_new (G_VFS_TYPE_JOB_GET_FS_INFO, + job = g_object_new (G_VFS_TYPE_JOB_QUERY_FS_INFO, "message", message, "connection", connection, NULL); @@ -100,17 +100,17 @@ g_vfs_job_get_fs_info_new (DBusConnection *connection, static void run (GVfsJob *job) { - GVfsJobGetFsInfo *op_job = G_VFS_JOB_GET_FS_INFO (job); + GVfsJobQueryFsInfo *op_job = G_VFS_JOB_QUERY_FS_INFO (job); GVfsBackendClass *class = G_VFS_BACKEND_GET_CLASS (op_job->backend); - if (class->get_fs_info == NULL) + if (class->query_fs_info == NULL) { g_vfs_job_failed (job, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, _("Operation not supported by backend")); return; } - class->get_fs_info (op_job->backend, + class->query_fs_info (op_job->backend, op_job, op_job->filename, op_job->file_info, @@ -120,13 +120,13 @@ run (GVfsJob *job) static gboolean try (GVfsJob *job) { - GVfsJobGetFsInfo *op_job = G_VFS_JOB_GET_FS_INFO (job); + GVfsJobQueryFsInfo *op_job = G_VFS_JOB_QUERY_FS_INFO (job); GVfsBackendClass *class = G_VFS_BACKEND_GET_CLASS (op_job->backend); - if (class->try_get_fs_info == NULL) + if (class->try_query_fs_info == NULL) return FALSE; - return class->try_get_fs_info (op_job->backend, + return class->try_query_fs_info (op_job->backend, op_job, op_job->filename, op_job->file_info, @@ -139,7 +139,7 @@ create_reply (GVfsJob *job, DBusConnection *connection, DBusMessage *message) { - GVfsJobGetFsInfo *op_job = G_VFS_JOB_GET_FS_INFO (job); + GVfsJobQueryFsInfo *op_job = G_VFS_JOB_QUERY_FS_INFO (job); DBusMessage *reply; DBusMessageIter iter; const char *type; diff --git a/daemon/gvfsjobqueryfsinfo.h b/daemon/gvfsjobqueryfsinfo.h new file mode 100644 index 00000000..a40cce15 --- /dev/null +++ b/daemon/gvfsjobqueryfsinfo.h @@ -0,0 +1,44 @@ +#ifndef __G_VFS_JOB_QUERY_FS_INFO_H__ +#define __G_VFS_JOB_QUERY_FS_INFO_H__ + +#include <gio/gfileinfo.h> +#include <gvfsjob.h> +#include <gvfsjobdbus.h> +#include <gvfsbackend.h> + +G_BEGIN_DECLS + +#define G_VFS_TYPE_JOB_QUERY_FS_INFO (g_vfs_job_query_fs_info_get_type ()) +#define G_VFS_JOB_QUERY_FS_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_VFS_TYPE_JOB_QUERY_FS_INFO, GVfsJobQueryFsInfo)) +#define G_VFS_JOB_QUERY_FS_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_JOB_QUERY_FS_INFO, GVfsJobQueryFsInfoClass)) +#define G_VFS_IS_JOB_QUERY_FS_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_VFS_TYPE_JOB_QUERY_FS_INFO)) +#define G_VFS_IS_JOB_QUERY_FS_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_VFS_TYPE_JOB_QUERY_FS_INFO)) +#define G_VFS_JOB_QUERY_FS_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_VFS_TYPE_JOB_QUERY_FS_INFO, GVfsJobQueryFsInfoClass)) + +typedef struct _GVfsJobQueryFsInfoClass GVfsJobQueryFsInfoClass; + +struct _GVfsJobQueryFsInfo +{ + GVfsJobDBus parent_instance; + + GVfsBackend *backend; + char *filename; + GFileAttributeMatcher *attribute_matcher; + + GFileInfo *file_info; +}; + +struct _GVfsJobQueryFsInfoClass +{ + GVfsJobDBusClass parent_class; +}; + +GType g_vfs_job_query_fs_info_get_type (void) G_GNUC_CONST; + +GVfsJob *g_vfs_job_query_fs_info_new (DBusConnection *connection, + DBusMessage *message, + GVfsBackend *backend); + +G_END_DECLS + +#endif /* __G_VFS_JOB_QUERY_FS_INFO_H__ */ diff --git a/daemon/gvfsjobgetinfo.c b/daemon/gvfsjobqueryinfo.c index 11fcbf78..2155267b 100644 --- a/daemon/gvfsjobgetinfo.c +++ b/daemon/gvfsjobqueryinfo.c @@ -9,11 +9,11 @@ #include <glib.h> #include <dbus/dbus.h> #include <glib/gi18n.h> -#include "gvfsjobgetinfo.h" +#include "gvfsjobqueryinfo.h" #include "gdbusutils.h" #include "gvfsdaemonprotocol.h" -G_DEFINE_TYPE (GVfsJobGetInfo, g_vfs_job_get_info, G_VFS_TYPE_JOB_DBUS); +G_DEFINE_TYPE (GVfsJobQueryInfo, g_vfs_job_query_info, G_VFS_TYPE_JOB_DBUS); static void run (GVfsJob *job); static gboolean try (GVfsJob *job); @@ -22,45 +22,45 @@ static DBusMessage *create_reply (GVfsJob *job, DBusMessage *message); static void -g_vfs_job_get_info_finalize (GObject *object) +g_vfs_job_query_info_finalize (GObject *object) { - GVfsJobGetInfo *job; + GVfsJobQueryInfo *job; - job = G_VFS_JOB_GET_INFO (object); + job = G_VFS_JOB_QUERY_INFO (object); g_object_unref (job->file_info); g_free (job->filename); g_file_attribute_matcher_unref (job->attribute_matcher); - if (G_OBJECT_CLASS (g_vfs_job_get_info_parent_class)->finalize) - (*G_OBJECT_CLASS (g_vfs_job_get_info_parent_class)->finalize) (object); + if (G_OBJECT_CLASS (g_vfs_job_query_info_parent_class)->finalize) + (*G_OBJECT_CLASS (g_vfs_job_query_info_parent_class)->finalize) (object); } static void -g_vfs_job_get_info_class_init (GVfsJobGetInfoClass *klass) +g_vfs_job_query_info_class_init (GVfsJobQueryInfoClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GVfsJobClass *job_class = G_VFS_JOB_CLASS (klass); GVfsJobDBusClass *job_dbus_class = G_VFS_JOB_DBUS_CLASS (klass); - gobject_class->finalize = g_vfs_job_get_info_finalize; + gobject_class->finalize = g_vfs_job_query_info_finalize; job_class->run = run; job_class->try = try; job_dbus_class->create_reply = create_reply; } static void -g_vfs_job_get_info_init (GVfsJobGetInfo *job) +g_vfs_job_query_info_init (GVfsJobQueryInfo *job) { } GVfsJob * -g_vfs_job_get_info_new (DBusConnection *connection, +g_vfs_job_query_info_new (DBusConnection *connection, DBusMessage *message, GVfsBackend *backend) { - GVfsJobGetInfo *job; + GVfsJobQueryInfo *job; DBusMessage *reply; DBusError derror; int path_len; @@ -85,7 +85,7 @@ g_vfs_job_get_info_new (DBusConnection *connection, return NULL; } - job = g_object_new (G_VFS_TYPE_JOB_GET_INFO, + job = g_object_new (G_VFS_TYPE_JOB_QUERY_INFO, "message", message, "connection", connection, NULL); @@ -104,17 +104,17 @@ g_vfs_job_get_info_new (DBusConnection *connection, static void run (GVfsJob *job) { - GVfsJobGetInfo *op_job = G_VFS_JOB_GET_INFO (job); + GVfsJobQueryInfo *op_job = G_VFS_JOB_QUERY_INFO (job); GVfsBackendClass *class = G_VFS_BACKEND_GET_CLASS (op_job->backend); - if (class->get_info == NULL) + if (class->query_info == NULL) { g_vfs_job_failed (job, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, _("Operation not supported by backend")); return; } - class->get_info (op_job->backend, + class->query_info (op_job->backend, op_job, op_job->filename, op_job->flags, @@ -125,13 +125,13 @@ run (GVfsJob *job) static gboolean try (GVfsJob *job) { - GVfsJobGetInfo *op_job = G_VFS_JOB_GET_INFO (job); + GVfsJobQueryInfo *op_job = G_VFS_JOB_QUERY_INFO (job); GVfsBackendClass *class = G_VFS_BACKEND_GET_CLASS (op_job->backend); - if (class->try_get_info == NULL) + if (class->try_query_info == NULL) return FALSE; - return class->try_get_info (op_job->backend, + return class->try_query_info (op_job->backend, op_job, op_job->filename, op_job->flags, @@ -145,7 +145,7 @@ create_reply (GVfsJob *job, DBusConnection *connection, DBusMessage *message) { - GVfsJobGetInfo *op_job = G_VFS_JOB_GET_INFO (job); + GVfsJobQueryInfo *op_job = G_VFS_JOB_QUERY_INFO (job); DBusMessage *reply; DBusMessageIter iter; diff --git a/daemon/gvfsjobqueryinfo.h b/daemon/gvfsjobqueryinfo.h new file mode 100644 index 00000000..d180e757 --- /dev/null +++ b/daemon/gvfsjobqueryinfo.h @@ -0,0 +1,45 @@ +#ifndef __G_VFS_JOB_QUERY_INFO_H__ +#define __G_VFS_JOB_QUERY_INFO_H__ + +#include <gio/gfileinfo.h> +#include <gvfsjob.h> +#include <gvfsjobdbus.h> +#include <gvfsbackend.h> + +G_BEGIN_DECLS + +#define G_VFS_TYPE_JOB_QUERY_INFO (g_vfs_job_query_info_get_type ()) +#define G_VFS_JOB_QUERY_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_VFS_TYPE_JOB_QUERY_INFO, GVfsJobQueryInfo)) +#define G_VFS_JOB_QUERY_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_JOB_QUERY_INFO, GVfsJobQueryInfoClass)) +#define G_VFS_IS_JOB_QUERY_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_VFS_TYPE_JOB_QUERY_INFO)) +#define G_VFS_IS_JOB_QUERY_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_VFS_TYPE_JOB_QUERY_INFO)) +#define G_VFS_JOB_QUERY_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_VFS_TYPE_JOB_QUERY_INFO, GVfsJobQueryInfoClass)) + +typedef struct _GVfsJobQueryInfoClass GVfsJobQueryInfoClass; + +struct _GVfsJobQueryInfo +{ + GVfsJobDBus parent_instance; + + GVfsBackend *backend; + char *filename; + GFileAttributeMatcher *attribute_matcher; + GFileQueryInfoFlags flags; + + GFileInfo *file_info; +}; + +struct _GVfsJobQueryInfoClass +{ + GVfsJobDBusClass parent_class; +}; + +GType g_vfs_job_query_info_get_type (void) G_GNUC_CONST; + +GVfsJob *g_vfs_job_query_info_new (DBusConnection *connection, + DBusMessage *message, + GVfsBackend *backend); + +G_END_DECLS + +#endif /* __G_VFS_JOB_QUERY_INFO_H__ */ diff --git a/daemon/gvfsjobsetattribute.c b/daemon/gvfsjobsetattribute.c index 2a1d0020..7008e5b6 100644 --- a/daemon/gvfsjobsetattribute.c +++ b/daemon/gvfsjobsetattribute.c @@ -67,7 +67,7 @@ g_vfs_job_set_attribute_new (DBusConnection *connection, const gchar *filename = NULL; gint filename_len; GFileAttributeValue value = G_FILE_ATTRIBUTE_VALUE_INIT; - GFileGetInfoFlags flags; + GFileQueryInfoFlags flags; gchar *attribute; dbus_uint32_t flags_u32 = 0; diff --git a/daemon/gvfsjobsetattribute.h b/daemon/gvfsjobsetattribute.h index ad0e9d58..26c9fba7 100644 --- a/daemon/gvfsjobsetattribute.h +++ b/daemon/gvfsjobsetattribute.h @@ -27,7 +27,7 @@ struct _GVfsJobSetAttribute char *attribute; GFileAttributeType type; GFileAttributeValue value; - GFileGetInfoFlags flags; + GFileQueryInfoFlags flags; }; struct _GVfsJobSetAttributeClass @@ -38,8 +38,8 @@ struct _GVfsJobSetAttributeClass GType g_vfs_job_set_attribute_get_type (void) G_GNUC_CONST; GVfsJob *g_vfs_job_set_attribute_new (DBusConnection *connection, - DBusMessage *message, - GVfsBackend *backend); + DBusMessage *message, + GVfsBackend *backend); G_END_DECLS diff --git a/test/benchmark-gvfs-big-files.c b/test/benchmark-gvfs-big-files.c index d8cb157a..e4b19a6f 100644 --- a/test/benchmark-gvfs-big-files.c +++ b/test/benchmark-gvfs-big-files.c @@ -25,7 +25,7 @@ is_dir (GFile *file) GFileInfo *info; gboolean res; - info = g_file_get_info (file, G_FILE_ATTRIBUTE_STD_TYPE, 0, NULL, NULL); + info = g_file_query_info (file, G_FILE_ATTRIBUTE_STD_TYPE, 0, NULL, NULL); res = info && g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY; if (info) g_object_unref (info); diff --git a/test/benchmark-gvfs-small-files.c b/test/benchmark-gvfs-small-files.c index 58e19f8d..f72b72a8 100644 --- a/test/benchmark-gvfs-small-files.c +++ b/test/benchmark-gvfs-small-files.c @@ -25,7 +25,7 @@ is_dir (GFile *file) GFileInfo *info; gboolean res; - info = g_file_get_info (file, G_FILE_ATTRIBUTE_STD_TYPE, 0, NULL, NULL); + info = g_file_query_info (file, G_FILE_ATTRIBUTE_STD_TYPE, 0, NULL, NULL); res = info && g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY; if (info) g_object_unref (info); |