Emmanuele Bassi [Mon, 14 Oct 2013 18:30:21 +0000 (19:30 +0100)]
gdbus-codegen: Take into consideration MAX_ALLOWED for private data
The G_ADD_PRIVATE() macro, and the auto-generated get_instance_private()
internal function, should be used conditionally depending on the maximum
allowed version of GLib, as defined by the GLIB_VERSION_MAX_ALLOWED
pre-processor symbol.
This allows generating code that can be compiled in projects that wish
to use an older API version of GLib through the use of the
GLIB_VERSION_MAX_ALLOWED symbol.
https://bugzilla.gnome.org/show_bug.cgi?id=710133
Ryan Lortie [Mon, 28 Oct 2013 16:29:15 +0000 (09:29 -0700)]
g_settings_schema_list: some fixes
Prevent a crash in the case that gvdb_table_list() returns NULL (ie:
because a schema has no keys).
Stop a memory leak caused by pointlessly stealing keys from a hashtable
(after we quarked them already).
Stop allocating an extra entry at the end of an array for a terminator
(that we never wrote anyway) when all functions using this API refer to
the out-parameter length array.
https://bugzilla.gnome.org/show_bug.cgi?id=711016
Matthias Clasen [Mon, 28 Oct 2013 16:31:31 +0000 (12:31 -0400)]
Fix handling of icons in GNotification
The fdo backend was sending a uri where a file path
was expected.
Stef Walter [Wed, 28 Nov 2012 21:01:21 +0000 (22:01 +0100)]
Add a request_certificate virtual method to GTlsInteraction
This allows GTlsConnection implementations to request a certificate
from the user.
Fix ups by Dan Winship <danw@gnome.org>
https://bugzilla.gnome.org/show_bug.cgi?id=637257
Matthew Barnes [Mon, 28 Oct 2013 00:26:33 +0000 (17:26 -0700)]
GKeyFileSettingsBackend: ignore file deletions
Ignore the keyfile being deleted (ie: by the user) instead of reporting
it to the application as all values being reverted back to their
originals.
https://bugzilla.gnome.org/show_bug.cgi?id=637956
Christian Persch [Mon, 28 Oct 2013 00:22:38 +0000 (17:22 -0700)]
Add test for extended schemas
The test checks that the keys of the base schema are all present in
the extended schema.
https://bugzilla.gnome.org/show_bug.cgi?id=645453
Ryan Lortie [Mon, 28 Oct 2013 00:18:10 +0000 (17:18 -0700)]
GSettings: properly support 'extends'
Support the 'extends' attribute that has been supported by the compiler
for a long time by doing three things:
- when creating a schema that extends another schema, lookup that other
schema
- when looking up keys and we can't find them in the schema, check
(recursively) in the 'extends' schema
- when listing all keys in a schema, also visit the extends schemas,
but take care to avoid duplicates caused by overrides
Extend the testsuite to verify that it works.
https://bugzilla.gnome.org/show_bug.cgi?id=645453
Ross Lagerwall [Fri, 25 Oct 2013 08:05:02 +0000 (10:05 +0200)]
gio: Fix typo in documentation
https://bugzilla.gnome.org/show_bug.cgi?id=710859
Ryan Lortie [Sun, 27 Oct 2013 02:12:46 +0000 (19:12 -0700)]
Add g_settings_schema_source_list_schemas()
g_settings_list_schemas() and g_settings_list_relocatable_schemas() are
now deprecated.
This will allow listing off schemas on non-default sources and is a
better fit with the new direction the API is going.
https://bugzilla.gnome.org/show_bug.cgi?id=680838
Colin Walters [Sun, 27 Oct 2013 14:34:08 +0000 (10:34 -0400)]
gsubprocess: Add documentation about default input directions
Colin Walters [Sun, 27 Oct 2013 14:21:13 +0000 (10:21 -0400)]
gsubprocess: Fall back to plain F_DUPFD+fcntl for OS X <= Snow Lion
Since it apparently doesn't have F_DUPFD_CLOEXEC.
https://bugzilla.gnome.org/show_bug.cgi?id=710962
Ryan Lortie [Sat, 26 Oct 2013 22:58:06 +0000 (18:58 -0400)]
Add a testcase for summary/description
https://bugzilla.gnome.org/show_bug.cgi?id=668232
Ryan Lortie [Sat, 26 Oct 2013 22:57:55 +0000 (18:57 -0400)]
Add g_settings_schema_key_get_summary/description
Add an API to read the summary and description from the .xml schema
files.
This will be used by dconf-editor and gnome-tweak-tool.
This API is a bit heavy -- it parses the XML and builds a table. It
also loads gettext domains for translation. It only does these things
if it is used, however, so it will not impact normal applications.
We store the summary/description in a pair of hash tables on the schema
source (which we have a backref to as of a few commits ago). We can't
use a global table because people might want to request summary and
description from non-default sources. We don't want to use per-schema
tables because we'd have to reparse the directory every time (since we
cannot guess which file a schema may have been in).
https://bugzilla.gnome.org/show_bug.cgi?id=668232
Ryan Lortie [Sat, 26 Oct 2013 22:57:24 +0000 (18:57 -0400)]
Make GSettingsSchemaKey public
Take this private API and make it public along with a boxed type and
ref/unref functions.
Future commits will add accessors with new functionality and some that
allow us to deprecate functions on GSettings itself (such as
g_settings_get_range).
https://bugzilla.gnome.org/show_bug.cgi?id=668232
Ryan Lortie [Sat, 26 Oct 2013 22:50:39 +0000 (18:50 -0400)]
GSettingsSchema: store a backref to the source
Record in each GSettingsSchema object the source from which it came.
This will be useful in future commits.
https://bugzilla.gnome.org/show_bug.cgi?id=668232
Ryan Lortie [Sat, 26 Oct 2013 22:49:58 +0000 (18:49 -0400)]
Clean up GSettingsSchema logic
The way we created the global schema list predates
g_settings_schema_source_new_from_directory() and therefore doesn't use
it.
Update it to use that function, removing some code.
https://bugzilla.gnome.org/show_bug.cgi?id=668232
Ryan Lortie [Sun, 27 Oct 2013 16:24:40 +0000 (09:24 -0700)]
tests: test g_hash_table_get_keys_as_array()
https://bugzilla.gnome.org/show_bug.cgi?id=710964
Ryan Lortie [Sun, 27 Oct 2013 01:48:42 +0000 (18:48 -0700)]
Add g_hash_table_get_keys_as_array()
Returns a %NULL-terminated array of the keys of a hashtable.
In the case that the hash table has strings for keys, this is actually a
gchar**.
https://bugzilla.gnome.org/show_bug.cgi?id=710964
Giovanni Campagna [Fri, 25 Oct 2013 16:02:16 +0000 (18:02 +0200)]
gapplication: don't emit warnings for DBus calls
If a broken (or malicious) remote client calls Open or CommandLine
on a GApplication that does not implement those, return a DBus
error instead of going through and then emitting a warning.
https://bugzilla.gnome.org/show_bug.cgi?id=710885
Giovanni Campagna [Fri, 25 Oct 2013 16:01:51 +0000 (18:01 +0200)]
gapplication: fix memory leak
g_variant_get_child_value() returns a new GVariant, which we must
free.
https://bugzilla.gnome.org/show_bug.cgi?id=710885
Ryan Lortie [Fri, 25 Oct 2013 16:22:42 +0000 (12:22 -0400)]
win32: use real random data for seed on win32
We can get cryptographically secure data from rand_s().
https://bugzilla.gnome.org/show_bug.cgi?id=710738
Nilamdyuti Goswami [Fri, 25 Oct 2013 07:14:48 +0000 (12:44 +0530)]
Assamese translation updated
Ryan Lortie [Wed, 23 Oct 2013 19:09:07 +0000 (15:09 -0400)]
GLib 2.39.0
Ryan Lortie [Thu, 24 Oct 2013 18:24:04 +0000 (14:24 -0400)]
docs: dist manpage gapplication.xml
Philip Withnall [Thu, 24 Oct 2013 11:09:27 +0000 (12:09 +0100)]
tests: Add tests for the thumbnail verification code in GIO
This code was added for use by the G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID
file attribute, but may end up being used elsewhere (e.g. in GVfs) as well.
As it’s dealing with untrusted external files, and the non-trivial PNG file
format, this commit adds several test cases to cover valid and invalid PNG
files.
The security model for the thumbnail verification code is that the user’s
cache directory is untrusted, and potentially any PNG file which is passed
to the verifier has been manipulated arbitrarily by an attacker.
This is a follow-up to commit
fe7069749fe39a006985ec266260a3c02ee8c855.
https://bugzilla.gnome.org/show_bug.cgi?id=709898
Colin Walters [Thu, 17 Oct 2013 20:57:10 +0000 (16:57 -0400)]
Revert "Use g_return_val_if_fail() for developer-only messages"
This reverts commit
00f0795a84d23f2e2654a86f8bd3a233c8af3771.
https://bugzilla.gnome.org/show_bug.cgi?id=569017
Jiro Matsuzawa [Wed, 28 Aug 2013 16:05:29 +0000 (01:05 +0900)]
gsettings-tool: Add --version into general usage
https://bugzilla.gnome.org/show_bug.cgi?id=707002
Ryan Lortie [Wed, 23 Oct 2013 20:42:12 +0000 (16:42 -0400)]
GSettings: verify path validity on constructors
Don't allow constructing GSettings objects with invalid paths.
https://bugzilla.gnome.org/show_bug.cgi?id=704802
Olivier Brunel [Tue, 8 Oct 2013 14:11:44 +0000 (16:11 +0200)]
gthemedicon: Fallback to non-symbolic icons
When doing fallback for symbolic icons, we first shorten the name at dashes
while preserving the -symbolic suffix. But after exhausting that, we should also
try stripping the suffix.
See https://bugzilla.gnome.org/show_bug.cgi?id=708163
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
https://bugzilla.gnome.org/show_bug.cgi?id=710254
Colin Walters [Wed, 23 Oct 2013 20:41:09 +0000 (16:41 -0400)]
grand: Document this is not for cryptographic purposes
While this is obvious to seasoned experts upon inspection, it is
really worth documenting explicitly.
https://bugzilla.gnome.org/show_bug.cgi?id=710736
Philip Withnall [Wed, 23 Oct 2013 14:45:15 +0000 (15:45 +0100)]
gdbus: Ensure message matching always succeeds against path_namespace='/'
This copies the fix from upstream D-Bus bug
https://bugs.freedesktop.org/show_bug.cgi?id=70799 to the GDBusDaemon
implementation, ensuring that matching against path_namespace='/' succeeds
for all keys (i.e. it’s a no-op).
https://bugzilla.gnome.org/show_bug.cgi?id=710726
Ryan Lortie [Wed, 23 Oct 2013 18:17:48 +0000 (14:17 -0400)]
gtester: only remove source if not already dead
Don't attempt to g_source_remove() a source for which we already returned FALSE
from the handler.
https://bugzilla.gnome.org/show_bug.cgi?id=710724
Ryan Lortie [Wed, 23 Oct 2013 15:10:00 +0000 (11:10 -0400)]
tests: expect critical on failure to remove source
We've added a g_critical() on failure to remove sources, so make sure we
expect to see that (instead of failing the test due to the unexpected
message).
https://bugzilla.gnome.org/show_bug.cgi?id=710724
Ryan Lortie [Wed, 23 Oct 2013 15:04:01 +0000 (11:04 -0400)]
gmain: test g_source_remove() with invalid ID
Make sure we get the proper critical displayed.
https://bugzilla.gnome.org/show_bug.cgi?id=710724
Bastien Nocera [Wed, 23 Oct 2013 13:38:58 +0000 (15:38 +0200)]
gmain: Warn when g_source_remove() fails
Trying to remove a non-existent source should really be
a programming error, as the programmer could be trying to
use the wrong function to remove a callback, as seen when
GtkScrolledWindow tried to remove ID from another function
using g_source_remove().
See https://bugzilla.gnome.org/show_bug.cgi?id=710666#c12
https://bugzilla.gnome.org/show_bug.cgi?id=710724
Ryan Lortie [Fri, 11 Oct 2013 10:22:31 +0000 (11:22 +0100)]
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
Ryan Lortie [Tue, 22 Oct 2013 19:51:15 +0000 (15:51 -0400)]
GMemoryOutputStream: docs and whitespace fixes
Document the difference between resizable and fixed-sized streams,
particularly with regards to sizing and seeking.
https://bugzilla.gnome.org/show_bug.cgi?id=684842
Ryan Lortie [Tue, 22 Oct 2013 20:15:29 +0000 (16:15 -0400)]
GMemoryOutputStream: improve seek tests
Improve test coverage for testing seeking on fixed vs. resizable
GMemoryOutputStream.
https://bugzilla.gnome.org/show_bug.cgi?id=684842
Ryan Lortie [Wed, 23 Oct 2013 15:25:56 +0000 (11:25 -0400)]
Change semantics of seek on memory output stream
It is our intention that memory output streams should operate in two
distinct modes, depending on if a realloc function was provided or not.
In the case that we have a realloc function (resizable mode), we want
the stream to behave as if it were a file that started out empty. In
the case that we don't have a realloc function (fixed-sized mode), we
want the stream to behave as a block device would.
To this end, we introduce two changes in functionality:
- seeking to SEEK_END on a resizable stream will now seek to the end of
the valid data region, not to the end of the allocated memory (which
is really just an implementation detail)
- seeks past the end of the allocated memory size are now permitted,
but only on resizable streams. The next write will grow the buffer
(inserting zeros between).
Some tweaks to testcases were required in order not to break the build,
which indicates that this is an API break, but it seems unlikely that
anyone will be effected by these changes 'in the real world'.
Updates to documentation and further testcases are in following commits.
Based on a patch from Maciej Piechotka <uzytkownik2@gmail.com>.
https://bugzilla.gnome.org/show_bug.cgi?id=684842
Ryan Lortie [Tue, 22 Oct 2013 19:01:16 +0000 (15:01 -0400)]
GSeekable: document seek-past-end semantics
Introduce the concept of "fixed" vs. "resizable" streams and document
how g_seekable_seek() works for each case.
We don't include g_seekable_is_fixed_size() at this point because we
don't know if anyone would require it. This may appear in the future if
someone asks for it, however.
https://bugzilla.gnome.org/show_bug.cgi?id=684842
Philip Withnall [Wed, 23 Oct 2013 14:07:46 +0000 (15:07 +0100)]
gdbus: Work around a D-Bus bug with path_namespace='/' match rules
D-Bus versions < 1.6.18 (i.e. all current versions) have a bug with the
path_namespace='/' match rule key. It should conceptually match everything,
but actually matches nothing. This results in no property change (or other)
signals being forwarded to the D-Bus client.
The work-around implemented in GDBusObjectManagerClient is to remove the
path_namespace match key if its value is ‘/’.
For the upstream D-Bus bug, see:
https://bugs.freedesktop.org/show_bug.cgi?id=70799
https://bugzilla.gnome.org/show_bug.cgi?id=710726
Bastien Nocera [Fri, 18 Oct 2013 12:37:31 +0000 (14:37 +0200)]
g_file_error_from_errno: Remove unneeded breaks
Just wasting space
https://bugzilla.gnome.org/show_bug.cgi?id=710625
Ryan Lortie [Tue, 22 Oct 2013 20:24:41 +0000 (16:24 -0400)]
GKeyfile: don't leak on failed get_(u)int64
In the case that g_key_file_get_(u)int64 fails to parse the integer,
make sure we free the string before returning.
Reported by Andrew Stone <astonecc@gmail.com>
https://bugzilla.gnome.org/show_bug.cgi?id=710313
Dan Winship [Sun, 20 Oct 2013 13:27:11 +0000 (09:27 -0400)]
gobject: simplify object-in-construction handling
Rather than keeping a global list of objects that are being
constructed, use qdata on the object itself like we do with several
other properties now.
https://bugzilla.gnome.org/show_bug.cgi?id=661576
Dan Winship [Mon, 29 Apr 2013 17:04:11 +0000 (13:04 -0400)]
gobject: forbid finalization-during-construction
If a constructor() implementation created an object but then unreffed
it rather than returning it, that object would get left on the
construction_objects list, which would cause problems later when that
memory location got reused by another object.
"Fix" this by making it fail intentionally, and add a test for it (and
for the normal, working singleton case).
https://bugzilla.gnome.org/show_bug.cgi?id=661576
Matthias Clasen [Mon, 21 Oct 2013 22:46:48 +0000 (18:46 -0400)]
Clarify the g_application_withdraw_notification docs
Mention that notifications are dismissed when activated.
Ryan Lortie [Mon, 21 Oct 2013 18:55:52 +0000 (14:55 -0400)]
Don't build gapplication(1) on win32
It's pretty closely tied to desktop files...
Ryan Lortie [Mon, 21 Oct 2013 18:55:21 +0000 (14:55 -0400)]
GSubprocess win32 fixups
Note: we go out of our way not to pass a child setup function on win32
(even if it does nothing) because we get a g_warning() from gspawn if we
do so.
Colin Walters [Mon, 21 Oct 2013 19:05:45 +0000 (15:05 -0400)]
GNotification: Don't install private headers, avoid duplicated prototype
These both break gobject-introspection's build, and moreover are
things we don't want to do anyways.
Ryan Lortie [Sat, 19 Oct 2013 00:40:57 +0000 (20:40 -0400)]
Don't g_test_assert_expected_messages for g_error
Don't allow the user to assert for expected g_error(). They need to use
subprocess for this.
https://bugzilla.gnome.org/show_bug.cgi?id=709615
Ryan Lortie [Mon, 21 Oct 2013 18:29:44 +0000 (14:29 -0400)]
GNotification: finish documentation
Add the missing documentation and add the section to the GIO reference
docs. Fix up a few small documentation issues.
https://bugzilla.gnome.org/show_bug.cgi?id=688492
Ryan Lortie [Mon, 21 Oct 2013 16:54:19 +0000 (12:54 -0400)]
GNotification: some final cleanups
Move a method from GNotificationBackend into the fdo backend (since it
was only used from here). Remove the accessors for the already-public
(in private header) ->dbus_connect and ->application on
GNotificationBackend.
https://bugzilla.gnome.org/show_bug.cgi?id=688492
Lars Uebernickel [Tue, 15 Oct 2013 16:19:09 +0000 (12:19 -0400)]
Add gtk notification backend
https://bugzilla.gnome.org/show_bug.cgi?id=688492
Lars Uebernickel [Tue, 15 Oct 2013 15:21:10 +0000 (11:21 -0400)]
Add GNotification
https://bugzilla.gnome.org/show_bug.cgi?id=688492
Philip Withnall [Mon, 21 Oct 2013 14:09:13 +0000 (15:09 +0100)]
gmessages: Clarify new-line behaviour of message functions
Mention that g_printerr() and friends don’t append a trailing new-line
character to printed messages, but g_log() and friends do.
Djalal Harouni [Sun, 20 Oct 2013 13:15:25 +0000 (14:15 +0100)]
glib-init: fix redundant-decls of g_mem_gc_friendly
Currently g_mem_gc_friendly is declared in both gmem.h and glib-init.h
files, we will have reports on each unit that include these two files.
This patch removes the redundant declaration from glib-init.h
Since g_mem_gc_friendly is related to gmem.h and was first declared in
this header which also exports it via glib.h, then declare it in gmem.h
Other files already include gmem.h: garray.c and gslice.c, no need to
change anything.
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
https://bugzilla.gnome.org/show_bug.cgi?id=710345
Djalal Harouni [Sun, 20 Oct 2013 12:42:09 +0000 (13:42 +0100)]
gmem: remove glib-init.h inclusion
No need to include glib-init.h here. This was added by
commit
47444dacc069be but that commit did not make use of any its
exported symbols, so just remove it.
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
https://bugzilla.gnome.org/show_bug.cgi?id=710345
Enrico Nicoletto [Sat, 19 Oct 2013 15:39:22 +0000 (12:39 -0300)]
Updated Brazilian Portuguese translation
Djalal Harouni [Thu, 17 Oct 2013 01:04:20 +0000 (02:04 +0100)]
gio/gbufferedinputstream: fix redundant-decls of g_buffered_input_stream_finalize()
g_buffered_input_stream_finalize() is already declared as static in this
gbufferedinputstream.c file, so just remove the redundant declaration.
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
https://bugzilla.gnome.org/show_bug.cgi?id=710345
Djalal Harouni [Thu, 17 Oct 2013 00:54:11 +0000 (01:54 +0100)]
gutils: fix redundant-decls of g_init_user_config_dir()
g_init_user_config_dir() is already declared as static in this gutils.c
file, so just remove the redundant declaration.
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
https://bugzilla.gnome.org/show_bug.cgi?id=710345
Djalal Harouni [Wed, 16 Oct 2013 23:54:44 +0000 (00:54 +0100)]
gconvert: fix redundant-decls of _g_charset_get_aliases()
_g_charset_get_aliases() is already declared in gcharsetprivate.h
which was added by commit
4c2a6595889eff44fa, and gconvert.c includes
this gcharsetprivate header, so no need to declare it again.
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
https://bugzilla.gnome.org/show_bug.cgi?id=710345
Dan Winship [Sat, 19 Oct 2013 15:31:06 +0000 (11:31 -0400)]
genviron: fix g_setenv(var, NULL) and some other stuff
Passing a NULL value to g_setenv() was never documented as working,
and in fact it worked on some platforms and crashed on others. Make it
g_return_if_fail() everywhere insted.
Also, remove some incorrect docs in g_environ_getenv() and
g_environ_setenv() that shouldn't have been copied from g_getenv() and
g_setenv(). And belatedly simplify the checks in g_unsetenv().
https://bugzilla.gnome.org/show_bug.cgi?id=704593
Jehan [Sat, 19 Oct 2013 07:59:41 +0000 (20:59 +1300)]
gconvert: Clarify g_locale_to/from_utf8 docs
It was not clear from the doc whether the return value was to be freed
or belonging to glib.
https://bugzilla.gnome.org/show_bug.cgi?id=710496
Ross Lagerwall [Sat, 12 Oct 2013 06:13:18 +0000 (08:13 +0200)]
docs: Remove comment about calling g_type_init()
https://bugzilla.gnome.org/show_bug.cgi?id=709966
Nilamdyuti Goswami [Fri, 18 Oct 2013 13:44:51 +0000 (19:14 +0530)]
Assamese translation updated
Matthias Clasen [Fri, 18 Oct 2013 01:03:18 +0000 (21:03 -0400)]
Include gapplication(1) in the tools section
Matthias Clasen [Fri, 18 Oct 2013 00:55:53 +0000 (20:55 -0400)]
Fix up subprocess docs
The GSubprocessLauncher docs had their own long description,
but were not properly set up as their own section.
Matthias Clasen [Fri, 18 Oct 2013 00:45:32 +0000 (20:45 -0400)]
Fix up gio-sections.txt
Matthias Clasen [Fri, 18 Oct 2013 00:38:15 +0000 (20:38 -0400)]
Generate introspected docs for GSimpleProxyResolver
Matthias Clasen [Fri, 18 Oct 2013 00:37:57 +0000 (20:37 -0400)]
Add some missing argument docs
Matthias Clasen [Fri, 18 Oct 2013 00:16:13 +0000 (20:16 -0400)]
Add index for 2.40 api additions
Colin Walters [Thu, 17 Oct 2013 21:39:48 +0000 (22:39 +0100)]
tests/gsubprocess: Locate test child binary for installed tests too
Just use the new g_test_build_filename() rather than assuming
it's in cwd.
Piotr Drąg [Thu, 17 Oct 2013 19:56:55 +0000 (21:56 +0200)]
Updated POTFILES.in
Ihar Hrachyshka [Fri, 11 Oct 2013 19:54:56 +0000 (23:54 +0400)]
Use g_return_val_if_fail() for developer-only messages
Replaced several usages of GError with g_return_val_if_fail() for
developer-only messages. As additional value, it also removes those
messages from the list to translate, simplifying translator's work a
bit.
https://bugzilla.gnome.org/show_bug.cgi?id=569017
Ryan Lortie [Thu, 17 Oct 2013 19:01:42 +0000 (15:01 -0400)]
Fixup GSubprocess documentation bits
Colin Walters [Tue, 15 Oct 2013 14:04:54 +0000 (15:04 +0100)]
gsubprocess: Add UTF-8 variants of communicate()
Over many years of writing code interacting with subprocesses, a pattern
that comes up a lot is to run a child and get its output as UTF-8, to
put inside a JSON document or render in a GtkTextBuffer, etc.
It's very important to validate at the boundaries, and not say deep
inside Pango.
We could do this a bit more efficiently if done in a streaming fashion,
but realistically this should be OK for now.
Colin Walters [Mon, 14 Oct 2013 23:12:22 +0000 (00:12 +0100)]
gsubprocess: Fix up communicate
We weren't closing the streams after we were done reading or writing,
which is kind of essential. The easy way to fix this is to just use
g_output_stream_splice() to a GMemoryOutputStream rather than
hand-rolling it. This results in a substantial reduction of code
complexity.
A second serious issue is that we were marking the task as complete when
the process exits, but that's racy - there could still be data to read
from stdout. Fix this by just refcounting outstanding operations.
This code, not surprisingly, looks a lot like the "multi" test.
Next, because processes output binary data, I'd be forced to annotate
the char*/length pairs as (array) (element-type uint8). But rather than
doing that, it's *far* simpler to just use GBytes.
We need a version of this that actually validates as UTF-8, that will be
in the next patch.
Colin Walters [Thu, 17 May 2012 18:37:17 +0000 (14:37 -0400)]
GSubprocess: New class for spawning child processes
There are a number of nice things this class brings:
0) Has a race-free termination API on all platforms (on UNIX, calls to
kill() and waitpid() are coordinated as not to cause problems).
1) Operates in terms of G{Input,Output}Stream, not file descriptors
2) Standard GIO-style async API for wait() with cancellation
3) Makes some simple cases easy, like synchronously spawning a
process with an argument list
4) Makes hard cases possible, like asynchronously running a process
with stdout/stderr merged, output directly to a file path
Much rewriting and code review from Ryan Lortie <desrt@desrt.ca>
https://bugzilla.gnome.org/show_bug.cgi?id=672102
Ryan Lortie [Sat, 10 Nov 2012 18:16:29 +0000 (13:16 -0500)]
gspawn: support creating pipes with O_CLOEXEC
Add a new flag, G_SPAWN_CLOEXEC_PIPES, for creating the stdin/out/err
pipes with O_CLOEXEC (for the usual reasons).
Colin Walters [Tue, 22 May 2012 20:06:10 +0000 (16:06 -0400)]
gio: Add private API to create win32 streams from fds
This will be used by GSubprocess.
https://bugzilla.gnome.org/show_bug.cgi?id=672102
Ihar Hrachyshka [Thu, 10 Oct 2013 13:23:00 +0000 (17:23 +0400)]
Removed obsolete makefile rules
Removed test, test-report, full-report, perf-report. They all come from
an old (now obsolete) approach toward glib testing[1]. Now the blessed
ways to test glib are 'make check' and installed tests.
[1]: https://mail.gnome.org/archives/gtk-devel-list/2007-November/msg00000.html
https://bugzilla.gnome.org/show_bug.cgi?id=709995
Jasper St. Pierre [Thu, 17 Oct 2013 17:02:11 +0000 (13:02 -0400)]
gtask: Fix invalid name in documentation
Ryan Lortie [Sun, 14 Jul 2013 23:43:19 +0000 (19:43 -0400)]
New gapplication(1) tool
This is essentially a commandline implementation of the client-side of
the org.freedesktop.Application D-Bus interface.
It includes support for tab-completion based on desktop files and their
contents.
https://bugzilla.gnome.org/show_bug.cgi?id=704218
Ryan Lortie [Thu, 17 Oct 2013 12:22:11 +0000 (08:22 -0400)]
Revert "gapplication: don't rely on cmdline being finalized immediately"
This reverts commit
c5748328bee08e322997cc4703c372f6866a1693.
Cosimo Cecchi [Fri, 13 Sep 2013 18:38:47 +0000 (11:38 -0700)]
gapplication: don't rely on cmdline being finalized immediately
The GApplicationCommandLine DBus implementation currently calls
g_dbus_method_invocation_return_value() in its finalize() implementation
only, relying on the object being destroyed after g_object_unref() is
called on it inside g_application_impl_method_call().
While this is usually fine for C applications, when overriding the
command_line vfunc from language bindings, the binding might add extra
references to the object, which might not be released immediately - e.g.
because they're garbage collected, or possibly even leaked. The same
scenario could happen in a C application that decides to keep a
reference to the passed-in GApplicationCommandLine object.
To ensure the CommandLine DBus method always gets a reply after the
invocation of command_line in the primary instance, explicitly send the
message back before dropping our reference to the object.
https://bugzilla.gnome.org/show_bug.cgi?id=708042
Colin Walters [Wed, 16 Oct 2013 14:10:22 +0000 (10:10 -0400)]
g_file_copy: Fall back to pathname queryinfo to help gvfs backends
It's not difficult to do; not all backends implement it, and for some
it may be difficult to implement query_info_on_read(), so let's just
do both.
https://bugzilla.gnome.org/show_bug.cgi?id=706254
Xavier Claessens [Tue, 15 Oct 2013 15:02:40 +0000 (11:02 -0400)]
Fix wrong function names in g_str_match_string() documentation
Ihar Hrachyshka [Sat, 12 Oct 2013 12:43:16 +0000 (16:43 +0400)]
Updated reference to README.commits
The major useful information regarding commits is now placed in
README.commits, not README.
https://bugzilla.gnome.org/show_bug.cgi?id=709994
Andika Triwidada [Tue, 15 Oct 2013 04:54:59 +0000 (11:54 +0700)]
Updated Indonesian translation
Xavier Claessens [Wed, 9 Oct 2013 18:32:58 +0000 (14:32 -0400)]
Add testcase for search utilities functions
https://bugzilla.gnome.org/show_bug.cgi?id=709753
Ryan Lortie [Mon, 14 Oct 2013 18:37:10 +0000 (14:37 -0400)]
Add simple string "search" function
Add a pair of functions to make it easier to do simple string matching.
This will be useful for use with things like GtkSearchBar and will also
be the basis of the searching done by the (soon to appear)
g_desktop_app_info_search()
https://bugzilla.gnome.org/show_bug.cgi?id=709753
Ryan Lortie [Mon, 14 Oct 2013 18:36:34 +0000 (14:36 -0400)]
Add g_str_is_ascii()
Add a function for checking if a string is pure ASCII.
https://bugzilla.gnome.org/show_bug.cgi?id=709753
Noah Massey [Sun, 13 Oct 2013 14:25:39 +0000 (10:25 -0400)]
gmain: mark newest id used when source id overflows
When the source id reaches G_MAXUINT (just prior to overflow), we
record the existing source ids to prevent reassigning them. As we are
about to assign G_MAXUINT to the triggering source, that id should be
added as well.
https://bugzilla.gnome.org/show_bug.cgi?id=710002
Colin Walters [Tue, 8 Oct 2013 16:17:16 +0000 (12:17 -0400)]
GMemoryOutputStream: Don't return -1 as a gboolean in precondition
Since it could confuse callers (admittedly who are already violating
a precondition).
Just spotted while adapting some bits of this code for a ssh library.
Nilamdyuti Goswami [Mon, 7 Oct 2013 07:26:28 +0000 (12:56 +0530)]
Assamese translation updated
Dan Winship [Fri, 4 Oct 2013 16:58:48 +0000 (12:58 -0400)]
Fix overloading of "source" and "target" terminology in GBinding
GBindingTransformFunc called its arguments "source_value" and
"target_value", but in the transform_from function of a bidirectional
binding, "source_value" comes from the target object, and
"target_value" comes from the source object, which quickly gets
confusing if you need to use g_binding_get_source(), etc, in the
function.
Of course developers can call their transform function arguments
whatever they want, but many will copy from the headers/docs to start
out, so use less confusing names here ("from_value" and "to_value").
Also, fix the documentation to describe the bidirectional case
correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=709440
Kalev Lember [Sat, 21 Sep 2013 11:52:09 +0000 (13:52 +0200)]
xdgmime: Fix an invalid read
This commit factors out a function for comparing string suffixes, and at
the same time makes it safe for mime types that are shorter than the
"/*" suffix.
==25418== Invalid read of size 1
==25418== at 0x3C6D0F9D22: __gio_xdg_cache_mime_type_subclass (xdgmimecache.c:848)
==25418== by 0x3C6D09ED8C: g_content_type_is_a (gcontenttype.c:158)
==25418== by 0x34D8031E95: gtk_recent_filter_filter (gtkrecentfilter.c:733)
==25418== by 0x34D802F167: _gtk_recent_chooser_get_items (gtkrecentchooserutils.c:387)
==25418== by 0x34D802D07F: idle_populate_func (gtkrecentchoosermenu.c:1011)
==25418== by 0x34D7A20477: gdk_threads_dispatch (gdk.c:804)
==25418== by 0x3C6C0492F5: g_main_context_dispatch (gmain.c:3065)
==25418== by 0x3C6C049677: g_main_context_iterate.isra.23 (gmain.c:3712)
==25418== by 0x3C6C04972B: g_main_context_iteration (gmain.c:3773)
==25418== by 0x34D7FC2AF4: gtk_main_iteration (gtkmain.c:1262)
==25418== by 0x408EB4: main (in /usr/bin/glade)
https://bugzilla.gnome.org/show_bug.cgi?id=708529
John Ralls [Fri, 4 Oct 2013 18:45:47 +0000 (11:45 -0700)]
Restore gl_GLIBC21 to configure; needed for libcharset
Ryan Lortie [Thu, 3 Oct 2013 14:02:08 +0000 (10:02 -0400)]
appinfo: Don't try DBusActivatable with load_from_keyfile
We can't get the name of the filename, so we can't determine the application
ID. We'll have to fallback on Exec= for this case.
https://bugzilla.gnome.org/show_bug.cgi?id=709326
Ryan Lortie [Thu, 3 Oct 2013 16:39:53 +0000 (12:39 -0400)]
Add g_key_file_save_to_file()
To write a keyfile to disk.
https://bugzilla.gnome.org/show_bug.cgi?id=309224