[glib/wip/rishi/gfile-google: 2/2] fileinfo: Add a G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE attribute
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/rishi/gfile-google: 2/2] fileinfo: Add a G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE attribute
- Date: Wed, 5 Aug 2015 18:19:18 +0000 (UTC)
commit c6c6d265e4c95c4493ca39241c1ef3b7e18281d6
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Jun 25 10:05:53 2015 +0200
fileinfo: Add a G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE attribute
This is meant for opaque, non-POSIX-like backends to indicate that the
URI is not persistent. Applications should look at
G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET for the persistent URI.
Examples of such backends could be a portal for letting sandboxed
applications access the file-system, or a database-backed storage like
Google Drive.
In these cases, the user visible file and folder names are different
from the real identifiers, used by the backend. So, a request to
create google-drive://user gmail com/foo/New\ File, would actually
lead to google-drive://user gmail com/foo/bar on the server even though
the user visible name is still "New File". Since the server-defined URI
is persistent and sanity-checked by the backend, it is recommended that
applications switch to it as soon as possible. Backends will try to
keep a mapping from "fake" to "real" URIs, but those are only on a
best effort basis. They might not be persistent or have the same
guarantees as the "real" URIs.
https://bugzilla.gnome.org/show_bug.cgi?id=741602
docs/reference/gio/gio-sections.txt | 1 +
gio/gfileinfo-priv.h | 1 +
gio/gfileinfo.c | 1 +
gio/gfileinfo.h | 14 ++++++++++++++
4 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt
index 40678db..057a0c9 100644
--- a/docs/reference/gio/gio-sections.txt
+++ b/docs/reference/gio/gio-sections.txt
@@ -257,6 +257,7 @@ G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN
G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP
G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK
G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL
+G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE
G_FILE_ATTRIBUTE_STANDARD_NAME
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME
diff --git a/gio/gfileinfo-priv.h b/gio/gfileinfo-priv.h
index 8a55d6b..1c1e4a1 100644
--- a/gio/gfileinfo-priv.h
+++ b/gio/gfileinfo-priv.h
@@ -43,6 +43,7 @@
#define G_FILE_ATTRIBUTE_ID_STANDARD_TARGET_URI (1048576 + 17)
#define G_FILE_ATTRIBUTE_ID_STANDARD_SORT_ORDER (1048576 + 18)
#define G_FILE_ATTRIBUTE_ID_STANDARD_SYMBOLIC_ICON (1048576 + 19)
+#define G_FILE_ATTRIBUTE_ID_STANDARD_IS_VOLATILE (1048576 + 20)
#define G_FILE_ATTRIBUTE_ID_ETAG_VALUE (2097152 + 1)
#define G_FILE_ATTRIBUTE_ID_ID_FILE (3145728 + 1)
#define G_FILE_ATTRIBUTE_ID_ID_FILESYSTEM (3145728 + 2)
diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c
index 0cbf988..379850d 100644
--- a/gio/gfileinfo.c
+++ b/gio/gfileinfo.c
@@ -203,6 +203,7 @@ ensure_attribute_hash (void)
REGISTER_ATTRIBUTE (STANDARD_TARGET_URI);
REGISTER_ATTRIBUTE (STANDARD_SORT_ORDER);
REGISTER_ATTRIBUTE (STANDARD_SYMBOLIC_ICON);
+ REGISTER_ATTRIBUTE (STANDARD_IS_VOLATILE);
REGISTER_ATTRIBUTE (ETAG_VALUE);
REGISTER_ATTRIBUTE (ID_FILE);
REGISTER_ATTRIBUTE (ID_FILESYSTEM);
diff --git a/gio/gfileinfo.h b/gio/gfileinfo.h
index 1af56ae..cda63d6 100644
--- a/gio/gfileinfo.h
+++ b/gio/gfileinfo.h
@@ -89,6 +89,20 @@ typedef struct _GFileInfoClass GFileInfoClass;
#define G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL "standard::is-virtual" /* boolean */
/**
+ * G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE:
+ *
+ * A key in the "standard" namespace for checking if a file is
+ * volatile. This is meant for opaque, non-POSIX-like backends to
+ * indicate that the URI is not persistent. Applications should look
+ * at #G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET for the persistent URI.
+ *
+ * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
+ *
+ * Since: 2.46
+ **/
+#define G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE "standard::is-volatile" /* boolean */
+
+/**
* G_FILE_ATTRIBUTE_STANDARD_NAME:
*
* A key in the "standard" namespace for getting the name of the file.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]