platform/upstream/glib.git
9 years agogresolver.c: Windows: Fix IPv6 Address Handling
Chun-wei Fan [Mon, 19 Jan 2015 03:03:57 +0000 (11:03 +0800)]
gresolver.c: Windows: Fix IPv6 Address Handling

Check the IPv6 addresses on Windows, as we need to reject those that have
brackets/ports around them as valid addresses in this form would have been
accepted during the call to g_inet_address_new_from_string ().

https://bugzilla.gnome.org/show_bug.cgi?id=730352

9 years agogio: add some missing autocleanup
Marc-Antoine Perennou [Wed, 4 Mar 2015 10:46:46 +0000 (11:46 +0100)]
gio: add some missing autocleanup

https://bugzilla.gnome.org/show_bug.cgi?id=745589

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
9 years agoMSVC Builds: Few More Enahncements
Chun-wei Fan [Wed, 4 Mar 2015 12:11:43 +0000 (20:11 +0800)]
MSVC Builds: Few More Enahncements

Update the .pdb file generation for the MSVC 2010+ DLLs (and the x64 gspawn
helper programs), so that they match the names of the DLLs/EXEs that are
built.  Also update the .lib generation so that all will use -$(ApiVersion)
from the property sheets instead of the -2.0 which was previously hard
coded (as we will eventually move into GLib 3.x in the future, for example)

9 years agogobject: Mark a helper variable as const
Philip Withnall [Wed, 4 Mar 2015 08:52:22 +0000 (08:52 +0000)]
gobject: Mark a helper variable as const

It’s only used for argv values, which are not modified here.

https://bugzilla.gnome.org/show_bug.cgi?id=614684

9 years agogerror: Minor clarifications to the GError documentation
Philip Withnall [Fri, 19 Dec 2014 18:21:30 +0000 (18:21 +0000)]
gerror: Minor clarifications to the GError documentation

 • Clarify that GError** parameters are for the return of _newly
   allocated_ GError*s.
 • Clarify that errors may need to be checked for explicitly if the
   return value of a function doesn’t reliably indicate them.

https://bugzilla.gnome.org/show_bug.cgi?id=741779

9 years agoUpdated Serbian translation
Мирослав Николић [Tue, 3 Mar 2015 19:05:47 +0000 (20:05 +0100)]
Updated Serbian translation

9 years agogvariant: Use ‘UTF-8’ in docs rather than ‘utf8’
Philip Withnall [Fri, 19 Dec 2014 17:08:59 +0000 (17:08 +0000)]
gvariant: Use ‘UTF-8’ in docs rather than ‘utf8’

Nitpicky correction.

https://bugzilla.gnome.org/show_bug.cgi?id=741779

9 years agogmain: Explicitly document the threading behaviour of g_timeout_add()
Philip Withnall [Fri, 19 Dec 2014 15:33:59 +0000 (15:33 +0000)]
gmain: Explicitly document the threading behaviour of g_timeout_add()

i.e. That calling g_timeout_add() from a thread other than the main one
probably doesn’t do what you want. Same for g_idle_add() and the
*_full() variants.

https://bugzilla.gnome.org/show_bug.cgi?id=741779

9 years agogobject: Mention g_clear_object() in g_object_unref() documentation
Philip Withnall [Fri, 19 Dec 2014 19:02:15 +0000 (19:02 +0000)]
gobject: Mention g_clear_object() in g_object_unref() documentation

https://bugzilla.gnome.org/show_bug.cgi?id=741779

9 years agogmem: Clarify that a NULL check is not needed before calling g_free()
Philip Withnall [Fri, 19 Dec 2014 19:01:06 +0000 (19:01 +0000)]
gmem: Clarify that a NULL check is not needed before calling g_free()

It was documented before, but wasn’t especially clear. Doing
    if (X)
        g_free (X);
is apparently quite a pervasive real-world anti-pattern, so perhaps it
could be documented more explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=741779

9 years agoglist: Clarify that g_list_nth() is expensive
Philip Withnall [Fri, 19 Dec 2014 18:53:54 +0000 (18:53 +0000)]
glist: Clarify that g_list_nth() is expensive

Just in case people have forgotten their basic algorithms course. Seen
in some pretty terrible code in the wild; hopefully mentioning the cost
in the documentation will make people think twice about using a counter
variable when iterating over a linked list.

https://bugzilla.gnome.org/show_bug.cgi?id=741779

9 years agoglist: Clarify how g_list_free_1() handles links
Philip Withnall [Fri, 19 Dec 2014 18:53:22 +0000 (18:53 +0000)]
glist: Clarify how g_list_free_1() handles links

It doesn’t, which is fine, but could be unexpected if undocumented.

https://bugzilla.gnome.org/show_bug.cgi?id=741779

9 years agoghash: Document that g_hash_get_[keys|values]() are expensive
Philip Withnall [Fri, 19 Dec 2014 18:52:32 +0000 (18:52 +0000)]
ghash: Document that g_hash_get_[keys|values]() are expensive

And definitely not the right way to iterate over a hash table (as seen
in code in the wild).

https://bugzilla.gnome.org/show_bug.cgi?id=741779

9 years agogparamspecs: Recommend use of most specific GParamSpec types
Philip Withnall [Thu, 18 Dec 2014 11:23:05 +0000 (11:23 +0000)]
gparamspecs: Recommend use of most specific GParamSpec types

It’s quite common to see a g_param_spec_pointer() used for GObject or
boxed types which, while not incorrect, does make memory management
unsafe, since no copying or reference counting can be performed
automatically.

Similarly, people often use g_param_spec_boolean() when an enum would be
more appropriate, cf.
    http://blog.ometer.com/2011/01/20/boolean-parameters-are-wrong/
Using enums also means that the set of allowable values can be extended
in future if needed.

In the hope that people who write code like that read the documentation,
mention the more specific types in the documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=741779

9 years agodocs: Expand introduction to mention using async calls over sync ones
Philip Withnall [Wed, 18 Feb 2015 17:01:18 +0000 (17:01 +0000)]
docs: Expand introduction to mention using async calls over sync ones

As discussed on the mailing list (see the whole thread):
    https://mail.gnome.org/archives/desktop-devel-list/2015-February/msg00126.html

Expand the GIO documentation introduction to talk a little about when to
use async and sync functions, and how the former should almost always be
preferred over the latter.

Link to this from the GFile documentation, which is an entry point for a
lot of async calls.

https://bugzilla.gnome.org/show_bug.cgi?id=744722

9 years agogstring: Mark the return value from g_string_free() as nullable
Philip Withnall [Wed, 14 Jan 2015 10:44:52 +0000 (10:44 +0000)]
gstring: Mark the return value from g_string_free() as nullable

It’s NULL iff free_segment is TRUE, so the annotation doesn’t quite
capture all the function definition, but is a safe over-estimate of the
return value’s nullability.

https://bugzilla.gnome.org/show_bug.cgi?id=719966

9 years agogfileutils: Mark the return value from g_path_skip_root() as nullable
Philip Withnall [Fri, 20 Jun 2014 20:20:36 +0000 (21:20 +0100)]
gfileutils: Mark the return value from g_path_skip_root() as nullable

It returns NULL for non-absolute paths.

https://bugzilla.gnome.org/show_bug.cgi?id=719966

9 years agodocs: Remove redundant header examples from GObject tutorial
Philip Withnall [Wed, 18 Feb 2015 17:58:32 +0000 (17:58 +0000)]
docs: Remove redundant header examples from GObject tutorial

These are in the header boilerplate section, but are actually source
boilerplate which is covered in later sections.

https://bugzilla.gnome.org/show_bug.cgi?id=744060

9 years agodocs: Change tutorial encodings from ISO-8859-1 to UTF-8
Philip Withnall [Fri, 20 Feb 2015 14:29:43 +0000 (14:29 +0000)]
docs: Change tutorial encodings from ISO-8859-1 to UTF-8

ISO-8859-1 — that’s a blast from the past.

https://bugzilla.gnome.org/show_bug.cgi?id=744060

9 years agoVisual Studio Builds: "Install" .pdb files
Chun-wei Fan [Tue, 3 Mar 2015 11:21:40 +0000 (19:21 +0800)]
Visual Studio Builds: "Install" .pdb files

They are helpful in debugging in a stack.

9 years agoMSVC Builds: GIO: Standardize zlib Linking
Chun-wei Fan [Tue, 3 Mar 2015 10:24:08 +0000 (18:24 +0800)]
MSVC Builds: GIO: Standardize zlib Linking

Link to zlib1.lib for all builds, as:
-The notion of zlib1d.lib is rather not standardized across the board for
 most cases.
-Easier for the grand all-in-one solution file.

9 years agoVisual Studio 2008 Builds: Speed Up Release Builds
Chun-wei Fan [Tue, 3 Mar 2015 10:09:42 +0000 (18:09 +0800)]
Visual Studio 2008 Builds: Speed Up Release Builds

Use the /MP option so that each project can build multiple sources in
parallel, which can cut down release build times by quite a bit.  This will
cause a brief warning for debug builds due to their use of /Gm, and builds
would otherwise proceed as they did before.

Unfortunately Visual Studio 2008 is too old to support the /d2Zi+ flag, so
we can't make a better debug situation for it at the moment.

9 years agoMSVC Builds: Improve Build Speed and Debugging
Chun-wei Fan [Tue, 3 Mar 2015 05:52:22 +0000 (13:52 +0800)]
MSVC Builds: Improve Build Speed and Debugging

Use Multiprocessor compilation which can cut down build times by quite a
bit and use the /d2Zi+ flag to have better debugging info being logged to
the .pdb for release builds.

These are only applicable for Visual Studio 2010/2012 and later.

9 years agoMSVC Builds: Fix and Update "Installation"
Chun-wei Fan [Tue, 3 Mar 2015 04:05:50 +0000 (12:05 +0800)]
MSVC Builds: Fix and Update "Installation"

The gobjectnotifyqueue.c was accidently dropped from the files to copy, and
a new public header for GIO was added, so address these parts.

9 years agoUpdated Czech translation
Marek Černocký [Mon, 2 Mar 2015 20:52:32 +0000 (21:52 +0100)]
Updated Czech translation

9 years agoGContextSpecificGroup: fix deadlock
Ryan Lortie [Thu, 12 Feb 2015 17:18:22 +0000 (12:18 -0500)]
GContextSpecificGroup: fix deadlock

There was a theoretical deadlock between the worker trying to emit a
signal at the same time as we were waiting for it to shutdown the
notification (while holding the lock).

The deadlock was particularly annoying because we didn't really need to
wait for the shutdown and because it wasn't possible to signals to
arrive while waiting for a start.  Attempting to deal with start and
stop in an asymmetric way could have lead to other weird situations,
however.

Drop the lock while waiting for the worker thread to start.  This means
that we face the possibility of multiple waiters on the cond at the same
time, so we need to make more of a state machine.

https://bugzilla.gnome.org/show_bug.cgi?id=742599

9 years agotests: add some tests for GContextSpecificGroup
Ryan Lortie [Sun, 25 Jan 2015 15:16:50 +0000 (15:16 +0000)]
tests: add some tests for GContextSpecificGroup

https://bugzilla.gnome.org/show_bug.cgi?id=742599

9 years agoMake GUnixMountMonitor per-context
Ryan Lortie [Thu, 8 Jan 2015 06:35:33 +0000 (01:35 -0500)]
Make GUnixMountMonitor per-context

GUnixMountMonitor was not threadsafe before.  It was a global singleton
which emitted signals in the first thread that happened to construct it.

Move it to a per-context singleton model where each GMainContext gets
its own GUnixMountMonitor.  Monitor for the changes from the GLib worker
thread and dispatch the results to each context with an active monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=742599

9 years agogunixmounts: move GUnixMountMonitor code
Ryan Lortie [Thu, 8 Jan 2015 04:52:53 +0000 (23:52 -0500)]
gunixmounts: move GUnixMountMonitor code

Move this code to the correct part of the file.

While we're at it, drop an unused #define MOUNT_POLL_INTERVAL.

https://bugzilla.gnome.org/show_bug.cgi?id=742599

9 years agogunixmounts.c: add fold markers
Ryan Lortie [Thu, 8 Jan 2015 04:49:47 +0000 (23:49 -0500)]
gunixmounts.c: add fold markers

This is a large file with a lot of very complicated code in it.  Add
some fold markers to make things a bit more manageable.

https://bugzilla.gnome.org/show_bug.cgi?id=742599

9 years agoDeprecate g_unix_mount_monitor_set_rate_limit()
Ryan Lortie [Thu, 8 Jan 2015 07:16:50 +0000 (02:16 -0500)]
Deprecate g_unix_mount_monitor_set_rate_limit()

Deprecate g_unix_mount_monitor_set_rate_limit() and turn it into a
no-op.

This function doesn't behave as advertised.  It only controls rate
limiting for filesystem-based monitors.  It has no impact over reporting
mount changes on Linux, for example, because those are based on polling
for changes in /proc (which doesn't use filesystem monitors).  It also
has no impact on Mac OS because a library interface is used there.

This was added in https://bugzilla.gnome.org/show_bug.cgi?id=521946 in
order to be used by HAL, which is effectively dead.  udisks no longer
uses this code at all.

https://bugzilla.gnome.org/show_bug.cgi?id=742599

9 years agoRename g_unix_mount_monitor_new() to _get()
Ryan Lortie [Thu, 8 Jan 2015 07:03:18 +0000 (02:03 -0500)]
Rename g_unix_mount_monitor_new() to _get()

This is a singleton, but we have a function called _new() to get it.
What's worse is that the documentation makes no mention of this, and
actually specifically says that a new monitor will be created each time.

https://bugzilla.gnome.org/show_bug.cgi?id=742599

9 years agoGAppInfoMonitor: port to GContextSpecificGroup
Ryan Lortie [Thu, 8 Jan 2015 07:36:26 +0000 (02:36 -0500)]
GAppInfoMonitor: port to GContextSpecificGroup

https://bugzilla.gnome.org/show_bug.cgi?id=742599

9 years agoAdd internal helper GContextSpecificGroup
Ryan Lortie [Thu, 8 Jan 2015 04:09:30 +0000 (23:09 -0500)]
Add internal helper GContextSpecificGroup

Add a new internal helper called GContextSpecificGroup.

This is a mechanism for helping to maintain a group of context-specific
monitor objects (eg: GAppInfoMonitor, GUnixMountMonitor).

https://bugzilla.gnome.org/show_bug.cgi?id=742599

9 years agoUpdated Polish translation
Piotr Drąg [Mon, 2 Mar 2015 19:26:45 +0000 (20:26 +0100)]
Updated Polish translation

9 years agoGLib 2.43.91 2.43.91
Ryan Lortie [Mon, 2 Mar 2015 16:54:48 +0000 (11:54 -0500)]
GLib 2.43.91

9 years agoGApplication: don't iterate further on _quit()
Ryan Lortie [Fri, 27 Feb 2015 12:50:28 +0000 (07:50 -0500)]
GApplication: don't iterate further on _quit()

If someone explicitly calls g_application_quit() then don't attempt to
drain the mainloop of remaining sources.

This allows applications with 100% CPU utilisation to quit reliably.

https://bugzilla.gnome.org/show_bug.cgi?id=744876

9 years agogio: Add some missing type annotations to object arguments
Rico Tzschichholz [Sun, 1 Mar 2015 17:12:09 +0000 (18:12 +0100)]
gio: Add some missing type annotations to object arguments

Similar to https://bugzilla.gnome.org/show_bug.cgi?id=745239

9 years agotests: only chmod autorun.exe on UNIX
Ryan Lortie [Sun, 1 Mar 2015 05:47:17 +0000 (00:47 -0500)]
tests: only chmod autorun.exe on UNIX

We install win32-software/autorun.exe (as test data for mime scanning)
only on UNIX builds, so don't attempt to chmod it on 'make install'
unless we're on UNIX.

9 years agoUpdated Lithuanian translation
Aurimas Černius [Sat, 28 Feb 2015 19:25:35 +0000 (21:25 +0200)]
Updated Lithuanian translation

9 years agoUpdated Slovak translation
Dušan Kazik [Sat, 28 Feb 2015 12:53:36 +0000 (12:53 +0000)]
Updated Slovak translation

9 years agomake *_get_instance_private const-compliant
Marc-Antoine Perennou [Sat, 9 Nov 2013 03:09:20 +0000 (12:09 +0900)]
make *_get_instance_private const-compliant

This is pure read-only access to an external struct
so void warnings for people calling it from const
contexts such as accessors

https://bugzilla.gnome.org/show_bug.cgi?id=745068

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
9 years agoG_DECLARE_*: be const-compliant
Marc-Antoine Perennou [Tue, 24 Feb 2015 08:17:33 +0000 (09:17 +0100)]
G_DECLARE_*: be const-compliant

switching to the old macros boilerplate to G_DECLARE_*
a lot of warnings start to pop when *_IS_A_* or such are
called from a const context.
Fix this by taking const pointers as parameters

https://bugzilla.gnome.org/show_bug.cgi?id=745068

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
9 years agoGPropertyAction: add type annotation to constructor's object argument
Evan Nemerson [Thu, 26 Feb 2015 18:17:59 +0000 (10:17 -0800)]
GPropertyAction: add type annotation to constructor's object argument

https://bugzilla.gnome.org/show_bug.cgi?id=745239

9 years agogobject.h: Use correct format specifier for __LINE__
David King [Mon, 9 Feb 2015 11:23:58 +0000 (11:23 +0000)]
gobject.h: Use correct format specifier for __LINE__

GCC 5.0, with its new -Wformat-signedness, warns about the sign being
different between a type and the format string in printf-format
messages, leading to compiler warnings with G_OBJECT_WARN_INVALID_PSPEC.
In other uses of __LINE__ inside GLib, %d is used, and GCC seems to
expect a format specifier of %d as well:
https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html

https://bugzilla.gnome.org/show_bug.cgi?id=744263

9 years agogcancellable: Mention nullability in g_cancellable_cancel() docs
Philip Withnall [Tue, 24 Feb 2015 10:57:14 +0000 (10:57 +0000)]
gcancellable: Mention nullability in g_cancellable_cancel() docs

Calling g_cancellable_cancel(NULL) is an explicitly allowed no-op, for
convenience. Document and annotate that.

9 years agoUpdated French translation
Alexandre Franke [Tue, 24 Feb 2015 00:42:43 +0000 (00:42 +0000)]
Updated French translation

9 years agotests: Add many autoptr tests
Colin Walters [Mon, 23 Feb 2015 13:32:36 +0000 (08:32 -0500)]
tests: Add many autoptr tests

I love Emacs keyboard macros, used them to convert the list of
defines cleverly into a list of tests, then iterated and filled in
the necessary constructor arguments.

9 years agoautocleanups: Remove g_autoptr(gchar)
Colin Walters [Mon, 23 Feb 2015 12:56:34 +0000 (07:56 -0500)]
autocleanups: Remove g_autoptr(gchar)

- It's not sufficient, there are other bare array types
  like guint8, gdouble, etc.

- Other types like GVariant* always come as pointers, whereas
  there's a rather fundamental distinction between "gchar" and
  "gchar*" that has been signified to C programmers for 30+ years via
  the '*' character, and we're hiding that.

https://bugzilla.gnome.org/show_bug.cgi?id=744747

9 years agoAdd g_autofree
Colin Walters [Sun, 15 Feb 2015 13:58:44 +0000 (08:58 -0500)]
Add g_autofree

The g_autoptr() being associated with the type name works out really
well for things like GHashTable.  However, it's a bit more awkward to
associate with "gchar".  Also because one can't use "char".
Similarly, there are a lot of other "bare primitive array" types that
one might reasonably use.

This patch does not remove the autoptr for "gchar", even though I
think it's rather awkward and strange.

Also while we're here, add a test case for the cleanup bits.

https://bugzilla.gnome.org/show_bug.cgi?id=744747

9 years agoGApplication: let the main loop drain on shutdown
Ryan Lortie [Sat, 21 Feb 2015 15:24:23 +0000 (10:24 -0500)]
GApplication: let the main loop drain on shutdown

After ::shutdown, run the mainloop until all pending activity is
handled, before returning from run().

Among other things, this gives a chance for destroyed windows to be
properly withdrawn from the windowing system.

https://bugzilla.gnome.org/show_bug.cgi?id=744876

9 years agoUpdated Chinese (Taiwan) translation
Chao-Hsiung Liao [Sat, 21 Feb 2015 11:09:48 +0000 (11:09 +0000)]
Updated Chinese (Taiwan) translation

9 years agogobject: Add missing autocleanup for GInitiallyUnowned
Emmanuele Bassi [Fri, 20 Feb 2015 19:54:07 +0000 (19:54 +0000)]
gobject: Add missing autocleanup for GInitiallyUnowned

We are missing the auto cleanup function for this type, which means
G_DECLARE_* macros won't work with classes inheriting from
GInitiallyUnowned.

9 years agogfileenumerator: Convert docbook tag -> markdown
Colin Walters [Fri, 20 Feb 2015 19:35:59 +0000 (14:35 -0500)]
gfileenumerator: Convert docbook tag -> markdown

This code predated the markdown conversion.  Pointed out by mclasen.

9 years agofilenumerator: Add g_file_enumerator_iterate()
Colin Walters [Thu, 12 Feb 2015 23:20:14 +0000 (18:20 -0500)]
filenumerator: Add g_file_enumerator_iterate()

This is *significantly* more pleasant to use from C (while handling
errors and memory cleanup).

While we're here, change some ugly, leaky code in
tests/desktop-app-info.c to use it, in addition to a test case
in tests/file.c.

https://bugzilla.gnome.org/show_bug.cgi?id=661554

9 years agoautocleanups: Add G*Array types
Colin Walters [Thu, 19 Feb 2015 23:31:29 +0000 (18:31 -0500)]
autocleanups: Add G*Array types

Not sure how these were omitted.  Probably few people are really using
this yet...and we don't have test cases (that's in the other patch).

https://bugzilla.gnome.org/show_bug.cgi?id=744830

9 years agogliststore: Add missing parameter documentation
Philip Withnall [Thu, 19 Feb 2015 14:03:43 +0000 (14:03 +0000)]
gliststore: Add missing parameter documentation

9 years agoUpdated Galician translations
Fran Dieguez [Thu, 19 Feb 2015 10:00:05 +0000 (11:00 +0100)]
Updated Galician translations

9 years agogapplication: test setting and binding busy state
Lars Uebernickel [Wed, 18 Feb 2015 23:41:42 +0000 (00:41 +0100)]
gapplication: test setting and binding busy state

https://bugzilla.gnome.org/show_bug.cgi?id=744756

9 years agogapplication: add "is-busy"
Lars Uebernickel [Wed, 18 Feb 2015 23:33:01 +0000 (00:33 +0100)]
gapplication: add "is-busy"

A property to query the current busy state of an application.

https://bugzilla.gnome.org/show_bug.cgi?id=744756

9 years agogapplication: stop using deprecated API
Ryan Lortie [Wed, 18 Feb 2015 21:45:59 +0000 (16:45 -0500)]
gapplication: stop using deprecated API

More fallout from the GOptionGroup binding patch.

9 years agogapplication: tune busy-binding
Lars Uebernickel [Tue, 17 Feb 2015 07:39:05 +0000 (08:39 +0100)]
gapplication: tune busy-binding

g_application_bind_busy_property() had the restriction that only one
property can be bound per object, so that NULL could be used to unbind.
Even though this is enough for most uses, it is a weird API.

Lift that restriction and add an explicit unbind function.

https://bugzilla.gnome.org/show_bug.cgi?id=744565

9 years agoGLib 2.43.90 2.43.90
Ryan Lortie [Wed, 18 Feb 2015 16:03:03 +0000 (11:03 -0500)]
GLib 2.43.90

9 years agoUpdated POTFILES.in
Piotr Drąg [Wed, 18 Feb 2015 12:43:12 +0000 (13:43 +0100)]
Updated POTFILES.in

9 years agoUpdated Italian translation
Milo Casagrande [Wed, 18 Feb 2015 08:12:00 +0000 (08:12 +0000)]
Updated Italian translation

9 years agotests: add GSimpleIOStream async close tests
Ryan Lortie [Tue, 20 Jan 2015 13:38:18 +0000 (08:38 -0500)]
tests: add GSimpleIOStream async close tests

Just a couple of tests to make sure the two paths are working properly,
without crashes or leaks.

https://bugzilla.gnome.org/show_bug.cgi?id=741630

9 years agoAdd GSimpleIOStream class
Ignacio Casal Quinteiro [Wed, 17 Dec 2014 08:11:29 +0000 (09:11 +0100)]
Add GSimpleIOStream class

GSimpleIOStream represents an object that wraps an input and an output
stream making easy to use them by calling the #GIOStream methods.

https://bugzilla.gnome.org/show_bug.cgi?id=741630

9 years agoGIOStream: support for unemulated async close()
Ryan Lortie [Tue, 20 Jan 2015 13:11:02 +0000 (08:11 -0500)]
GIOStream: support for unemulated async close()

Add an implementation of non-thread-emulated async close of a GIOStream
if either of the underlying stream objects support it.

This prevents us from calling close() functions from another thread on
an object that may not be expecting that.  It also allows us to skip the
thread entirely in case our objects support a pure async close.

https://bugzilla.gnome.org/show_bug.cgi?id=741630

9 years agostreams: add private 'async close via threads' API
Ryan Lortie [Tue, 20 Jan 2015 13:09:33 +0000 (08:09 -0500)]
streams: add private 'async close via threads' API

Add an internal helper to find out if close_async() is implemented via
threads using the default implementation in the base class.

We will use this to decide if we should do a 'pure async' close of a
GIOStream or not.

https://bugzilla.gnome.org/show_bug.cgi?id=741630

9 years agostreams: de-gtkdocify internal API
Ryan Lortie [Tue, 20 Jan 2015 17:54:09 +0000 (12:54 -0500)]
streams: de-gtkdocify internal API

Remove the /** **/-style block from two internal helpers to prevent
gtk-doc from picking them up.

https://bugzilla.gnome.org/show_bug.cgi?id=741630

9 years agogdbus: delay closing stream after read finish
Marc-André Lureau [Thu, 12 Feb 2015 21:29:36 +0000 (22:29 +0100)]
gdbus: delay closing stream after read finish

Closing the stream on the writing side my race with a pending read. This
patch ensures that closing is delayed after reading is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=743990

9 years agotests: check for NULL before g_object_unref()
Ryan Lortie [Wed, 4 Feb 2015 16:47:39 +0000 (17:47 +0100)]
tests: check for NULL before g_object_unref()

delayed_close_free() calls g_object_unref() on a variable that is
expected to possibly contain NULL (as indicated by the fact that the
NULL case is handled in my_slow_close_output_stream_close_async()).

This is dead code right now (due to a bug in GDBus), which is why it
isn't actually causing a failure.  It should still be fixed, however.

https://bugzilla.gnome.org/show_bug.cgi?id=743990

9 years agoautocleanups: Use g_option_context_unref()
Colin Walters [Tue, 17 Feb 2015 18:36:20 +0000 (13:36 -0500)]
autocleanups: Use g_option_context_unref()

This fixes a use of a deprecated API.

9 years agogapplication: never set the prgname to the app id
Lars Uebernickel [Wed, 4 Feb 2015 10:01:41 +0000 (11:01 +0100)]
gapplication: never set the prgname to the app id

GApplication set the prgname to the application's id when it was running
in service mode. This broke with the addition of new --app-id option,
because g_set_prgname() was called before parsing the options. Calling
it after option parsing doesn't work, because GOptionContext sets
prgname to argv[0] unconditionally.

Instead of changing the semantics of GOptionContext, simply remove this
functionality from GApplication. It is very unusual to have the prgname
set to the app id instead of the binary's name and might confuse people
when looking at logs etc.

When overriding local_command_line() from a subclass,
g_option_context_parse() might never be invokded. Thus, continue setting
the prgname to argv[0] in GApplication.

https://bugzilla.gnome.org/show_bug.cgi?id=743933

9 years agoUpdated Italian translation
Milo Casagrande [Tue, 17 Feb 2015 13:32:06 +0000 (13:32 +0000)]
Updated Italian translation

9 years agogapplication: add bind_busy_property()
Lars Uebernickel [Sun, 15 Feb 2015 17:54:13 +0000 (18:54 +0100)]
gapplication: add bind_busy_property()

Balancing g_application_{un,}mark_busy() is non-trivial in some cases.

Make it a bit more convenient by allowing to bind multiple boolean
properties (from different objects) to the busy state. As long as these
properties are true, the application is marked as busy.

https://bugzilla.gnome.org/show_bug.cgi?id=744565

9 years agoUpdated Slovenian translation
Matej Urbančič [Sun, 15 Feb 2015 20:11:57 +0000 (21:11 +0100)]
Updated Slovenian translation

9 years agoUpdated Swedish translation
Sebastian Rasmussen [Sun, 15 Feb 2015 19:49:43 +0000 (19:49 +0000)]
Updated Swedish translation

9 years agoUpdated Russian translation
Ivan Komaritsyn [Sun, 15 Feb 2015 06:10:44 +0000 (09:10 +0300)]
Updated Russian translation

9 years agoUpdated Greek translation
Efstathios Iosifidis [Sat, 14 Feb 2015 15:09:14 +0000 (17:09 +0200)]
Updated Greek translation

9 years agoTest functions should have async scope
Phillip Wood [Wed, 5 Nov 2014 15:04:45 +0000 (15:04 +0000)]
Test functions should have async scope

The testing utilities execute fixture and test functions
asynchronously.

https://bugzilla.gnome.org/show_bug.cgi?id=739724

9 years agoUpdated Norwegian bokmål translation.
Kjartan Maraas [Thu, 12 Feb 2015 00:27:02 +0000 (01:27 +0100)]
Updated Norwegian bokmål translation.

9 years agogoption: Add boxed type for GOptionGroup
Bastien Nocera [Thu, 22 Jan 2015 13:44:47 +0000 (14:44 +0100)]
goption: Add boxed type for GOptionGroup

This would allow bindings to use _get_option_group() functions, which
would then allow them to use GOption parsing.

This also adds introspection annotations to
g_option_context_add_group(), g_option_context_set_main_group() and
g_option_context_get_main_group().

https://bugzilla.gnome.org/show_bug.cgi?id=743349

9 years agoglist: Mention that g_list_length() is bad for checking list emptiness
Philip Withnall [Tue, 2 Dec 2014 15:00:45 +0000 (15:00 +0000)]
glist: Mention that g_list_length() is bad for checking list emptiness

Despite linked lists being a fairly fundamental computer science
concept, some developers insist on using:
    g_list_length (list) > 0
to determine whether a list is non-empty, rather than using:
    list != NULL

Add a comment to the documentation for g_list_length() and
g_slist_length() pointing out the better alternative in the hope that it
will prevent some of this abuse.

https://bugzilla.gnome.org/show_bug.cgi?id=741024

9 years ago2.43.4 2.43.4
Matthias Clasen [Wed, 11 Feb 2015 00:49:10 +0000 (19:49 -0500)]
2.43.4

9 years agoUpdate .gitignore
Jasper St. Pierre [Tue, 10 Feb 2015 19:50:53 +0000 (11:50 -0800)]
Update .gitignore

9 years agogmem.h, gthread.h: Include glib/gutils.h
Chun-wei Fan [Mon, 9 Feb 2015 07:42:01 +0000 (15:42 +0800)]
gmem.h, gthread.h: Include glib/gutils.h

gmem.h and gthread.h made use of the inline keyword, that is not available
on all compilers in C-mode, causing builds to break on such compilers.

Include glib/gutils.h which handles the inline issue, in place of
glib/gtypes.h if applicable, which is included quite early on by
glib/gutils.h.

https://bugzilla.gnome.org/show_bug.cgi?id=744190

9 years agoGI annotation for g_get_charset()
Sébastien Wilmet [Sun, 5 Oct 2014 13:12:25 +0000 (15:12 +0200)]
GI annotation for g_get_charset()

https://bugzilla.gnome.org/show_bug.cgi?id=736914

9 years agodocs: code example for enumeration types
Sébastien Wilmet [Thu, 18 Sep 2014 15:16:59 +0000 (17:16 +0200)]
docs: code example for enumeration types

I had to read the GTK+ code recently to have an example.

https://bugzilla.gnome.org/show_bug.cgi?id=736914

9 years agog_steal_pointer: make it C++ clean
Ryan Lortie [Fri, 6 Feb 2015 16:00:01 +0000 (17:00 +0100)]
g_steal_pointer: make it C++ clean

We have a test that #includes our headers from a C++ program to make
sure we don't throw any errors or warnings as a result of that.

The new inline implementation of g_steal_pointer() does an implicit
conversion from (void *), which is not valid in C++.

Add a cast to avoid the problem.

Thanks to Ignacio Casal Quinteiro for the report.

9 years agotests: add a test case for g_steal_pointer()
Ryan Lortie [Fri, 6 Feb 2015 11:41:57 +0000 (12:41 +0100)]
tests: add a test case for g_steal_pointer()

Just some basic checking to make sure it works as intended.

https://bugzilla.gnome.org/show_bug.cgi?id=742456

9 years agoAdd new API g_steal_pointer()
Ryan Lortie [Fri, 6 Feb 2015 11:38:26 +0000 (12:38 +0100)]
Add new API g_steal_pointer()

This is particularly nice when used with g_autoptr().  See examples in
the docs.

This patch is based upon an idea (and original patch submission) from
Will Manley <will@williammanley.net>.

https://bugzilla.gnome.org/show_bug.cgi?id=742456

9 years agoGListModel: Use G_DECLARE_INTERFACE
Xavier Claessens [Tue, 3 Feb 2015 15:40:15 +0000 (10:40 -0500)]
GListModel: Use G_DECLARE_INTERFACE

https://bugzilla.gnome.org/show_bug.cgi?id=743939

9 years agoAdd G_DECLARE_INTERFACE
Xavier Claessens [Tue, 3 Feb 2015 15:40:07 +0000 (10:40 -0500)]
Add G_DECLARE_INTERFACE

https://bugzilla.gnome.org/show_bug.cgi?id=743939

9 years agoAdd GMutexLocker
Xavier Claessens [Thu, 5 Feb 2015 15:35:42 +0000 (10:35 -0500)]
Add GMutexLocker

https://bugzilla.gnome.org/show_bug.cgi?id=744012

9 years agodocs: fix up docs issues in gio/
Xavier Claessens [Thu, 5 Feb 2015 15:20:43 +0000 (16:20 +0100)]
docs: fix up docs issues in gio/

9 years agodocs: fix many documentation issues in gobject/
Xavier Claessens [Thu, 5 Feb 2015 14:24:27 +0000 (15:24 +0100)]
docs: fix many documentation issues in gobject/

9 years agodocs: fix typo in g_settings_new_full() docstring
Ryan Lortie [Wed, 4 Feb 2015 15:29:56 +0000 (16:29 +0100)]
docs: fix typo in g_settings_new_full() docstring

9 years agodocs: add a bunch of pointless documentation
Ryan Lortie [Wed, 4 Feb 2015 14:37:27 +0000 (15:37 +0100)]
docs: add a bunch of pointless documentation

Document each of the baked-in CClosure marshallers that we have in
gobject, along with their #GVaClosureMarshal equivalents.

Based on a patch from Xavier Claessens <xavier.claessens@collabora.com>.

9 years agoDoc: Fix g_auto and g_autoptr typo
Xavier Claessens [Mon, 2 Feb 2015 14:46:31 +0000 (09:46 -0500)]
Doc: Fix g_auto and g_autoptr typo