+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.
* 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;
* 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.
*
* 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.
*
* 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.
*
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 *
* 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;
* 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.
* 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),
/**
* 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;
/**
* @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.
g_file_attribute_info_list_add (GFileAttributeInfoList *list,
const char *name,
GFileAttributeType type,
- GFileAttributeFlags flags)
+ GFileAttributeInfoFlags flags)
{
GFileAttributeInfoListPriv *priv = (GFileAttributeInfoListPriv *)list;
GFileAttributeInfo info;
} 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:
* 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;
/**
void g_file_attribute_info_list_add (GFileAttributeInfoList *list,
const char *name,
GFileAttributeType type,
- GFileAttributeFlags flags);
+ GFileAttributeInfoFlags flags);
G_END_DECLS
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
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
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
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;
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;
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);
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;
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;
temp_file = NULL;
- if (flags & G_FILE_CREATE_FLAGS_PRIVATE)
+ if (flags & G_FILE_CREATE_PRIVATE)
mode = 0600;
else
mode = 0666;
const char *message,
const char *default_user,
const char *default_domain,
- GPasswordFlags flags)
+ GAskPasswordFlags flags)
{
return FALSE;
}
* @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.
*/
};
/**
- * 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:
const char *message,
const char *default_user,
const char *default_domain,
- GPasswordFlags flags);
+ GAskPasswordFlags flags);
gboolean (* ask_question) (GMountOperation *op,
const char *message,
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))
/**
* 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;
/**