Commit 4cb6eab8 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Clean up all flags enums to not have _FLAGS in them Make the names of some

2007-12-14  Alexander Larsson  <alexl@redhat.com>

        * 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
parent 0f8f5432
2007-12-14 Alexander Larsson <alexl@redhat.com>
* 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 <mitch@imendio.com>
* gio.symbols: fix g_io_scheduler symbol names.
......
......@@ -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;
......
......@@ -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 *
......
......@@ -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;
/**
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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.
*/
......
......@@ -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,
......
......@@ -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))
......
......@@ -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;
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment