platform/upstream/glib.git
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

9 years agoDoc: Add missing functions in gio.types
Xavier Claessens [Mon, 2 Feb 2015 20:00:25 +0000 (15:00 -0500)]
Doc: Add missing functions in gio.types

This is made by doing a build with --rebuild-types option,
then manually remove those functions:
  g_win32_input_stream_get_type
  g_win32_output_stream_get_type
  g_io_extension_get_type

Maybe Makefile.am could remove them automatically so we can
remove gio.types from git and rely on --rebuild-types option?

9 years agoDoc: sort and uniquify gio.types
Xavier Claessens [Mon, 2 Feb 2015 19:41:04 +0000 (14:41 -0500)]
Doc: sort and uniquify gio.types

9 years agoDoc: Fix GListModel/GListStore
Xavier Claessens [Fri, 30 Jan 2015 16:40:46 +0000 (11:40 -0500)]
Doc: Fix GListModel/GListStore

9 years agoVisual Studio 2008 Builds: Fix Header "Installation"
Chun-wei Fan [Wed, 4 Feb 2015 08:00:52 +0000 (16:00 +0800)]
Visual Studio 2008 Builds: Fix Header "Installation"

Apparently I did not fix the "installation" of gliststore.h and
glistmodel.h fully for Visual Studio 2008 builds.  Fix that.  Doh!

9 years agognulib/vasprintf: handle unsigned modifier for long long
Aurélien Zanelli [Tue, 3 Feb 2015 14:41:05 +0000 (15:41 +0100)]
gnulib/vasprintf: handle unsigned modifier for long long

Otherwise, an unsigned integer will be displayed as a signed one if we
use internal printf and if HAVE_LONG_LONG_FORMAT is not defined.

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

9 years agoGListStore: fix preconditions in insert_sorted()
Lars Uebernickel [Tue, 3 Feb 2015 15:06:53 +0000 (16:06 +0100)]
GListStore: fix preconditions in insert_sorted()

9 years agodocs: fix typos in G_DECLARE_*_TYPE
Xavier Claessens [Tue, 3 Feb 2015 14:57:54 +0000 (15:57 +0100)]
docs: fix typos in G_DECLARE_*_TYPE

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

9 years agotests: add test for GListStore inserted sort
Ryan Lortie [Tue, 3 Feb 2015 12:42:59 +0000 (13:42 +0100)]
tests: add test for GListStore inserted sort

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

9 years agoGListStore: add sorted insert function
Ryan Lortie [Tue, 3 Feb 2015 12:18:10 +0000 (13:18 +0100)]
GListStore: add sorted insert function

Add g_list_store_insert_sorted() which takes a GCompareDataFunc to
decide where to insert.  This ends up being a very trivial function,
thanks to GSequence.

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

9 years agogtype.h: Fix Build on non-GCC
Chun-wei Fan [Mon, 2 Feb 2015 15:25:31 +0000 (23:25 +0800)]
gtype.h: Fix Build on non-GCC

Use the (private) _GLIB_DEFINE_AUTOPTR_CHAINUP macro for
G_DECLARE_DERIVABLE_TYPE and G_DECLARE_FINAL_TYPE so that we will
attempt to typedef and define items necessary for GCC
__attribute__((cleanup)) on, well, GCC only.

This fixes the build on non-GCC.

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

9 years agogmacros.h: Add Private Macro _GLIB_DEFINE_AUTOPTR_CHAINUP
Chun-wei Fan [Mon, 2 Feb 2015 15:21:35 +0000 (23:21 +0800)]
gmacros.h: Add Private Macro _GLIB_DEFINE_AUTOPTR_CHAINUP

This is necessary as we are using _GLIB_AUTOPTR_TYPENAME and
_GLIB_AUTOPTR_FUNC_NAME in gtype.h for G_DECLARE_DERIVABLE_TYPE and
G_DECLARE_FINAL_TYPE, but _GLIB_AUTOPTR_TYPENAME and
_GLIB_AUTOPTR_FUNC_NAME expand to nothing on non-GCC, causing builds on
non-GCC to break, due to bad typedef and function definitions.

This patch defines a new private macro which does what is needed on GCC
builds and does nothing on non-GCC builds, thus fixing the build.

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

9 years agoglistmodel.h: Fix _GListModelInterface Define
Chun-wei Fan [Mon, 2 Feb 2015 05:33:18 +0000 (13:33 +0800)]
glistmodel.h: Fix _GListModelInterface Define

"interface" is a reserved word on Visual Studio, so fix the build by
using g_iface instead.

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

9 years agofix G_DEFINE_AUTO_CLEANUP_FREE_FUNC on non-GCC
Ryan Lortie [Mon, 2 Feb 2015 08:16:55 +0000 (09:16 +0100)]
fix G_DEFINE_AUTO_CLEANUP_FREE_FUNC on non-GCC

Add the missing 'none' argument to this macro in the non-GCC case.  The
none parameter was added after the others and I forgot to update the
non-GCC case.

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

9 years agodocs: link the GListModel docs from the index
Ryan Lortie [Fri, 30 Jan 2015 16:38:45 +0000 (17:38 +0100)]
docs: link the GListModel docs from the index

9 years agoMSVC Builds: Fix "Installation" of GListModel Headers
Chun-wei Fan [Mon, 2 Feb 2015 06:27:29 +0000 (14:27 +0800)]
MSVC Builds: Fix "Installation" of GListModel Headers

Somehow I had the wrong path for getting the headers... oops.

9 years agoMSVC Builds: Update vs11|vs12/Makefile.am
Chun-wei Fan [Mon, 2 Feb 2015 06:16:18 +0000 (14:16 +0800)]
MSVC Builds: Update vs11|vs12/Makefile.am

The rename of install.vxproj to glib-install.vcxproj needs to be applied
here as well for dist'ing the project files correctly.

9 years agoMSVC Builds: Rename "install" Projects
Chun-wei Fan [Mon, 2 Feb 2015 04:49:42 +0000 (12:49 +0800)]
MSVC Builds: Rename "install" Projects

Rename the project to "install" the GLib files, as we are planning to have
a grand solution file that would build the entire GTK+ stack with its deps,
to ease the process for people building the GTK+ stack from a stock
installation of Visual Studio.

9 years agogobject\gtype.h: Make up for Missing '\'
Chun-wei Fan [Mon, 2 Feb 2015 03:16:29 +0000 (11:16 +0800)]
gobject\gtype.h: Make up for Missing '\'

The macro definition for G_DECLARE_DERIVABLE_TYPE was missing a '\' when
we wanted to ignore deprecation warnings for it.

9 years agoOne More Update For MSVC Builds
Chun-wei Fan [Mon, 2 Feb 2015 03:14:07 +0000 (11:14 +0800)]
One More Update For MSVC Builds

We also need to "install" the headers for Lars' new APIs for GListModel/
GListStore.

9 years agoMSVC Builds: "Install" the Autocleanup Headers
Chun-wei Fan [Mon, 2 Feb 2015 02:51:25 +0000 (10:51 +0800)]
MSVC Builds: "Install" the Autocleanup Headers

We are including the autocleanup headers as public headers for all builds,
although they work only for GCC in reality, so "install" them.

Also clean up a bit as we are having "\\" in places, where we only need
"\".

9 years agogio: add support for g_auto() and g_autoptr()
Ryan Lortie [Fri, 30 Jan 2015 14:21:20 +0000 (15:21 +0100)]
gio: add support for g_auto() and g_autoptr()

Add support to libgio types for the new cleanup macros.

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

9 years agoG_DECLARE_*_TYPE: add auto cleanup support
Ryan Lortie [Wed, 28 Jan 2015 11:47:05 +0000 (11:47 +0000)]
G_DECLARE_*_TYPE: add auto cleanup support

Automatically add support for the new cleanup macros to the type
declaration macros.

This is an API break because now your parent class needs to support
cleanup if you want to use G_DECLARE_*_TYPE.  These macros are only 1
day old, however, so that's probably not a big problem (and we are
already busy adding the macros all over GLib and Gtk+).

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

9 years agogobject: add support for g_auto() and g_autoptr()
Ryan Lortie [Wed, 28 Jan 2015 11:46:34 +0000 (11:46 +0000)]
gobject: add support for g_auto() and g_autoptr()

Add support to libgobject types for the new cleanup macros.

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

9 years agoglib: add support for g_auto() and g_autoptr()
Ryan Lortie [Wed, 28 Jan 2015 11:45:26 +0000 (11:45 +0000)]
glib: add support for g_auto() and g_autoptr()

Add support to the libglib types for the new cleanup macros.

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

9 years agomacros: add support for GNUC cleanup __attribute__
Ryan Lortie [Wed, 28 Jan 2015 11:27:35 +0000 (11:27 +0000)]
macros: add support for GNUC cleanup __attribute__

Add g_auto() and g_autoptr() as helpers for declaring variables with
automatic cleanup.

Add some macros to help types define cleanup functions for themselves.

Going forward it will be an expectation that people use this macro when
creating a new type, even if they do not intend to use the auto-cleanup
functionality for themselves.

These new macros only work on GCC and clang, which is why we resisted
adding them for so long.  There exist many people who are only
interested in writing programs for these compilers, however, and a
similar API in libgsystem has proven to be extremely popular, so let's
expose this functionality to an even wider audience.

We ignore deprecation warnings when emitting the free functions, which
seems suspicious.  The reason that we do this is not because we want to
call deprecated functions, but just the opposite: sometimes the free
function will be an _unref() function that is only AVAILABLE_IN newer
versions, and these warnings are also implemented as deprecation
warnings.

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

9 years agoDECLARE_TYPE: ignore deprecations in inlines
Ryan Lortie [Fri, 30 Jan 2015 15:40:03 +0000 (16:40 +0100)]
DECLARE_TYPE: ignore deprecations in inlines

Prevent complaints about deprecations in the inline functions emitted by
the new G_DECLARE_*_TYPE macros.

9 years agoG_DECLARE_FINAL_TYPE: trivial fix in docs comment
Ryan Lortie [Wed, 28 Jan 2015 11:30:23 +0000 (11:30 +0000)]
G_DECLARE_FINAL_TYPE: trivial fix in docs comment

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

9 years agogiotypefuncs test: tweak _get_type() regexp
Ryan Lortie [Fri, 30 Jan 2015 14:30:02 +0000 (15:30 +0100)]
giotypefuncs test: tweak _get_type() regexp

Make sure that we only match the _get_type() function name by
restricting the regexp to matching [A-Za-z0-9_].  We were matching on .*
before which means that if we had two _get_type() functions appearing on
a single line then we would get everything in between them included (by
the default rule of '*' being greedy).

This affected G_DECLARE_*_TYPE which puts several uses of _get_type()
into a single line.

9 years agoAdd GListModel
Lars Uebernickel [Thu, 1 May 2014 18:04:32 +0000 (20:04 +0200)]
Add GListModel

GListModel is an interface that represents a dynamic list of GObjects.

Also add GListStore, a simple implementation of GListModel that stores
all objects in memory, using a GSequence.

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

9 years agogsettings: add g_settings_schema_list_children
Lars Uebernickel [Mon, 26 Jan 2015 10:13:26 +0000 (10:13 +0000)]
gsettings: add g_settings_schema_list_children

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

9 years agogsettings: add g_settings_schema_key_get_name
Lars Uebernickel [Mon, 26 Jan 2015 09:50:34 +0000 (09:50 +0000)]
gsettings: add g_settings_schema_key_get_name

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

9 years agoG_DECLARE_DERIVED_TYPE: allow forward declarations
Christian Hergert [Tue, 27 Jan 2015 18:50:04 +0000 (18:50 +0000)]
G_DECLARE_DERIVED_TYPE: allow forward declarations

This allows multiple declarations such as:

 typedef struct _Foo Foo;

as is needed when you have systems with circular referencing.

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

9 years agogcredentialsprivate: clarify the USE_FREEBSD_CMSGCRED users
Dan Winship [Tue, 27 Jan 2015 12:38:31 +0000 (07:38 -0500)]
gcredentialsprivate: clarify the USE_FREEBSD_CMSGCRED users

Add comments clarifying what the three non-FreeBSD platforms using
G_CREDENTIALS_USE_FREEBSD_CMSGCRED are.

9 years agogcredentials: Add support for DragonFly
Peeter Must [Tue, 27 Jan 2015 02:34:48 +0000 (11:34 +0900)]
gcredentials: Add support for DragonFly

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

9 years agogtype: add type declaration macros for headers
Ryan Lortie [Mon, 3 Feb 2014 17:40:17 +0000 (17:40 +0000)]
gtype: add type declaration macros for headers

Add G_DECLARE_DERIVABLE_TYPE() and G_DECLARE_FINAL_TYPE() to allow
skipping almost all of the typical GObject boilerplate code.

These macros make some assumptions about GObject best practice that mean
that they may not be usable with older classes that have to preserve
API/ABI compatibility with a time before these practices existed.

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

9 years agoglib-sections.txt: Add g_win32_check_windows_version()
Chun-wei Fan [Mon, 26 Jan 2015 03:17:28 +0000 (11:17 +0800)]
glib-sections.txt: Add g_win32_check_windows_version()

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

9 years agogwin32: Add g_win32_check_windows_version() API
Chun-wei Fan [Mon, 26 Jan 2015 03:11:48 +0000 (11:11 +0800)]
gwin32: Add g_win32_check_windows_version() API

This adds a public API where one can use to see whether the running version
of Windows where the code is run is at least the specified version, service
pack level, and the type (non-server, server, any) of the running Windows
OS.

This API is done as:
-GetVersion()/GetVersionEx() changed in the way they work since Windows 8.1
 [1][2], so a newer mechanism to check the version of the running Windows
 operating system is needed.  MSDN also states that GetVersion() might be
 further changed or removed after Windows 8.1.  This provides a wrapper for
 VerfyVersionInfo() as well in GLib for most cases, which was recommended
 in place of g_win32_get_windows_version() for more detailed Windows
 version checking.
-Provides an OS-level functionality check, for those that we don't need to
 venture into GetProcAddress(), and also to determine system API behavior
 changes due to differences in OS versions.

Also added a note for the g_win32_get_windows_version() API that since the
behavior of GetVersion() which it uses, is changed since Windows 8.1, users
of the API should be aware.

[1]:
http://msdn.microsoft.com/zh-tw/library/windows/desktop/ms724451%28v=vs.85%29.aspx
[2]:
http://msdn.microsoft.com/zh-tw/library/windows/desktop/ms724451%28v=vs.85%29.aspx

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

9 years agoGSimpleAction: add g_simple_action_set_state_hint
Cosimo Cecchi [Mon, 26 Jan 2015 11:18:06 +0000 (11:18 +0000)]
GSimpleAction: add g_simple_action_set_state_hint

Currently the only way to set a state hint on an action is through a
subclass; add a g_simple_action_set_state_hint() method so that this
becomes easier for clients that already use GSimpleAction.

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

9 years agogthread: add thread name support on Mac OS
Ilya Konstantinov [Sat, 20 Dec 2014 16:19:00 +0000 (11:19 -0500)]
gthread: add thread name support on Mac OS

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

9 years agogobject: Fix a typo in a documentation comment
Philip Withnall [Sun, 25 Jan 2015 17:09:35 +0000 (17:09 +0000)]
gobject: Fix a typo in a documentation comment

9 years agogthread: Fix a typo in a documentation comment
Philip Withnall [Sun, 25 Jan 2015 17:09:24 +0000 (17:09 +0000)]
gthread: Fix a typo in a documentation comment

9 years agogstrfuncs: Document that g_ascii_dtostr() writes a nul terminator
Philip Withnall [Sun, 25 Jan 2015 16:22:43 +0000 (16:22 +0000)]
gstrfuncs: Document that g_ascii_dtostr() writes a nul terminator

And g_ascii_formatd().

Reviewed-by: Ryan Lortie <desrt@desrt.ca>
9 years agogio/Makefile.am: Fix MSVC Project Generation
Chun-wei Fan [Wed, 21 Jan 2015 06:28:47 +0000 (14:28 +0800)]
gio/Makefile.am: Fix MSVC Project Generation

We need to filter out gnetworkmonitornm.c in the MSVC Projects, as that is
UNIX-only code.

9 years agobump version
Ryan Lortie [Tue, 20 Jan 2015 06:38:13 +0000 (01:38 -0500)]
bump version

9 years agoGLib 2.43.3 2.43.3
Ryan Lortie [Tue, 20 Jan 2015 05:05:11 +0000 (00:05 -0500)]
GLib 2.43.3

9 years agogtestutils: Add an example of using test fixtures
Philip Withnall [Fri, 16 Jan 2015 09:14:08 +0000 (09:14 +0000)]
gtestutils: Add an example of using test fixtures

Add a simple example of a test suite with two unit tests both using the
same fixture.

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

9 years agoUpdated Basque language
Inaki Larranaga Murgoitio [Sat, 17 Jan 2015 16:14:46 +0000 (17:14 +0100)]
Updated Basque language

9 years agogsocket: always try before waiting for condition
Ignacio Casal Quinteiro [Mon, 22 Dec 2014 15:38:50 +0000 (16:38 +0100)]
gsocket: always try before waiting for condition

When implementing blocking operations on top of
nonblocking sockets we should always first try to
perform the operation and then if needed handle
EAGAIN and wait with g_socket_wait_condition.
This is an optimization since we avoid calling
wait condition when it is not needed, but most
importantly this fixes hangs on win32 where some
events (in particular FD_WRITE) are only emitted
after the operation fails with EWOULDBLOCK.

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

9 years agogsocket: add a testcase that shows a hang on win32
Paolo Borelli [Sat, 10 Jan 2015 14:23:07 +0000 (15:23 +0100)]
gsocket: add a testcase that shows a hang on win32

Add a unit test that checks g_socket_new_from_fd by creating
a gsocket, obtaining its fd, duplicating the fd and then creating
a gsocket from the new fd. This shows a hang on win32 since the
gsocket created from the fd never receives the FD_WRITE event
because we wait for the condition without first trying to write
and windows signals the condition only after a EWOULDBLOCK error.

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

9 years agogtestutils: Add links to gtester and gtester-report documentation
Philip Withnall [Fri, 16 Jan 2015 09:22:21 +0000 (09:22 +0000)]
gtestutils: Add links to gtester and gtester-report documentation

Link some existing text to make cross-referencing a little easier.

9 years agogtestutils: Fix a typo in the g_test_add() documentation
Philip Withnall [Fri, 16 Jan 2015 09:18:41 +0000 (09:18 +0000)]
gtestutils: Fix a typo in the g_test_add() documentation

9 years agogtestutils: Clarify that test fixtures are allocated by GLib
Philip Withnall [Fri, 16 Jan 2015 09:10:46 +0000 (09:10 +0000)]
gtestutils: Clarify that test fixtures are allocated by GLib

Make it a little clearer that the user’s fixture setup and teardown
functions don’t have to do the allocation or freeing.

9 years agogtestutils: Fix a typo in the g_test_run() documentation
Philip Withnall [Fri, 16 Jan 2015 09:12:53 +0000 (09:12 +0000)]
gtestutils: Fix a typo in the g_test_run() documentation

9 years agoggettext: Include an example of setlocale() and friends in the i18n docs
Philip Withnall [Thu, 15 Jan 2015 14:20:33 +0000 (14:20 +0000)]
ggettext: Include an example of setlocale() and friends in the i18n docs

Include an example main() function, and include a link to the gettext
manual’s section on integrating gettext with build systems.

That should work as a complete reference for how to add i18n support to
an application.

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

9 years agoAvoid warning when using G_STMT_END macro with MSVC
Paolo Borelli [Tue, 13 Jan 2015 11:44:20 +0000 (12:44 +0100)]
Avoid warning when using G_STMT_END macro with MSVC

Workaround found on
http://cnicholson.net/2009/03/stupid-c-tricks-dowhile0-and-c4127/

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

9 years agoUse G_STMT_START/END in gslice.h
Paolo Borelli [Tue, 13 Jan 2015 12:22:07 +0000 (13:22 +0100)]
Use G_STMT_START/END in gslice.h

9 years agoUse G_STMT_START/END in gtestutils
Paolo Borelli [Tue, 13 Jan 2015 12:19:58 +0000 (13:19 +0100)]
Use G_STMT_START/END in gtestutils

9 years agogsettings: Fix a typo in the GSettings documentation
Philip Withnall [Fri, 19 Dec 2014 21:10:53 +0000 (21:10 +0000)]
gsettings: Fix a typo in the GSettings documentation

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

9 years agoBump version
Matthias Clasen [Tue, 13 Jan 2015 21:54:59 +0000 (16:54 -0500)]
Bump version

So that early adopters of new api have a version to target.

9 years agognetworkmonitornm: Check if network-manager is running
Iain Lane [Mon, 12 Jan 2015 10:03:18 +0000 (10:03 +0000)]
gnetworkmonitornm: Check if network-manager is running

We were asking for properties on NM's dbus interface, but if NM is not
running then there won't be any. Check if the name has an owner before
doing anything to it.

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

9 years agoconfigure.ac: reject 'universal' builds
Ryan Lortie [Wed, 7 Jan 2015 21:15:22 +0000 (16:15 -0500)]
configure.ac: reject 'universal' builds

AC_C_BIGENDIAN can return 'universal' as the result in the case that we
are trying to do a universal build on Mac OS.  This has to be opted into
explicitly by using multiple -arch CFLAGS.

Previously, we detected this result and fell back to doing our own check
based on the endianness of the build machine, hardcoding that.  This
means that universal builds might successfully build, but the binaries
would never actually run correctly on the 'opposite' arch.

This check was added because of a bug in the intial implementation of
this detection in autoconf, which was inappropriately identifying
non-macos compilers as 'universal'.  That was hitting ppc64 systems.
See https://bugzilla.redhat.com/show_bug.cgi?id=449944 for more info.

Commit b0e687ef42e21b1eb7af18c4eaebcd41b0bd5632 in autoconf ("Limit
AC_C_BIGENDIAN univeral checks to Mac OS X") solved this issue in 2008,
so let's remove our workaround.  For good measure, if we detect
"universal" in the result, error out.

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

9 years agoUpdated Brazilian Portuguese translation
Rafael Ferreira [Fri, 9 Jan 2015 01:49:13 +0000 (01:49 +0000)]
Updated Brazilian Portuguese translation

9 years agoWin32: Update Pre-configured Config Headers
Chun-wei Fan [Wed, 7 Jan 2015 01:59:47 +0000 (09:59 +0800)]
Win32: Update Pre-configured Config Headers

Update config.h.win32.in and glibconfig.h.win32.in so that they will be
in-line with the ones that are produced with configure.ac, for use on
Windows builds.

Thanks to Philip Withnall for pointing out the changes needed to update
glibconfig.h.win32.in in bug 727829.

9 years agognetworkmonitornm: Prevent crash
Timm Bäder [Mon, 5 Jan 2015 10:51:46 +0000 (11:51 +0100)]
gnetworkmonitornm: Prevent crash

g_dbus_proxy_get_cached_property_names can return NULL if there are no
cached properties, so don't try to access them in that case.

9 years agoFix GContentType usage
TingPing [Sat, 16 Aug 2014 08:47:46 +0000 (04:47 -0400)]
Fix GContentType usage

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

9 years agoFix a typo
Matthias Clasen [Wed, 24 Dec 2014 00:49:27 +0000 (19:49 -0500)]
Fix a typo

9 years agoFix document typo
Erick Pérez Castellanos [Sun, 21 Dec 2014 16:08:39 +0000 (11:08 -0500)]
Fix document typo

This one was making syntax highlighting fail.

9 years agoSilence the build some more
Matthias Clasen [Sun, 21 Dec 2014 02:32:53 +0000 (21:32 -0500)]
Silence the build some more

9 years agogobject: don't use G_STRLOC in G_OBJECT_WARN_INVALID_PSPEC() macro
Thomas Haller [Wed, 17 Dec 2014 09:00:35 +0000 (10:00 +0100)]
gobject: don't use G_STRLOC in G_OBJECT_WARN_INVALID_PSPEC() macro

Using G_STRLOC ends up embedding unique strings of the form
__FILE__:__LINE__ in the compiled binary. We can avoid these
by passing __FILE__ and __LINE__ separately when constructing
the warning text.
This probably reduces the size of the binary as __FILE__ is
likely already contained as string otherwise.

Note that for GCC 2.x this changes behavior because G_STRLOC
also contained __PRETTY_FUNCTION__.

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

9 years agogobject: Add g_set_object() convenience function to set GObject pointers
Philip Withnall [Tue, 16 Dec 2014 11:29:03 +0000 (11:29 +0000)]
gobject: Add g_set_object() convenience function to set GObject pointers

Along the same lines as g_clear_object(), g_set_object() is a
convenience function to update a GObject pointer, handling reference
counting transparently and correctly.

Specifically, it handles the case where a pointer is set to its current
value. If handled naïvely, that could result in the object instance
being finalised. In the following code, that happens when
(my_obj == new_value) and the object has a single reference:
    g_clear_object (&my_obj);
    my_obj = g_object_ref (new_value);

It also simplifies boilerplate code such as set_property()
implementations, which are otherwise long and boring.

Test cases included.

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

9 years agogfile: Explain nonobvious use of my_error
Philip Chimento [Tue, 2 Dec 2014 17:34:30 +0000 (12:34 -0500)]
gfile: Explain nonobvious use of my_error

In g_file_make_directory_with_parents(), the my_error variable is used
for several different purposes throughout the whole function, not all of
which are obvious. This explains the situation with some comments.

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

9 years agogfile: Use g_error_matches
Philip Chimento [Wed, 4 Dec 2013 02:51:51 +0000 (18:51 -0800)]
gfile: Use g_error_matches

Make proper use of g_error_matches() instead of comparing only error codes.

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

9 years agogfile: make_directory_with_parents race condition
Philip Chimento [Thu, 28 Nov 2013 01:43:18 +0000 (17:43 -0800)]
gfile: make_directory_with_parents race condition

A race condition could cause g_file_make_directory_with_parents() to
fail with G_IO_ERROR_EXISTS despite the requested directory not
existing.

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