Commit Graph

127 Commits

Author SHA1 Message Date
Ondrej Holy
1ec70e713c gio: Fix typo in g_file_info_set_attribute docs
g_file_info_set_attribute mentions %G_ATTRIBUTE_TYPE_INVALID, but no
such value exists. It should be %G_FILE_ATTRIBUTE_TYPE_INVALID.

https://bugzilla.gnome.org/show_bug.cgi?id=796138
2018-05-15 15:54:18 +02: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
Emmanuele Bassi
f952fdf3fc Drop trailing semi-colon from G_DEFINE_ macro
It's unnecessary, and only adds visual noise; we have been fairly
inconsistent in the past, but the semi-colon-less version clearly
dominates in the code base.

https://bugzilla.gnome.org/show_bug.cgi?id=669355
2017-04-10 10:38:31 +01:00
Christian Hergert
18a33f72db introspection: use (nullable) or (optional) instead of (allow-none)
If we have an input parameter (or return value) we need to use (nullable).
However, if it is an (inout) or (out) parameter, (optional) is sufficient.

It looks like (nullable) could be used for everything according to the
Annotation documentation, but (optional) is more specific.
2016-11-22 14:14:37 -08:00
Christoph Reiter
f8189ddf98 gio: Add filename type annotations
https://bugzilla.gnome.org/show_bug.cgi?id=767245
2016-06-04 20:38:42 +02:00
Sébastien Wilmet
95dd373024 docs: better documentation for g_file_info_copy_into()
The documentation of g_file_info_copy_into() was misleading. The
attributes are not just copied, @dest_info is also cleared at the
beginning. So any previously set attributes in @dest_info are lost.

There was a bug in gedit about this function, where some metadata were
not saved. So it might make sense to change the implementation to not
clear @dest_info, and copy one by one the attributes from @src_info to
@dest_info.

https://bugzilla.gnome.org/show_bug.cgi?id=747927
2016-01-28 20:31:53 +01:00
Sébastien Wilmet
a4ed89bf75 docs: improve doc of g_file_info_list_attributes()
The name_space can be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=747927
2016-01-28 18:49:28 +01:00
Philip Withnall
25a7c817d3 glib: Add missing (nullable) and (optional) annotations
Add various (nullable) and (optional) annotations which were missing
from a variety of functions. Also port a couple of existing (allow-none)
annotations in the same files to use (nullable) and (optional) as
appropriate instead.

Secondly, add various (not nullable) annotations as needed by the new
default in gobject-introspection of marking gpointers as (nullable). See
https://bugzilla.gnome.org/show_bug.cgi?id=729660.

This includes adding some stub documentation comments for the
assertion macro error functions, which weren’t previously documented.
The new comments are purely to allow for annotations, and hence are
marked as (skip) to prevent the symbols appearing in the GIR file.

https://bugzilla.gnome.org/show_bug.cgi?id=719966
2015-11-07 10:48:32 +01: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
Sébastien Wilmet
25990eb2b6 docs: various small fixes
For the GPtrArray example, several variables declared on the same line
is harder to read and to work with (to move, remove or comment a single
variable declaration).
2014-09-13 16:59:31 +02:00
Evan Nemerson
570b27b9ac gio: port annotations from the Vala metadata.
https://bugzilla.gnome.org/show_bug.cgi?id=730493
2014-05-23 10:04:06 -07:00
Matthias Clasen
623b58eeac REmove another table 2014-02-08 15:59:24 -05:00
Matthias Clasen
e7fd3de86d Eradicate links and xrefs
These are all replaced by markdown ref links.
2014-02-08 12:26:56 -05:00
Matthias Clasen
42cf80780b Docs: Big entity cleanup
Strip lots of entity use from |[ ]| examples (which are now
implicit CDATA). Also remove many redundant uses of <!-- -->.
2014-02-01 12:00:30 -05:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Ross Lagerwall
3041d0a8db gio: Fix typo in documentation
https://bugzilla.gnome.org/show_bug.cgi?id=710859
2013-10-27 17:15:38 -07: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
Matthias Clasen
65740f62bf Fix suprisingly hard-to-spot typo 2012-11-28 00:58:03 -05: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
Dieter Verfaillie
8e740f726f Fix malformed GTK-Doc comment blocks: add missing colons.
Found these thanks to improved gobject-introspection GTK-Doc
comment block/annotation parser from:
https://bugzilla.gnome.org/show_bug.cgi?id=672254

https://bugzilla.gnome.org/show_bug.cgi?id=673385
2012-04-05 10:23:39 -03:00
David King
3e7f42654f docs: Clarify how to unset a GFileInfo attribute
https://bugzilla.gnome.org/show_bug.cgi?id=592666
2012-02-26 22:22:05 -05:00
David King
07dc3db69a docs: Fix GFileAttribute link in GFileInfo 2012-02-21 01:10:54 +01:00
Evan Nemerson
c3d6595f5a GIO: add lots of annotations for Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=667447
2012-01-11 15:50: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
Benjamin Otte
86d29e4e73 fileinfo: Store namespace::* as 0th attribute
This way, we can get_attribute() namespaces. This will be important in
the next commit.
2011-11-16 17:11:52 +01:00
Benjamin Otte
128e0cb787 fileinfo: Change the way attribute matchers are created
We now sort the matchers and remove unnecessary duplicates (like
removing standard:type when we already match standard:*), so that we can
do more complex operations on them easily in later commits.
2011-11-16 17:11:52 +01:00
Benjamin Otte
1850d23f52 fileinfo: Remove optimization for GFileAttributeMatcher
It makes code more complicated, in particular the code I'm about to add.
2011-11-16 17:11:52 +01:00
Torsten Schönfeld
70eff50f21 Add two annotations to gio
https://bugzilla.gnome.org/show_bug.cgi?id=656679
2011-10-15 18:02:32 -04:00
Matthias Clasen
01f63b19f9 Fix links in gio docs 2011-06-04 18:48:19 -04:00
Matthias Clasen
3e4f3673d8 GFileAttributeMatcher: Improve struct packing 2011-04-12 10:01:05 -04:00
Murray Cumming
c1a75ca783 g_file_info_get/set_attribute_string*(): Document the UTF-8ness.
* gio/gfileattribute.c: (_g_file_attribute_value_get_string,
_g_file_attribute_value_set_string): These use
G_FILE_ATTRIBUTE_TYPE_STRING, which is documented as UTF-8, so
document these private functions as using UTF-8.
* gio/gfileinfo.c: (g_file_info_get_attribute_string,
g_file_info_set_attribute_string, and stringv versions):
Document that the strings are UTF-8 because the implementation uses
those private functions, that use UTF-8.

This helps language bindings (such as glibmm) whose API
distinguishes between known and unknown encodings.
2011-03-11 09:59:09 +01:00
Johan Dahlin
30132c44c1 Add a lot of missing annotations 2010-09-24 18:24:41 -03:00
Christian Persch
71e73ffdfb Use G_DEFINE_[BOXED|POINTER]_TYPE instead of handwritten code
Now that we have convenience macros to implement boxed and pointer
types, use them.
2010-08-18 00:12:28 +02:00
Matthias Clasen
5f1490e94a Fix sparse warnings
These were listed in bug 623955
2010-07-10 17:21:32 -04:00
Ryan Lortie
5b946e0504 gio/: fully remove gioalias hacks 2010-07-07 19:53:22 -04:00
Colin Walters
7c36619d26 [Gio] Merge in introspection annotations from gobject-introspection gio-2.0.c
This is not an exhaustive set, but covers everything we have so far.
2010-06-10 14:03:02 -04: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
Matthias Clasen
eadef0325a Documentation fixes 2009-08-24 13:34:38 -04:00
Matthias Clasen
aa065346d3 Register ids for new file attributes 2009-07-05 22:26:11 -04:00
Benjamin Otte
4b8ad50fc4 add g_file_attribute_set_*_by_id() and use them
This patch and the previous ones fixes the performance issues noted in
Bug 587089 – lookup_attribute() takes too much CPU
It increases performance for querying attributes by ~15% in my tests.
2009-06-29 18:25:02 +02:00
Benjamin Otte
bd198e5e45 export and use _g_file_attribute_matcher_matches_id() 2009-06-29 18:25:02 +02:00
Benjamin Otte
ceba40c27d add private header with attribute ids
attribute ids are generated when the attribute hash is initialized. This
way we can guarantee that the ids match every time.
2009-06-29 18:25:02 +02:00
Benjamin Otte
2620c23577 split lookup_attribute() into two functions 2009-06-29 18:25:02 +02:00
Benjamin Otte
66cebd7292 split attribute hash initialization into its own function 2009-06-29 18:25:01 +02:00
Alexander Larsson
d884e509db Allow setting G_FILE_ATTRIBUTE_TYPE_INVALID attributes in GFileInfo
This is used to unset an attribute in g_file_set_attributes_from_info.
2009-06-25 09:18:01 +02: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
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
3fd881b5bb unref the destination's attribute matcher before overwriting it.
2009-02-17  Ryan Lortie  <desrt@desrt.ca>

        * gfileinfo.c: unref the destination's attribute matcher before
        overwriting it.


svn path=/trunk/; revision=7879
2009-02-17 23:36:13 +00:00
Michael Natterer
b6d834a588 remove dangling 's' in the documentation.
2008-09-12  Michael Natterer  <mitch@imendio.com>

	* gfileinfo.c (g_file_info_get_content_type): remove dangling 's'
	in the documentation.


svn path=/trunk/; revision=7471
2008-09-11 22:05:09 +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
Johan Dahlin
761424465a Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch


svn path=/trunk/; revision=7092
2008-06-22 15:10:51 +00:00
Michael Natterer
a4427bfff5 chain up unconditionally in finalize() and dispose(). Also don't
2008-06-16  Michael Natterer  <mitch@imendio.com>

	* *.c: chain up unconditionally in finalize() and dispose(). Also
	don't dereference these function pointers when calling them since
	that has no meaning at all.


svn path=/trunk/; revision=7048
2008-06-16 09:54:04 +00:00
Matthias Clasen
f3144c7efe Doc fixes
svn path=/trunk/; revision=6554
2008-02-21 18:20:17 +00:00
Alexander Larsson
be85960df7 Correctly handle NULL GAttributeMatcher meaning matches nothing. (Fixes
2008-02-11  Alexander Larsson  <alexl@redhat.com>

        * gfileinfo.c:
        (g_file_info_set_attribute_mask):
        (g_file_attribute_matcher_matches_id):
	Correctly handle NULL GAttributeMatcher meaning
	matches nothing. (Fixes #513492)


svn path=/trunk/; revision=6498
2008-02-11 12:21:49 +00:00
Michael Natterer
2b02891ef7 replace "icon && G_IS_ICON (icon)" by simply "G_IS_ICON (icon)".
2008-02-06  Michael Natterer  <mitch@imendio.com>

	* gfileinfo.c (g_file_info_get_icon): replace
	"icon && G_IS_ICON (icon)" by simply "G_IS_ICON (icon)".


svn path=/trunk/; revision=6463
2008-02-06 13:22:57 +00:00
Murray Cumming
30d6124e8a GFileInfo description: Mention how to actually set attributes in a GFile
2008-01-10  Murray Cumming  <murrayc@murrayc.com>

        * gfileinfo.c: GFileInfo description: Mention 
        how to actually set attributes in a GFile and how to discover 
        which attributes are settable. Bug #508378.

svn path=/trunk/; revision=6293
2008-01-11 14:15:07 +00:00
Alexander Larsson
491cccf63a Handle NULL attribute matchers safely, as we return this for empty
2008-01-03  Alexander Larsson  <alexl@redhat.com>

        * gfileinfo.c:
	Handle NULL attribute matchers safely, as we return this
	for empty attribute matcher strings.



svn path=/trunk/; revision=6238
2008-01-03 14:58:53 +00:00
Matthias Clasen
227ef243b1 Doc additions
svn path=/trunk/; revision=6220
2007-12-31 04:45:19 +00:00
Matthias Clasen
38fa4bacd3 Documentation updates
svn path=/trunk/; revision=6209
2007-12-30 05:10:23 +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
Matthias Clasen
0debd52858 Fix up includes in section docs
svn path=/trunk/; revision=6149
2007-12-18 02:52:11 +00:00
Matthias Clasen
2e3f48993d Documentation updates
svn path=/trunk/; revision=6138
2007-12-17 07:04:51 +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
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
Matthias Clasen
c524cabff2 Add docs for etags
svn path=/trunk/; revision=6001
2007-11-30 18:11:03 +00:00
Matthias Clasen
a2ca589703 More coding style fixes
svn path=/trunk/; revision=5999
2007-11-30 05:11:25 +00:00
Matthias Clasen
09471fec46 Coding style fixups
svn path=/trunk/; revision=5993
2007-11-29 07:17:59 +00:00
Alexander Larsson
7f3280230b Added. Added. Added. Added.
2007-11-28  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * abicheck.sh: Added.
        * makegioalias.pl: Added.
        * pltcheck.sh: Added.
        * gio.symbols: Added.
	* *.c:
        * inotify/*.c
	Initial work on adding symbol handling.

	* gvfs.h:
	Correct ifdef guard name

        * fam/Makefile.am:
        * inotify/Makefile.am:
        * xdgmime/Makefile.am:
	Include toplevel Makefile.decl


svn path=/trunk/; revision=5972
2007-11-28 12:39:07 +00:00
Matthias Clasen
61582bd91c Another round of trivial doc fixes
svn path=/trunk/; revision=5970
2007-11-28 06:43:33 +00:00
Alexander Larsson
68c74ba68f Move g_format_file_size_for_display from gio to glib
2007-11-27  Alexander Larsson  <alexl@redhat.com>

        * gio/gfileinfo.[ch]:
        * glib/gfileutils.[ch]:
        Move g_format_file_size_for_display from gio to glib


svn path=/trunk/; revision=5954
2007-11-27 14:30:31 +00:00
Andrew Walton
5247f12f36 Bumps documentation to 93% symbol coverage, touching most
of the public files. Fixes broken function documentation prototypes. 
	Fixes GCancellable inaccuracies. Removes unnecessary incomplete 
	gtk-doc headers in private files.

svn path=/trunk/; revision=5953
2007-11-27 14:00:13 +00:00
Alexander Larsson
3781343738 gio/ docs/reference/gio Merged gio-standalone into glib.
2007-11-26  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * configure.in:
        * gio-2.0-uninstalled.pc.in:
        * gio-2.0.pc.in: 
        * gio-unix-2.0-uninstalled.pc.in:
        * gio-unix-2.0.pc.in:
	* gio/
	* docs/reference/gio
	Merged gio-standalone into glib.
	
        * glib/glibintl.h:
        * glib/gutils.c:
	Export glib_gettext so that gio can use it
	Add P_ (using same domain for now)
	Add I_ as g_intern_static_string


svn path=/trunk/; revision=5941
2007-11-26 16:13:05 +00:00