platform/upstream/glib.git
11 years agoClarify the g_application_withdraw_notification docs
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.

11 years agoDon't build gapplication(1) on win32
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...

11 years agoGSubprocess win32 fixups
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.

11 years agoGNotification: Don't install private headers, avoid duplicated prototype
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.

11 years agoDon't g_test_assert_expected_messages for g_error
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

11 years agoGNotification: finish documentation
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

11 years agoGNotification: some final cleanups
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

11 years agoAdd gtk notification backend
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

11 years agoAdd GNotification
Lars Uebernickel [Tue, 15 Oct 2013 15:21:10 +0000 (11:21 -0400)]
Add GNotification

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

11 years agogmessages: Clarify new-line behaviour of message functions
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.

11 years agoglib-init: fix redundant-decls of g_mem_gc_friendly
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

11 years agogmem: remove glib-init.h inclusion
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

11 years agoUpdated Brazilian Portuguese translation
Enrico Nicoletto [Sat, 19 Oct 2013 15:39:22 +0000 (12:39 -0300)]
Updated Brazilian Portuguese translation

11 years agogio/gbufferedinputstream: fix redundant-decls of g_buffered_input_stream_finalize()
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

11 years agogutils: fix redundant-decls of g_init_user_config_dir()
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

11 years agogconvert: fix redundant-decls of _g_charset_get_aliases()
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

11 years agogenviron: fix g_setenv(var, NULL) and some other stuff
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

11 years agogconvert: Clarify g_locale_to/from_utf8 docs
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

11 years agodocs: Remove comment about calling g_type_init()
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

11 years agoAssamese translation updated
Nilamdyuti Goswami [Fri, 18 Oct 2013 13:44:51 +0000 (19:14 +0530)]
Assamese translation updated

11 years agoInclude gapplication(1) in the tools section
Matthias Clasen [Fri, 18 Oct 2013 01:03:18 +0000 (21:03 -0400)]
Include gapplication(1) in the tools section

11 years agoFix up subprocess docs
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.

11 years agoFix up gio-sections.txt
Matthias Clasen [Fri, 18 Oct 2013 00:45:32 +0000 (20:45 -0400)]
Fix up gio-sections.txt

11 years agoGenerate introspected docs for GSimpleProxyResolver
Matthias Clasen [Fri, 18 Oct 2013 00:38:15 +0000 (20:38 -0400)]
Generate introspected docs for GSimpleProxyResolver

11 years agoAdd some missing argument docs
Matthias Clasen [Fri, 18 Oct 2013 00:37:57 +0000 (20:37 -0400)]
Add some missing argument docs

11 years agoAdd index for 2.40 api additions
Matthias Clasen [Fri, 18 Oct 2013 00:16:13 +0000 (20:16 -0400)]
Add index for 2.40 api additions

11 years agotests/gsubprocess: Locate test child binary for installed tests too
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.

11 years agoUpdated POTFILES.in
Piotr Drąg [Thu, 17 Oct 2013 19:56:55 +0000 (21:56 +0200)]
Updated POTFILES.in

11 years agoUse g_return_val_if_fail() for developer-only messages
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

11 years agoFixup GSubprocess documentation bits
Ryan Lortie [Thu, 17 Oct 2013 19:01:42 +0000 (15:01 -0400)]
Fixup GSubprocess documentation bits

11 years agogsubprocess: Add UTF-8 variants of communicate()
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.

11 years agogsubprocess: Fix up communicate
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.

11 years agoGSubprocess: New class for spawning child processes
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

11 years agogspawn: support creating pipes with O_CLOEXEC
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).

11 years agogio: Add private API to create win32 streams from fds
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

11 years agoRemoved obsolete makefile rules
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

11 years agogtask: Fix invalid name in documentation
Jasper St. Pierre [Thu, 17 Oct 2013 17:02:11 +0000 (13:02 -0400)]
gtask: Fix invalid name in documentation

11 years agoNew gapplication(1) tool
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

11 years agoRevert "gapplication: don't rely on cmdline being finalized immediately"
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.

11 years agogapplication: don't rely on cmdline being finalized immediately
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

11 years agog_file_copy: Fall back to pathname queryinfo to help gvfs backends
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

11 years agoFix wrong function names in g_str_match_string() documentation
Xavier Claessens [Tue, 15 Oct 2013 15:02:40 +0000 (11:02 -0400)]
Fix wrong function names in g_str_match_string() documentation

11 years agoUpdated reference to README.commits
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

11 years agoUpdated Indonesian translation
Andika Triwidada [Tue, 15 Oct 2013 04:54:59 +0000 (11:54 +0700)]
Updated Indonesian translation

11 years agoAdd testcase for search utilities functions
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

11 years agoAdd simple string "search" function
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

11 years agoAdd g_str_is_ascii()
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

11 years agogmain: mark newest id used when source id overflows
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

11 years agoGMemoryOutputStream: Don't return -1 as a gboolean in precondition
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.

11 years agoAssamese translation updated
Nilamdyuti Goswami [Mon, 7 Oct 2013 07:26:28 +0000 (12:56 +0530)]
Assamese translation updated

11 years agoFix overloading of "source" and "target" terminology in GBinding
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

11 years agoxdgmime: Fix an invalid read
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

11 years agoRestore gl_GLIBC21 to configure; needed for libcharset
John Ralls [Fri, 4 Oct 2013 18:45:47 +0000 (11:45 -0700)]
Restore gl_GLIBC21 to configure; needed for libcharset

11 years agoappinfo: Don't try DBusActivatable with load_from_keyfile
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

11 years agoAdd g_key_file_save_to_file()
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

11 years agogcredentials: add Solaris support
Dan Winship [Thu, 19 Sep 2013 20:09:38 +0000 (16:09 -0400)]
gcredentials: add Solaris support

Based on patches from Igor Pashev.

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

11 years agogcredentials: add Hurd support
Dan Winship [Thu, 19 Sep 2013 16:56:56 +0000 (12:56 -0400)]
gcredentials: add Hurd support

It uses the same system as FreeBSD.

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

11 years agogcredentials: add internal macros to simplify all the #ifdefs
Dan Winship [Wed, 18 Sep 2013 17:40:09 +0000 (13:40 -0400)]
gcredentials: add internal macros to simplify all the #ifdefs

Rather than having lots of obscure platform-based #ifdefs all over
gio, define some macros in gcredentialsprivate.h, and use those to
simplify the rest of the code.

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

11 years agoGDBusProxy: add flag to control autostarting at construction time
Giovanni Campagna [Thu, 3 Oct 2013 18:26:18 +0000 (20:26 +0200)]
GDBusProxy: add flag to control autostarting at construction time

Sometimes the application doesn't want to autostart a service
when it creates a proxy, but wants the service autostarted when
it makes the first method call. Allow that behavior with a new
flag.

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

11 years agogdesktopappinfo: Large-scale whitespace fixup
Ryan Lortie [Sat, 27 Jul 2013 19:08:58 +0000 (15:08 -0400)]
gdesktopappinfo: Large-scale whitespace fixup

Fix up a lot of whitespace issues in this file since we're about to do
some pretty serious rewriting here anyway...

Add some fold markers while we're at it.

11 years agogdesktopappinfo: rework search path
Ryan Lortie [Wed, 24 Jul 2013 21:48:37 +0000 (17:48 -0400)]
gdesktopappinfo: rework search path

Change the search path to be a global array of 'DesktopFileDir' structures and
change the 'get' function to an 'ensure' function.

This is just a straight-up refactor.  Future patches will expand the
DesktopFileDir structure.

11 years agogdesktopappinfo: remove global_defaults_cache
Ryan Lortie [Wed, 24 Jul 2013 21:28:43 +0000 (17:28 -0400)]
gdesktopappinfo: remove global_defaults_cache

...and some related functions.

This variable is also used for nothing at all.

11 years agogdesktopappinfo: remove should_ping_mime_monitor
Ryan Lortie [Wed, 24 Jul 2013 21:26:45 +0000 (17:26 -0400)]
gdesktopappinfo: remove should_ping_mime_monitor

This variable is used for nothing...

11 years agoglocalfile: add private worker monitor APIs
Ryan Lortie [Thu, 25 Jul 2013 18:05:36 +0000 (14:05 -0400)]
glocalfile: add private worker monitor APIs

Add a convenient and race-free method of watching local files from the
GLib worker thread.

Without this, the race-free way to create a monitor that dispatches
events to the worker thread looked something like this:

 - dispatch an idle to the worker thread
 - from the idle, create the monitor and connect signals
 - from the original thread, wait (on a cond?) until the worker thread
   has finished setting up the monitor
 - read the file that you were monitoring

which is just ridiculously complicated...

To use the new API:

  monitor = g_local_file_monitor_new_in_worker ("/path/to/some/file",
                                                G_FILE_MONITOR_NONE,
                                                &error);
  g_assert_no_error (error);

  g_signal_connect (monitor, "changed", G_CALLBACK (callback), NULL);

  g_local_file_monitor_start (monitor);

'callback' will run from the GLib worker thread.

This is the reason that the start() call was introduced in the previous
commit.  The backends that don't use the start() call will have a very
thin race between creating the monitor and connecting the signal, but
hopefully they will be fixed soon.

These new APIs will be used (at least) from gdesktopappinfo to watch for
changes in the desktop file directories.

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

11 years agoGFileMonitor: support specifying a context
Ryan Lortie [Thu, 25 Jul 2013 18:17:09 +0000 (14:17 -0400)]
GFileMonitor: support specifying a context

Add a new "context" construct-only property to allow explicitly
specifying the context in which events should be dispatched.

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

11 years agoinotify: stop using constructor()
Ryan Lortie [Thu, 25 Jul 2013 17:48:50 +0000 (13:48 -0400)]
inotify: stop using constructor()

and start using the new start() vcall on the local monitor classes.

I only port inotify because I am uncomfortable making changes to the
other monitor backends without having a way of testing them.

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

11 years agolocal monitors: make more idiomatic use of GObject
Ryan Lortie [Thu, 25 Jul 2013 17:29:16 +0000 (13:29 -0400)]
local monitors: make more idiomatic use of GObject

Stop abusing constructor() to do startup work, adding _start() calls
instead.

The backends themselves still use constructor() although a patch will be
following to also fix inotify.

The reason for using a separate start() call instead of constructed()
will become apparent in future commits.

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

11 years agodirectory monitor: use the right 'mount_notify'
Ryan Lortie [Thu, 25 Jul 2013 17:19:56 +0000 (13:19 -0400)]
directory monitor: use the right 'mount_notify'

During initialisation of a directory monitor with the
G_FILE_MONITOR_WATCH_MOUNTS flag set, GLocalDirectory monitor will add a
UNIX mount watch in case the file notification backend doesn't support
reporting these events for itself.

Unfortunately, it was performing the check incorrectly, resulting in a
monitor always being added.

Fix that, and add the #define for G_LOCAL_DIRECTORY_MONITOR_GET_CLASS()
that was also missing (since the fix depends on it).

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

11 years agogoutputstream: Add clear warning about short writes to _write_bytes() and async version
Colin Walters [Wed, 2 Oct 2013 14:32:03 +0000 (10:32 -0400)]
goutputstream: Add clear warning about short writes to _write_bytes() and async version

Matthew Barnes noted this on IRC a few days ago.  I just had this file
open for other reasons and decided to tweak the docs to make this trap
more clear.

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

11 years agog_settings_list_children: only list viable schemas
Ryan Lortie [Thu, 8 Aug 2013 16:50:21 +0000 (18:50 +0200)]
g_settings_list_children: only list viable schemas

Don't return children with invalid schemas from
g_settings_list_children() (ie: missing schemas or mismatched paths).
This prevents gsettings list-recursively from crashing when broken
schemas are installed on the system.

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

11 years agounicode: Update to unicode 6.3.0
Christian Persch [Tue, 1 Oct 2013 13:40:43 +0000 (15:40 +0200)]
unicode: Update to unicode 6.3.0

No new blocks were added in 6.3, and only 5 new characters to be used
with the updated BiDi algorithm. And some character properties were changed.

See http://www.unicode.org/versions/Unicode6.3.0/ for more information.

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

11 years agoFix crashes in various GParamSpec creation functions
Simon Feltman [Tue, 1 Oct 2013 10:38:24 +0000 (03:38 -0700)]
Fix crashes in various GParamSpec creation functions

Add NULL check and return after calls to g_param_spec_internal in GParamSpec
creation functions. This avoids glib crashing due to things like badly named
properties.

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

11 years agoAdd missing string.h include
Michael Forney [Tue, 1 Oct 2013 12:19:55 +0000 (05:19 -0700)]
Add missing string.h include

Required for memset()

11 years agoFix a careless mistake in the last commit
Ryan Lortie [Mon, 30 Sep 2013 17:06:30 +0000 (13:06 -0400)]
Fix a careless mistake in the last commit

Thanks Colin :)

11 years agogmain: Remove dispatching source stack
Ryan Lortie [Wed, 12 Jun 2013 18:57:09 +0000 (14:57 -0400)]
gmain: Remove dispatching source stack

This stack exists only to answer the question of "what is the currently
dispatching source" and is handled in a way that makes it very clear
that we don't need to be using a linked list at all...

Just store the GSource directly.

Independently discovered (and same solution) by Phillip Susi.

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

11 years agoGOutputStream: Use async read/write of streams in splice_async()
Mike Ruprecht [Mon, 18 Feb 2013 14:12:50 +0000 (08:12 -0600)]
GOutputStream: Use async read/write of streams in splice_async()

There are some corner cases where using the sync version of read/write
in a thread could cause thread-safety issues. In these cases it's
possible to override the output stream's splice_async() function,
but for input streams one would need to do some acrobatics to
stay thread-safe. Alternatively, some implementations may not even
override their sync read/write functions.

This patch refactors the default splice_async() implementation to
call the sync read and write functions in a thread only when both
async versions are thread-based. When one or both are non-threaded,
it calls the virtual write_async() and read_async() functions of the
involved streams within the same thread.

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

11 years agoGOutputStream: Split _close_async for internal use
Mike Ruprecht [Mon, 18 Feb 2013 13:58:58 +0000 (07:58 -0600)]
GOutputStream: Split _close_async for internal use

Refactor g_output_stream_close_async() into itself and an internal
variant for potential use inside other operations (splice_async).
The internal version must be called between
g_output_stream_set_pending() and g_output_stream_clear_pending().

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

11 years agoGOutputStream: Rename _g_output_stream_close_internal() for consistency
Mike Ruprecht [Sun, 24 Feb 2013 15:09:05 +0000 (09:09 -0600)]
GOutputStream: Rename _g_output_stream_close_internal() for consistency

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

11 years agotests: Add testcases for g_output_stream_splice_async()
Mike Ruprecht [Sat, 23 Feb 2013 21:13:53 +0000 (15:13 -0600)]
tests: Add testcases for g_output_stream_splice_async()

Previously, no testcases tested the close flags of
g_output_stream_splice_async. This patch adds tests for that and
also tests various combinations of threaded and non-threaded
GInputStream async reads and GOutputStream async writes.

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

11 years agoGOutputStream: Add g_output_stream_async_write_is_via_threads()
Mike Ruprecht [Sat, 23 Feb 2013 23:42:49 +0000 (17:42 -0600)]
GOutputStream: Add g_output_stream_async_write_is_via_threads()

In implementing a better g_output_stream_splice_async() and possibly
other situtations it's helpful to know whether the output stream's
write function internally uses threads. If it and the input stream's
read async functions use threads, then the splice function could
spawn a single thread for better efficiency.

This patch adds a function to determine whether an output stream's
g_output_stream_write_async() function internally uses threads.

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

11 years agoGInputStream: Add g_input_stream_async_read_is_via_threads()
Mike Ruprecht [Sat, 23 Feb 2013 23:32:31 +0000 (17:32 -0600)]
GInputStream: Add g_input_stream_async_read_is_via_threads()

In implementing a better g_output_stream_splice_async() and possibly
other situtations it's helpful to know whether the input stream's
read function internally uses threads. If it and the output stream's
write async functions use threads, then the splice function could
spawn a single thread for better efficiency.

This patch adds a function to determine whether an input stream's
g_input_stream_read_async() function internally uses threads.

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

11 years agoFix the -Werror=format-nonliteral fixes for older GCCs
John Ralls [Sun, 29 Sep 2013 18:33:30 +0000 (11:33 -0700)]
Fix the -Werror=format-nonliteral fixes for older GCCs

They don't allow that pragma inside functions.

11 years agoMore -Werror=format-nonliteral fixes
John Ralls [Sat, 28 Sep 2013 23:44:32 +0000 (16:44 -0700)]
More -Werror=format-nonliteral fixes

This fixes the build with CLang.

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

11 years agogfileutils: Make -Werror=format-nonliteral happy
Colin Walters [Mon, 17 Jun 2013 21:49:12 +0000 (17:49 -0400)]
gfileutils: Make -Werror=format-nonliteral happy

I tried to please it by using G_GNUC_FORMAT, but that didn't work, so
let's just fall back to pushing an ignore.

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

11 years agogmessages: fix clang annotations to work with older versions
Dan Winship [Sat, 28 Sep 2013 16:31:52 +0000 (12:31 -0400)]
gmessages: fix clang annotations to work with older versions

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

11 years agogio: make gnetworking.h nodist
Dan Winship [Sat, 28 Sep 2013 16:18:14 +0000 (12:18 -0400)]
gio: make gnetworking.h nodist

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

11 years ago.gitignore: add "signals"
Dan Winship [Sat, 28 Sep 2013 14:39:01 +0000 (10:39 -0400)]
.gitignore: add "signals"

11 years agoOnly use SA_RESTART if it exists
Patrick Welche [Fri, 27 Sep 2013 09:09:32 +0000 (10:09 +0100)]
Only use SA_RESTART if it exists

Fixes build on QNX (and possibly HPUX given Bug 168352)
Patch essentially from pkgsrc devel/glib2/patches/patch-ai

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

11 years agogdesktopappinfo: Call g_file_get_path() on demand
Bastien Nocera [Wed, 25 Sep 2013 14:14:17 +0000 (16:14 +0200)]
gdesktopappinfo: Call g_file_get_path() on demand

Rather than always calling out to g_file_get_path() (which
might block, whatever the documentation might say), postpone
the call until we actually need it.

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

11 years agogio: Fix documentation for GSocketControlMessage that refers to a 'file description...
Robert Ancell [Fri, 27 Sep 2013 02:52:51 +0000 (14:52 +1200)]
gio: Fix documentation for GSocketControlMessage that refers to a 'file description' instead of a 'file descriptor'

11 years agogio: Fix -Werror format string errors from mismatched ints.
Jan Schmidt [Wed, 25 Sep 2013 09:22:26 +0000 (19:22 +1000)]
gio: Fix -Werror format string errors from mismatched ints.

11 years agoglocalfile: Only use O_DIRECTORY if available
William Orr [Thu, 26 Sep 2013 18:02:06 +0000 (11:02 -0700)]
glocalfile: Only use O_DIRECTORY if available

Solaris 10 for example doesn't have it.

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

11 years agoUpdated Russian translation
Yuri Myasoedov [Wed, 25 Sep 2013 19:11:08 +0000 (23:11 +0400)]
Updated Russian translation

11 years agoFix typo in GLIB_VERSION_2_40 docs.
Krzesimir Nowak [Wed, 25 Sep 2013 07:39:20 +0000 (09:39 +0200)]
Fix typo in GLIB_VERSION_2_40 docs.

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

11 years agoTamil Translations Updated
Shantha kumar [Wed, 25 Sep 2013 06:58:53 +0000 (12:28 +0530)]
Tamil Translations Updated

11 years agogio: Fix typo in the /org/freedesktop/DBus path
James Strandboge [Tue, 24 Sep 2013 12:19:20 +0000 (13:19 +0100)]
gio: Fix typo in the /org/freedesktop/DBus path

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

11 years agogio/gsocket.c: Fix error code checks when SOCK_CLOEXEC is defined but
Svante Signell [Wed, 18 Sep 2013 14:39:09 +0000 (16:39 +0200)]
gio/gsocket.c: Fix error code checks when SOCK_CLOEXEC is defined but
not supported on GNU/Hurd.

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

11 years agoUpdated Traditional Chinese translation(Hong Kong and Taiwan)
Chao-Hsiung Liao [Tue, 24 Sep 2013 11:01:24 +0000 (19:01 +0800)]
Updated Traditional Chinese translation(Hong Kong and Taiwan)

11 years agoBump version to 2.39.0
Ryan Lortie [Mon, 23 Sep 2013 21:47:49 +0000 (17:47 -0400)]
Bump version to 2.39.0

11 years agoIntroduce version macros for 2.40
Ryan Lortie [Mon, 23 Sep 2013 21:46:58 +0000 (17:46 -0400)]
Introduce version macros for 2.40