Commit Graph

56 Commits

Author SHA1 Message Date
Will Thompson
0c5f084200
fileinfo: make UNIX_IS_MOUNTPOINT be TRUE for /
The previously implementation considered a file to be a mountpoint if
its parent is on a different device. / is its own parent, so by this
definition it is not a mountpoint.

But / is (generally) listed in fstab, and fstab(5) defines the
directories it contains to be mountpoints. This attribute should follow
that definition (and reasonable expectation): the root directory is a
mountpoint.

So, add a special-case for the case where the file's parent has the same
st_dev and st_ino as the file, which is true only at the root.

Test this attribute at / (only on POSIX), /proc (but only on Linux), and
at many files and directories created by the test suite (which cannot be
mountpoints).
2018-06-07 06:38:23 +01:00
Sébastien Wilmet
3bf4a720c3 gio/: LGPLv2+ -> LGPLv2.1+
Sub-directories inside gio/ already processed in a previous commit:
- fam/
- gdbus-2.0/ (which contains only codegen/)
- gvdb/
- inotify/
- tests/
- win32/
- xdgmime/

Other sub-directories inside gio/:
- completion/: no license headers
- kqueue/: not LGPL, BSD-style license

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-29 19:53:34 +02:00
Ondrej Holy
006a7d082b fileinfo: Add G_FILE_ATTRIBUTE_RECENT_MODIFIED attribute
Add filesystem attribute to propagate time, when the metadata for the file
in "recent:///" was last changed. This attribute is needed for sorting
recent backend files in client applications.

https://bugzilla.gnome.org/show_bug.cgi?id=777507
2017-02-13 08:12:48 -05:00
Ondrej Holy
453957973b fileinfo: Use monospaced font for uris
Some uris are in quotes, some in backticks, let's unify it.

https://bugzilla.gnome.org/show_bug.cgi?id=777507
2017-02-13 10:26:52 +01:00
Philip Withnall
95afbe1666 gfileinfo: Clarify units in documentation for file attributes
Clarify that the G_FILE_ATTRIBUTE_TIME_* attributes are all in seconds
(apart from the *_USEC ones, which are documented separately).
2017-01-24 12:52:24 +00:00
Philip Withnall
740007c11e gfileinfo: Fix an incorrect unit in the documentation
G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC is in microseconds, not
milliseconds.
2017-01-24 12:51:35 +00:00
Ondrej Holy
e57355b055 fileinfo: Add G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE attribute
Add filesystem attribute to detect remote filesystems in order to
replace hardcoded filesystem types in GtkFileSystem. Set this attribute
also for GLocalFile appropriately.

Bump version to 2.49.3, so that early adopters of new API have a version
number to target.
2016-06-28 10:28:51 +02:00
Debarshi Ray
fa0f51ddf8 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
2015-08-20 18:40:02 +02:00
Xavier Claessens
74c22150cf docs: fix up docs issues in gio/ 2015-02-05 16:20:43 +01:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Ryan Lortie
fe7069749f file-info: Add a G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID attribute
This indicates whether the thumbnail (given by G_FILE_ATTRIBUTE_THUMBNAIL_PATH)
is valid — i.e. to represent the file in its current state. If
G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID is FALSE (for a normal _or_ failed
thumbnail) it means the file has changed since the thumbnail was generated, and
the thumbnail is out of date.

Part of checking thumbnail validity (by the spec) involves parsing
headers out of the thumbnail .png so we include some (small) code to do
that in a separate file.  We will likely want to copy this code to gvfs
to do the same for GVfsFile.

Heavily based on a patch from Philip Withnall <philip.withnall@collabora.co.uk>
who suggested the feature and designed the API.

https://bugzilla.gnome.org/show_bug.cgi?id=709898
2013-10-23 11:56:28 -04:00
Ryan Lortie
0156092a42 various: add GLIB_AVAILABLE_IN_ALL everywhere else
Add the GLIB_AVAILABLE_IN_ALL annotation to all old functions (that
haven't already been annotated with the GLIB_AVAILABLE_IN_* macros or a
deprecation macro).

If we discover in the future that we cannot use only one macro on
Windows, it will be an easy sed patch to fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=688681
2013-01-13 13:11:57 -05:00
Matthias Clasen
e1b99b2ddc Move single-include guards inside include guards
gcc has optimizations for include guards that only work
if they are outermost in the the header.
https://bugzilla.gnome.org/show_bug.cgi?id=689810
2012-12-27 23:43:14 -05:00
Matthias Clasen
65740f62bf Fix suprisingly hard-to-spot typo 2012-11-28 00:58:03 -05:00
Bastien Nocera
7a5dd54f47 fileinfo: Add missing AVAILABLE macro
As forgotten in previous patch.
2012-11-27 17:23:08 +01:00
Bastien Nocera
f635f1fd16 fileinfo: Add _get_deletion_date() helper
For use in gnome-settings-daemon, so that callers don't have
to parse the deletion date by hand.
2012-11-27 16:59:28 +01:00
William Jon McCann
a15a071f35 Add symbolic icon support to gfileinfo
https://bugzilla.gnome.org/show_bug.cgi?id=682101
2012-08-30 11:04:43 -04:00
Torsten Schönfeld
a511a706de gio: Add type macros for GFileAttributeInfoList and GFileAttributeMatcher
https://bugzilla.gnome.org/show_bug.cgi?id=616892
2012-07-08 00:47:01 +02:00
Colin Walters
1cc7162c95 Annotate API introduced for 2.32 with GLIB_AVAILABLE_IN_2_32
https://bugzilla.gnome.org/show_bug.cgi?id=676816
2012-05-26 10:13:30 -04:00
Cosimo Cecchi
1e2ca76464 fileinfo: document the correct type for trash::orig-path
The correct type for this attribute, as set by GVfs, is
G_FILE_ATTRIBUTE_TYPE_BYTE_STRING (which is the correct type for file
paths anyway).

https://bugzilla.gnome.org/show_bug.cgi?id=674074
2012-04-14 13:09:33 -04:00
Matthias Clasen
00c00e2f3f Add G_FILE_ATTRIBUTE_FILESYSTEM_USED to get exact used space
This is implemented by with statfs_buffer.f_bavail (free blocks
for unprivileged users) as a default way to retrieve real free space.
Based on a patch by Marcus Carlson, bug 625751.
2012-01-09 21:49:08 -05:00
Benjamin Otte
1985d54bb2 fileinfo: Add g_file_attribute_matcher_subtract()
Added as public API so I can write tests, the use case is local.
2011-11-16 17:19:02 +01:00
Benjamin Otte
b400127b3e fileinfo: Add g_file_attribute_matcher_to_string()
This is to be mainly used for debugging and tests.
2011-11-16 17:18:13 +01:00
Torsten Schönfeld
f39a49b036 gio: Add a boxed type for GFileAttributeMatcher
https://bugzilla.gnome.org/show_bug.cgi?id=616892
2010-05-03 20:13:35 +02:00
Matthias Clasen
826abbefce Add defines for trash::orig-path and trash::deletion-date
See bug 612107.
2010-03-08 00:36:00 -05:00
Ryan Lortie
f411e23043 GIO: Remove trailing "." from Since: tags in docs
Typing "Since: 2.22." results in the creation of an api-index-2.22..xml
file (ie: the last '.' is taken to be part of the version number).
2010-01-30 14:06:12 -05:00
Tomas Bzatek
e95a3b0576 Documentation fixes 2009-10-13 16:21:42 +02:00
David Zeuthen
99a1c47343 Allow interaction when unmounting mounts
For details, see bug 587482. The new api:

 - Provide new _with_operation() variants of all unmount and eject methods

 - Add GMountOperation::show-processes signal
   - this can be used to show processes blocking an unmount operation

 - Deprecate all unmount and eject methods

 - Add g_drive_can_start_degraded() method
   - this is to avoid auto-starting degraded drives

 - Make g_drive_stop() resp. g_file_stop_mountable() take a GMountOperation
   - these ops were recently added and not yet public API so it's fine
     to change how they work

 - Provide a way to poll mountable files, e.g. g_file_poll_mountable()

 - Add some missing file attributes for mountable files
  - G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE
    - needed for the GDU Nautilus extensions to format a volume
  - G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED:
    - mimics g_drive_can_start_degraded()
  - G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL:
    - mimics g_drive_can_poll_for_media()
  - G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC
    - mimics g_drive_is_media_check_automatic()
2009-07-05 21:59:38 -04:00
Alexander Larsson
9a6146f54c Add g_file_info_set_attribute_status
Required for gvfs implementation for set_attribures_from_info.
2009-06-23 16:35:41 +02:00
Alexander Larsson
becf4186e6 Add g_file_info_has_namespace
Need this to quickly see if we should set attributes from
this GFileInfo in metadata extension.
2009-06-23 16:35:41 +02:00
Alexander Larsson
0ed9201ad2 Add string vector attribute type to GFileInfo
This is needed for the new metadata backend since nautilus has a
string-list metadata type, and we want to use this for nautilus.
2009-06-23 16:35:41 +02:00
David Zeuthen
fae755e056 Bug 585591 – Starting/stopping drives
Add API for starting/stopping drives. This new API will enable
GVolumeMonitor and GVfs implementations to add support for the
following features

 1. Powering down external hard disk enclosures / drives

 2. Starting/stopping multi-disk devices (such as RAID/btrfs/ZFS)

 3. Connecting/disconnecting iSCSI devices

 4. Reacting to the user pressing e.g. the "remove drive" button on
    a IBM/Lenovo Ultrabay: http://www.thinkwiki.org/wiki/Ultrabay

See the bug for the corresponding GVfs and Nautilus changes.
2009-06-15 10:59:43 -04:00
Matthias Clasen
f548330275 Fix "it's" vs "its" confusion throughout the source. Patch by Will
* Fix "it's" vs "its" confusion throughout the source. Patch
        by Will Thompson.


svn path=/trunk/; revision=7897
2009-02-23 04:30:06 +00:00
Ryan Lortie
e8c635841a Bug 505042 – add file attribute for actually used file size in bytes
2009-02-13  Ryan Lortie  <desrt@desrt.ca>

	Bug 505042 – add file attribute for actually used file size in bytes

	* gfileinfo.h: add G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE define to
	"standard::allocated-size"
	* gfileattribute.c: document
	* glocalfileinfo.c: set the allocated size from st_blocks * 512


svn path=/trunk/; revision=7865
2009-02-16 14:22:43 +00:00
Alexander Larsson
17c1241103 Add G_FILE_ATTRIBUTE_PREVIEW_ICON (#557182)
2008-10-21  Alexander Larsson  <alexl@redhat.com>

        * gfileinfo.h:
	Add G_FILE_ATTRIBUTE_PREVIEW_ICON (#557182)


svn path=/trunk/; revision=7619
2008-10-21 13:02:05 +00:00
Michael Natterer
f2a2d6c9ac big header formatting cleanup: indentation, vtable formatting, consistent
2008-09-02  Michael Natterer  <mitch@imendio.com>

	* *.h: big header formatting cleanup: indentation, vtable
	formatting, consistent spacing in (* vfunc), trailing whitespace
	removal. Formatting should be pretty consistent in all GIO headers
	now.


svn path=/trunk/; revision=7433
2008-09-02 19:05:58 +00:00
Cody Russell
3d93bf6968 Moved all relevant typedefs into these files.
2008-07-01  Cody Russell  <bratsche@gnome.org>

        * gio/gioenums.h:
        * gio/giotypes.h:
	Moved all relevant typedefs into these	files.

        * gio/*.[ch]:
	Updated wrt added files.

        Split types into separate file	for easier maintainership. (#538564)


svn path=/trunk/; revision=7127
2008-07-01 06:32:35 +00:00
Michael Natterer
d922bf632a Makefile.am. build with G_DISABLE_SINGLE_INCLUDES to prevent code from
2008-05-05  Michael Natterer  <mitch@imendio.com>

	* Makefile.am. build with G_DISABLE_SINGLE_INCLUDES to prevent
	code from being checked in that breaks the build of applications
	which use G_DISABLE_SINGLE_INCLUDES.

	* makegioalias.pl: make the alias file include "glib.h" instead of
	"glibconfig.h".

	* gio.symbols: whitespace change to force regeneration of the
	alias file after above script change.

	* gfileinfo.h: remove inlcusion of <glib/gfileutils.h>.

	* gfilenamecompleter.c: remove inclusion of "gurifuncs.h".

	* gioerror.h: #include <glib.h> instead of <glib/gerror.h>.

	* glocalfileinfo.c: remove inclusion of <glib/gchecksum>.


svn path=/trunk/; revision=6879
2008-05-05 15:12:13 +00:00
Tor Lillqvist
7332eed6ff Correct milliseconds to microseconds in the doc comments for the *_USEC
2008-03-06  Tor Lillqvist  <tml@novell.com>

	* gfileinfo.h: Correct milliseconds to microseconds in the doc
	comments for the *_USEC attributes.


svn path=/trunk/; revision=6634
2008-03-06 13:10:06 +00:00
Matthias Clasen
f8336c3fa8 Small doc fix
svn path=/trunk/; revision=6560
2008-02-23 05:05:39 +00:00
David Zeuthen
bfda430eff Implement this function by moving bits from glocalfileinfo.c
2008-02-21  David Zeuthen  <davidz@redhat.com>

	* glocalfileinfo.c: (_g_local_file_info_get):
	* gcontenttype.c:
	(g_content_type_get_icon): Implement this function by
	moving bits from glocalfileinfo.c
	(g_content_type_get_description): Unalias before getting
	description (#517687)

	* gfile.c: (g_file_class_init),
	(g_file_query_filesystem_info_async),
	(g_file_query_filesystem_info_finish),
	(query_filesystem_info_data_free),
	(query_filesystem_info_async_thread),
	(g_file_real_query_filesystem_info_async),
	(g_file_real_query_filesystem_info_finish):
	* gfile.h: Implement async version of
	g_file_query_filesystem_info()

	* gfileinfo.h: Add new attributes for filesystem::use-preview

	* gio.symbols: Update

	* gthemedicon.c: (g_themed_icon_append_name):
	* gthemedicon.h: Add new new convenience function.

	* gunionvolumemonitor.c: (g_union_volume_monitor_dispose),
	(get_mounts), (get_volumes), (get_connected_drives),
	(get_volume_for_uuid), (get_mount_for_uuid),
	(g_union_volume_monitor_init), (populate_union_monitor),
	(g_volume_monitor_get), (_g_mount_get_for_mount_path),
	(g_volume_monitor_adopt_orphan_mount):
	* gvolumemonitor.c:
	* gvolumemonitor.h: Use recursive locks so it's safe for volume
	monitor implementations to call into the main volume monitor. Also
	separate object initialization and volume monitor initialization
	such that non-native volume monitors can properly adopt their
	mounts away.


svn path=/trunk/; revision=6550
2008-02-21 12:35:05 +00:00
Ryan Lortie
8cb3db68f0 add G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT
2008-02-13  Ryan Lortie  <desrt@desrt.ca>

        * docs/reference/gio/gio-sections.txt: add
        G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT

2008-02-13  Ryan Lortie  <desrt@desrt.ca>

        * gfileinfo.h: add G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT


svn path=/trunk/; revision=6511
2008-02-13 20:27:18 +00:00
Alexander Larsson
52e49aee35 Added new standard::description attribute. Requested by Vincent, and
2008-02-11  Alexander Larsson  <alexl@redhat.com>

	* gfileinfo.h:
	Added new standard::description attribute.
	Requested by Vincent, and useful for both
	panel and nautilus


svn path=/trunk/; revision=6496
2008-02-11 10:41:00 +00:00
Matthias Clasen
614f47792a Small doc addition
svn path=/trunk/; revision=6249
2008-01-06 08:06:52 +00:00
Matthias Clasen
ff068af417 Documentation additions
svn path=/trunk/; revision=6247
2008-01-06 08:04:39 +00:00
Alexander Larsson
7e6f37d00c Add define for selinux context attribute. Fix missing : -> :: namespace
2008-01-03  Alexander Larsson  <alexl@redhat.com>

        * gfileinfo.h:
        * glocalfileinfo.c:
	Add define for selinux context attribute.
	Fix missing : -> :: namespace separator change
	Fix missing _ -> - name change for xattr-sys.
	(#505058)


svn path=/trunk/; revision=6235
2008-01-03 09:01:00 +00:00
Alexander Larsson
71768c8426 File attribute renames: std:: -> standard:: fs:: -> filesystem:: id::fs ->
2007-12-20  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
        * gfileattribute.c:
        * gfileinfo.c:
        * gfileinfo.h:
        * gfilenamecompleter.c:
        * glocalfile.c:
        * glocalfileinfo.c:
        * gpollfilemonitor.c:
	File attribute renames:
	std:: -> standard::
	fs:: -> filesystem::
	id::fs -> id::filesystem


svn path=/trunk/; revision=6170
2007-12-20 13:30:47 +00:00
Alexander Larsson
f506365079 Move GFileAttributeValue to a private header, as its sort of ugly.
2007-12-14  Alexander Larsson  <alexl@redhat.com>

	* Makefile.am:
        * gfileattribute.[ch]:
        * gfileattribute-priv.h:
	Move GFileAttributeValue to a private header, as
	its sort of ugly.
	
        * gfile.[ch]:
	Make set_attribute take a type + a pointer instead
	of a GFileAttributeValue.
	
        * gfileinfo.[ch]:
	Fix up for above changes.
	Add g_file_info_get_attribute_data to get
	all info in one call, g_file_info_get_attribute_status
	to get the status and g_file_info_get_attribute_as_string.
	
        * gio.symbols:
        * glocalfile.c:
        * glocalfileinfo.[ch]:
	Update for changes
	
        * gunixmounts.c:
	Make _guess_type static.


svn path=/trunk/; revision=6129
2007-12-14 15:56:56 +00:00
Alexander Larsson
ced2927726 Only allow including <gio/gio.h> from apps
2007-12-14  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * fam/Makefile.am:
        * gappinfo.h:
        * gasyncresult.h:
        * gbufferedinputstream.h:
        * gbufferedoutputstream.h:
        * gcancellable.h:
        * gcontenttype.h:
        * gdatainputstream.h:
        * gdataoutputstream.h:
        * gdesktopappinfo.h:
        * gdirectorymonitor.h:
        * gdrive.h:
        * gfile.h:
        * gfileattribute.h:
        * gfileenumerator.h:
        * gfileicon.h:
        * gfileinfo.h:
        * gfileinputstream.h:
        * gfilemonitor.h:
        * gfilenamecompleter.h:
        * gfileoutputstream.h:
        * gfilterinputstream.h:
        * gfilteroutputstream.h:
        * gicon.h:
        * ginputstream.h:
        * gio.h:
        * gioerror.h:
        * giomodule.h:
        * gioscheduler.h:
        * gloadableicon.h:
        * gmemoryinputstream.h:
        * gmemoryoutputstream.h:
        * gmount.h:
        * gmountoperation.h:
        * goutputstream.h:
        * gseekable.h:
        * gsimpleasyncresult.h:
        * gthemedicon.h:
        * gunixinputstream.h:
        * gunixmounts.h:
        * gunixoutputstream.h:
        * gvfs.h:
        * gvolume.h:
        * gvolumemonitor.h:
        * inotify/Makefile.am:
	Only allow including <gio/gio.h> from apps


svn path=/trunk/; revision=6117
2007-12-14 10:35:24 +00:00
Alexander Larsson
1c57670f19 Make attribute namespace separator "::" instead of ":". Use - instead of _
2007-12-12  Alexander Larsson  <alexl@redhat.com>

        * gfileattribute.c:
        * gfileinfo.[ch]:
        * glocalfile.c:
        * glocalfileinfo.c:
	Make attribute namespace separator "::" instead of ":".
	Use - instead of _ as separator in attribute names.


svn path=/trunk/; revision=6104
2007-12-12 15:50:45 +00:00