From 4cb6eab803662aebb2a81fe97832dd7576391331 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 14 Dec 2007 11:07:31 +0000 Subject: [PATCH] Clean up all flags enums to not have _FLAGS in them Make the names of some 2007-12-14 Alexander Larsson * gappinfo.h: * gfile.[ch]: * gfileattribute.[ch]: * gio.symbols: * glocalfile.c: * glocalfileoutputstream.c: * gmountoperation.[ch]: * goutputstream.[ch]: Clean up all flags enums to not have _FLAGS in them Make the names of some of the enums better. * glocalfileinfo.c: Fix warning svn path=/trunk/; revision=6119 --- gio/ChangeLog | 16 ++++++++++++++++ gio/gappinfo.h | 2 +- gio/gfile.c | 10 +++++----- gio/gfile.h | 18 +++++++++--------- gio/gfileattribute.c | 4 ++-- gio/gfileattribute.h | 24 ++++++++++++------------ gio/gio.symbols | 4 ++-- gio/glocalfile.c | 20 ++++++++++---------- gio/glocalfileinfo.c | 2 +- gio/glocalfileoutputstream.c | 6 +++--- gio/gmountoperation.c | 4 ++-- gio/gmountoperation.h | 29 +++++++++++++++-------------- gio/goutputstream.c | 4 ++-- gio/goutputstream.h | 12 ++++++------ 14 files changed, 86 insertions(+), 69 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 29dcb702..7ae8e5e3 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,19 @@ +2007-12-14 Alexander Larsson + + * gappinfo.h: + * gfile.[ch]: + * gfileattribute.[ch]: + * gio.symbols: + * glocalfile.c: + * glocalfileoutputstream.c: + * gmountoperation.[ch]: + * goutputstream.[ch]: + Clean up all flags enums to not have _FLAGS in them + Make the names of some of the enums better. + + * glocalfileinfo.c: + Fix warning + 2007-12-14 Michael Natterer * gio.symbols: fix g_io_scheduler symbol names. diff --git a/gio/gappinfo.h b/gio/gappinfo.h index 59d6f2fb..ee908f55 100644 --- a/gio/gappinfo.h +++ b/gio/gappinfo.h @@ -52,7 +52,7 @@ G_BEGIN_DECLS * Flags used when creating a #GAppInfo. */ typedef enum { - G_APP_INFO_CREATE_FLAGS_NONE = 0, /*< nick=none >*/ + G_APP_INFO_CREATE_NONE = 0, /*< nick=none >*/ G_APP_INFO_CREATE_NEEDS_TERMINAL = (1<<0) /*< nick=needs-terminal >*/ } GAppInfoCreateFlags; diff --git a/gio/gfile.c b/gio/gfile.c index abfdec86..feeb8f7a 100644 --- a/gio/gfile.c +++ b/gio/gfile.c @@ -1070,7 +1070,7 @@ g_file_read (GFile *file, * the file doesn't already exist it is created. * * By default files created are generally readable by everyone, - * but if you pass #G_FILE_CREATE_FLAGS_PRIVATE in @flags the file + * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file * will be made readable only to the current user, to the level that * is supported on the target filesystem. * @@ -1123,7 +1123,7 @@ g_file_append_to (GFile *file, * The file must not already exists. * * By default files created are generally readable by everyone, - * but if you pass #G_FILE_CREATE_FLAGS_PRIVATE in @flags the file + * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file * will be made readable only to the current user, to the level that * is supported on the target filesystem. * @@ -1189,7 +1189,7 @@ g_file_create (GFile *file, * the destination when the stream is closed. * * By default files created are generally readable by everyone, - * but if you pass #G_FILE_CREATE_FLAGS_PRIVATE in @flags the file + * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file * will be made readable only to the current user, to the level that * is supported on the target filesystem. * @@ -1681,8 +1681,8 @@ should_copy (GFileAttributeInfo *info, gboolean as_move) { if (as_move) - return info->flags & G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED; - return info->flags & G_FILE_ATTRIBUTE_FLAGS_COPY_WITH_FILE; + return info->flags & G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED; + return info->flags & G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE; } static char * diff --git a/gio/gfile.h b/gio/gfile.h index 48574b1e..361c04ea 100644 --- a/gio/gfile.h +++ b/gio/gfile.h @@ -48,7 +48,7 @@ G_BEGIN_DECLS * Flags used when querying a #GFileInfo. */ typedef enum { - G_FILE_QUERY_INFO_FLAGS_NONE = 0, + G_FILE_QUERY_INFO_NONE = 0, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = (1<<0) /*< nick=nofollow-symlinks >*/ } GFileQueryInfoFlags; @@ -61,13 +61,13 @@ typedef enum { * Flags used when an operation may create a file. */ typedef enum { - G_FILE_CREATE_FLAGS_NONE = 0, - G_FILE_CREATE_FLAGS_PRIVATE = (1<<0) + G_FILE_CREATE_NONE = 0, + G_FILE_CREATE_PRIVATE = (1<<0) } GFileCreateFlags; /** * GFileCopyFlags: - * @G_FILE_COPY_FLAGS_NONE: No flags set. + * @G_FILE_COPY_NONE: No flags set. * @G_FILE_COPY_OVERWRITE: Overwrite any existing files * @G_FILE_COPY_BACKUP: Make a backup of any existing files. * @G_FILE_COPY_NOFOLLOW_SYMLINKS: Don't follow symlinks. @@ -77,7 +77,7 @@ typedef enum { * Flags used when copying or moving files. */ typedef enum { - G_FILE_COPY_FLAGS_NONE = 0, /*< nick=none >*/ + G_FILE_COPY_NONE = 0, /*< nick=none >*/ G_FILE_COPY_OVERWRITE = (1<<0), G_FILE_COPY_BACKUP = (1<<1), G_FILE_COPY_NOFOLLOW_SYMLINKS = (1<<2), @@ -87,14 +87,14 @@ typedef enum { /** * GFileMonitorFlags: - * @G_FILE_MONITOR_FLAGS_NONE: No flags set. - * @G_FILE_MONITOR_FLAGS_MONITOR_MOUNTS: Watch for mount events. + * @G_FILE_MONITOR_NONE: No flags set. + * @G_FILE_MONITOR_WATCH_MOUNTS: Watch for mount events. * * Flags used to set what a #GFileMonitor or #GDirectoryMonitor will watch for. */ typedef enum { - G_FILE_MONITOR_FLAGS_NONE = 0, - G_FILE_MONITOR_FLAGS_MONITOR_MOUNTS = (1<<0) + G_FILE_MONITOR_NONE = 0, + G_FILE_MONITOR_WATCH_MOUNTS = (1<<0) } GFileMonitorFlags; /** diff --git a/gio/gfileattribute.c b/gio/gfileattribute.c index 2044cfdb..43f593f2 100644 --- a/gio/gfileattribute.c +++ b/gio/gfileattribute.c @@ -875,7 +875,7 @@ g_file_attribute_info_list_lookup (GFileAttributeInfoList *list, * @list: a #GFileAttributeInfoList. * @name: the name of the attribute to add. * @type: the #GFileAttributeType for the attribute. - * @flags: #GFileAttributeFlags for the attribute. + * @flags: #GFileAttributeInfoFlags for the attribute. * * Adds a new attribute with @name to the @list, setting * its @type and @flags. @@ -884,7 +884,7 @@ void g_file_attribute_info_list_add (GFileAttributeInfoList *list, const char *name, GFileAttributeType type, - GFileAttributeFlags flags) + GFileAttributeInfoFlags flags) { GFileAttributeInfoListPriv *priv = (GFileAttributeInfoListPriv *)list; GFileAttributeInfo info; diff --git a/gio/gfileattribute.h b/gio/gfileattribute.h index 0d419035..10b60872 100644 --- a/gio/gfileattribute.h +++ b/gio/gfileattribute.h @@ -58,18 +58,18 @@ typedef enum { } GFileAttributeType; /** - * GFileAttributeFlags: - * @G_FILE_ATTRIBUTE_FLAGS_NONE: no flags set. - * @G_FILE_ATTRIBUTE_FLAGS_COPY_WITH_FILE: copy the attribute values when the file is copied. - * @G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED: copy the attribute values when the file is moved. + * GFileAttributeInfoFlags: + * @G_FILE_ATTRIBUTE_INFO_NONE: no flags set. + * @G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE: copy the attribute values when the file is copied. + * @G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED: copy the attribute values when the file is moved. * - * A flag specifying the behaviour of an attribute. + * Flags specifying the behaviour of an attribute. **/ typedef enum { - G_FILE_ATTRIBUTE_FLAGS_NONE = 0, - G_FILE_ATTRIBUTE_FLAGS_COPY_WITH_FILE = 1 << 0, - G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED = 1 << 1 -} GFileAttributeFlags; + G_FILE_ATTRIBUTE_INFO_NONE = 0, + G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE = 1 << 0, + G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED = 1 << 1 +} GFileAttributeInfoFlags; /** * GFileAttributeStatus: @@ -113,14 +113,14 @@ typedef struct { * GFileAttributeInfo: * @name: the name of the attribute. * @type: the #GFileAttributeType type of the attribute. - * @flags: a set of #GFileAttributeFlags. + * @flags: a set of #GFileAttributeInfoFlags. * * Information about a specific attribute. **/ typedef struct { char *name; GFileAttributeType type; - GFileAttributeFlags flags; + GFileAttributeInfoFlags flags; } GFileAttributeInfo; /** @@ -180,7 +180,7 @@ const GFileAttributeInfo *g_file_attribute_info_list_lookup (GFileAttributeInfoL void g_file_attribute_info_list_add (GFileAttributeInfoList *list, const char *name, GFileAttributeType type, - GFileAttributeFlags flags); + GFileAttributeInfoFlags flags); G_END_DECLS diff --git a/gio/gio.symbols b/gio/gio.symbols index 30d49c24..25cdfd61 100644 --- a/gio/gio.symbols +++ b/gio/gio.symbols @@ -760,7 +760,7 @@ g_local_directory_monitor_get_type G_GNUC_CONST g_app_info_create_flags_get_type G_GNUC_CONST g_data_stream_byte_order_get_type G_GNUC_CONST g_data_stream_newline_type_get_type G_GNUC_CONST -g_file_attribute_flags_get_type G_GNUC_CONST +g_file_attribute_info_flags_get_type G_GNUC_CONST g_file_attribute_status_get_type G_GNUC_CONST g_file_attribute_type_get_type G_GNUC_CONST g_file_copy_flags_get_type G_GNUC_CONST @@ -771,7 +771,7 @@ g_file_query_info_flags_get_type G_GNUC_CONST g_file_type_get_type G_GNUC_CONST g_io_error_enum_get_type G_GNUC_CONST g_output_stream_splice_flags_get_type G_GNUC_CONST -g_password_flags_get_type G_GNUC_CONST +g_ask_password_flags_get_type G_GNUC_CONST g_password_save_get_type G_GNUC_CONST #endif #endif diff --git a/gio/glocalfile.c b/gio/glocalfile.c index 1cfaf089..d26e3819 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -143,17 +143,17 @@ g_local_file_class_init (GLocalFileClass *klass) g_file_attribute_info_list_add (list, G_FILE_ATTRIBUTE_UNIX_MODE, G_FILE_ATTRIBUTE_TYPE_UINT32, - G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED); + G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); #ifdef HAVE_CHOWN g_file_attribute_info_list_add (list, G_FILE_ATTRIBUTE_UNIX_UID, G_FILE_ATTRIBUTE_TYPE_UINT32, - G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED); + G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); g_file_attribute_info_list_add (list, G_FILE_ATTRIBUTE_UNIX_GID, G_FILE_ATTRIBUTE_TYPE_UINT32, - G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED); + G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); #endif #ifdef HAVE_SYMLINK @@ -167,19 +167,19 @@ g_local_file_class_init (GLocalFileClass *klass) g_file_attribute_info_list_add (list, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_ATTRIBUTE_TYPE_UINT64, - G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED); + G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); g_file_attribute_info_list_add (list, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, G_FILE_ATTRIBUTE_TYPE_UINT32, - G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED); + G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); g_file_attribute_info_list_add (list, G_FILE_ATTRIBUTE_TIME_ACCESS, G_FILE_ATTRIBUTE_TYPE_UINT64, - G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED); + G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); g_file_attribute_info_list_add (list, G_FILE_ATTRIBUTE_TIME_ACCESS_USEC, G_FILE_ATTRIBUTE_TYPE_UINT32, - G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED); + G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); #endif local_writable_attributes = list; @@ -192,12 +192,12 @@ g_local_file_class_init (GLocalFileClass *klass) g_file_attribute_info_list_add (list, "xattr", G_FILE_ATTRIBUTE_TYPE_STRING, - G_FILE_ATTRIBUTE_FLAGS_COPY_WITH_FILE | - G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED); + G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE | + G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); g_file_attribute_info_list_add (list, "xattr-sys", G_FILE_ATTRIBUTE_TYPE_STRING, - G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED); + G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); #endif local_writable_namespaces = list; diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index c9d1a09f..5b11b7f4 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -1238,7 +1238,7 @@ get_thumbnail_attributes (const char *path, uri = g_filename_to_uri (path, NULL, NULL); checksum = g_checksum_new (G_CHECKSUM_MD5); - g_checksum_update (checksum, (const gchar *) uri, strlen (uri)); + g_checksum_update (checksum, (const guchar *) uri, strlen (uri)); basename = g_strconcat (g_checksum_get_string (checksum), ".png", NULL); g_checksum_free (checksum); diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c index 2af8e949..d0a30dcd 100644 --- a/gio/glocalfileoutputstream.c +++ b/gio/glocalfileoutputstream.c @@ -432,7 +432,7 @@ _g_local_file_output_stream_create (const char *filename, if (g_cancellable_set_error_if_cancelled (cancellable, error)) return NULL; - if (flags & G_FILE_CREATE_FLAGS_PRIVATE) + if (flags & G_FILE_CREATE_PRIVATE) mode = 0600; else mode = 0666; @@ -475,7 +475,7 @@ _g_local_file_output_stream_append (const char *filename, if (g_cancellable_set_error_if_cancelled (cancellable, error)) return NULL; - if (flags & G_FILE_CREATE_FLAGS_PRIVATE) + if (flags & G_FILE_CREATE_PRIVATE) mode = 0600; else mode = 0666; @@ -857,7 +857,7 @@ _g_local_file_output_stream_replace (const char *filename, temp_file = NULL; - if (flags & G_FILE_CREATE_FLAGS_PRIVATE) + if (flags & G_FILE_CREATE_PRIVATE) mode = 0600; else mode = 0666; diff --git a/gio/gmountoperation.c b/gio/gmountoperation.c index e2b3ac9f..dcf45d73 100644 --- a/gio/gmountoperation.c +++ b/gio/gmountoperation.c @@ -212,7 +212,7 @@ ask_password (GMountOperation *op, const char *message, const char *default_user, const char *default_domain, - GPasswordFlags flags) + GAskPasswordFlags flags) { return FALSE; } @@ -246,7 +246,7 @@ g_mount_operation_class_init (GMountOperationClass *klass) * @message: string containing a message to display to the user. * @default_user: string containing the default user name. * @default_domain: string containing the default domain. - * @flags: a set of #GPasswordFlags. + * @flags: a set of #GAskPasswordFlags. * * Emitted when a mount operation asks the user for a password. */ diff --git a/gio/gmountoperation.h b/gio/gmountoperation.h index 35434fa1..d35706c9 100644 --- a/gio/gmountoperation.h +++ b/gio/gmountoperation.h @@ -58,25 +58,26 @@ struct _GMountOperation }; /** - * GPasswordFlags: - * @G_PASSWORD_FLAGS_NEED_PASSWORD: operation requires a password. - * @G_PASSWORD_FLAGS_NEED_USERNAME: operation requires a username. - * @G_PASSWORD_FLAGS_NEED_DOMAIN: operation requires a domain. - * @G_PASSWORD_FLAGS_SAVING_SUPPORTED: operation supports saving settings. - * @G_PASSWORD_FLAGS_ANONYMOUS_SUPPORTED: operation supports anonymous users. + * GAskPasswordFlags: + * @G_ASK_PASSWORD_NEED_PASSWORD: operation requires a password. + * @G_ASK_PASSWORD_NEED_USERNAME: operation requires a username. + * @G_ASK_PASSWORD_NEED_DOMAIN: operation requires a domain. + * @G_ASK_PASSWORD_SAVING_SUPPORTED: operation supports saving settings. + * @G_ASK_PASSWORD_ANONYMOUS_SUPPORTED: operation supports anonymous users. * - * #GPasswordFlags are used to request specific information from the + * #GAskPasswordFlags are used to request specific information from the * user, or to notify the user of their choices in an authentication * situation. * **/ typedef enum { - G_PASSWORD_FLAGS_NEED_PASSWORD = 1<<0, - G_PASSWORD_FLAGS_NEED_USERNAME = 1<<1, - G_PASSWORD_FLAGS_NEED_DOMAIN = 1<<2, - G_PASSWORD_FLAGS_SAVING_SUPPORTED = 1<<3, - G_PASSWORD_FLAGS_ANONYMOUS_SUPPORTED = 1<<4 -} GPasswordFlags; + G_ASK_PASSWORD_NONE = 0, + G_ASK_PASSWORD_NEED_PASSWORD = 1<<0, + G_ASK_PASSWORD_NEED_USERNAME = 1<<1, + G_ASK_PASSWORD_NEED_DOMAIN = 1<<2, + G_ASK_PASSWORD_SAVING_SUPPORTED = 1<<3, + G_AKS_PASSWORD_ANONYMOUS_SUPPORTED = 1<<4 +} GAskPasswordFlags; /** * GPasswordSave: @@ -102,7 +103,7 @@ struct _GMountOperationClass const char *message, const char *default_user, const char *default_domain, - GPasswordFlags flags); + GAskPasswordFlags flags); gboolean (* ask_question) (GMountOperation *op, const char *message, diff --git a/gio/goutputstream.c b/gio/goutputstream.c index 510b090e..0f33f02e 100644 --- a/gio/goutputstream.c +++ b/gio/goutputstream.c @@ -439,13 +439,13 @@ g_output_stream_real_splice (GOutputStream *stream, if (!res) error = NULL; /* Ignore further errors */ - if (flags & G_OUTPUT_STREAM_SPLICE_FLAGS_CLOSE_SOURCE) + if (flags & G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE) { /* Don't care about errors in source here */ g_input_stream_close (source, cancellable, NULL); } - if (flags & G_OUTPUT_STREAM_SPLICE_FLAGS_CLOSE_TARGET) + if (flags & G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET) { /* But write errors on close are bad! */ if (!class->close_fn (stream, cancellable, error)) diff --git a/gio/goutputstream.h b/gio/goutputstream.h index 8626bb1d..263e6e6d 100644 --- a/gio/goutputstream.h +++ b/gio/goutputstream.h @@ -44,16 +44,16 @@ G_BEGIN_DECLS /** * GOutputStreamSpliceFlags: - * @G_OUTPUT_STREAM_SPLICE_FLAGS_NONE: Do not close either stream. - * @G_OUTPUT_STREAM_SPLICE_FLAGS_CLOSE_SOURCE: Close the source stream after the splice. - * @G_OUTPUT_STREAM_SPLICE_FLAGS_CLOSE_TARGET: Close the target stream after the splice. + * @G_OUTPUT_STREAM_SPLICE_NONE: Do not close either stream. + * @G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE: Close the source stream after the splice. + * @G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET: Close the target stream after the splice. * * GOutputStreamSpliceFlags determine how streams should be spliced. **/ typedef enum { - G_OUTPUT_STREAM_SPLICE_FLAGS_NONE = 0, - G_OUTPUT_STREAM_SPLICE_FLAGS_CLOSE_SOURCE = 1 << 0, - G_OUTPUT_STREAM_SPLICE_FLAGS_CLOSE_TARGET = 1 << 1 + G_OUTPUT_STREAM_SPLICE_NONE = 0, + G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE = 1 << 0, + G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET = 1 << 1 } GOutputStreamSpliceFlags; /** -- 2.34.1