platform/upstream/glib.git
10 years agogio/test/resources.c: Fix for Windows
Chun-wei Fan [Tue, 29 Oct 2013 11:17:32 +0000 (19:17 +0800)]
gio/test/resources.c: Fix for Windows

We need to use g_content_type_get_mime_type() to look up the mime type of
the file from the registry on the content type that was acquired on
Windows, as g_file_info_get_content_type() does not acquire the
file mime type (unlike on *NIX).

g_content_type_get_mime_type() on *NIX is more or less an no-op as it
simply returns the g_strdup()-ed version of the passed-in content type.

This will enable the resources test to pass on Windows.

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

10 years agogmain: make g_source_add_child_source() thread safe
Ognyan Tonchev [Tue, 29 Oct 2013 15:39:38 +0000 (16:39 +0100)]
gmain: make g_source_add_child_source() thread safe

g_source_add_child_source() releases the context lock before attaching
child_source to context. And this causes trouble if parent source is
blocked and g_main_dispatch() manages to lock the context mutex and call
unblock_source() before child_source gets attached to context.
To fix this we call g_source_attach_unlocked() before releasing the
context mutex.

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

10 years agogio: Don't allow skipping past the end of GLocalFileInputStream
Ross Lagerwall [Tue, 29 Oct 2013 04:02:59 +0000 (06:02 +0200)]
gio: Don't allow skipping past the end of GLocalFileInputStream

The overridden implementation of the skip method for
GLocalFileInputStream allows skipping past the end of the file which is
inconsistent with the documentation.  Prevent this by first seeking to
the end of the file and then seeking backwards from there as much as
is necessary.

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

10 years agogmacros.h: fix C99 check
Dan Winship [Sat, 2 Nov 2013 16:18:45 +0000 (12:18 -0400)]
gmacros.h: fix C99 check

G_STRFUNC was checking __STDC_VERSION__ against the wrong value
(though it didn't actually matter, since __STDC_VERSION__ wasn't
defined in C90, so the check still only matched C99 and above anyway).

10 years agoUpdated Galician translations
Fran Diéguez [Fri, 1 Nov 2013 11:52:43 +0000 (12:52 +0100)]
Updated Galician translations

10 years agoUpdated Galician translations
Fran Diéguez [Mon, 28 Oct 2013 00:13:41 +0000 (01:13 +0100)]
Updated Galician translations

10 years agoUpdated Spanish translation
Daniel Mustieles [Thu, 31 Oct 2013 13:36:50 +0000 (14:36 +0100)]
Updated Spanish translation

10 years agodocs: GDataTime: *_add_*(): Mention that you can subtract.
Murray Cumming [Thu, 31 Oct 2013 12:15:01 +0000 (13:15 +0100)]
docs: GDataTime: *_add_*(): Mention that you can subtract.

Because this was not obvious to at least one person on irc.

10 years agogio: Clean up trashinfo file if trashing fails
Ross Lagerwall [Wed, 30 Oct 2013 18:34:14 +0000 (20:34 +0200)]
gio: Clean up trashinfo file if trashing fails

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

10 years agoTests: It is useless to unset "DBUS_SESSION_BUS_ADDRESS" manually
Xavier Claessens [Mon, 28 Oct 2013 21:02:44 +0000 (17:02 -0400)]
Tests: It is useless to unset "DBUS_SESSION_BUS_ADDRESS" manually

If the goal is to make sure we don't have a dbus connection, it has
to call g_test_dbus_unset() instead which is much more complete.

In this case, g_test_dbus_unset() is called already, so it should be
fine.

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

10 years agoGTestDBus: Make sure only DBUS_SESSION_BUS_ADDRESS is set by default
Xavier Claessens [Mon, 28 Oct 2013 18:54:22 +0000 (14:54 -0400)]
GTestDBus: Make sure only DBUS_SESSION_BUS_ADDRESS is set by default

g_test_dbus_unset() now also unset DBUS_STARTER_ADDRESS and
DBUS_STARTER_BUS_TYPE.

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

10 years agoTests: add session_bus_run() and use it where possible
Xavier Claessens [Mon, 28 Oct 2013 21:18:54 +0000 (17:18 -0400)]
Tests: add session_bus_run() and use it where possible

This is to avoid having again the subtil bug in dbus-appinfo.c:
session_bus_down() was called before g_test_run() so the test was
running on the user's dbus session.

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

10 years agotests/gdbus-introspection: Add a less trivial test case for _IGNORE_QUALIFIED
Colin Walters [Tue, 29 Oct 2013 13:47:34 +0000 (09:47 -0400)]
tests/gdbus-introspection: Add a less trivial test case for _IGNORE_QUALIFIED

This is distilled from PackageKit which currently aborts on startup.

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

10 years agoGMarkup: clear attributes on ignorned tags
Ryan Lortie [Tue, 29 Oct 2013 16:01:32 +0000 (09:01 -0700)]
GMarkup: clear attributes on ignorned tags

Make sure that if we ignore a tag then we also clear the attributes that
we already collected so that they don't end up on the next unignored tag
opening.

Also add some extra brackets for clarity (it doesn't make any difference
-- I just think it reads nicer this way).

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

10 years agogtk-notification-backend: remove unused variable
Lars Uebernickel [Tue, 29 Oct 2013 06:55:19 +0000 (23:55 -0700)]
gtk-notification-backend: remove unused variable

A reference to the session bus is now stored in GNotificationBackend.
Remove the extraneous one in the gtk backend and stop using it in
withdraw_notification.

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

10 years agogio: Clear error properly to prevent crash
Ross Lagerwall [Tue, 29 Oct 2013 12:53:38 +0000 (14:53 +0200)]
gio: Clear error properly to prevent crash

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

10 years agoGCancellable: drop lock for callback during connect()
Ryan Lortie [Mon, 28 Oct 2013 18:44:16 +0000 (11:44 -0700)]
GCancellable: drop lock for callback during connect()

Don't hold the lock when calling the user's callback during
g_cancellable_connect() for the case that the cancellable has already
fired.

Taken from a patch by Alex Larsson.

Doc updates from Colin Walters.

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

10 years agogio/gsubprocess.c: Use g_snprintf()
Chun-wei Fan [Tue, 29 Oct 2013 06:49:13 +0000 (14:49 +0800)]
gio/gsubprocess.c: Use g_snprintf()

snprintf() is unfortunately still not universally available, so use
g_snprintf() to ensure the build works on all platforms.

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

10 years agogobject/gvaluetransform.c: Cleanup #ifndef _MSC_VER
Chun-wei Fan [Tue, 29 Oct 2013 04:46:32 +0000 (12:46 +0800)]
gobject/gvaluetransform.c: Cleanup #ifndef _MSC_VER

The two casts that were unsupported with Visual Studio is now properly
supported, so build this code like how the other compilers build the code.

10 years agoGSettingsSchemaSource: fix parameter name in header
Ryan Lortie [Tue, 29 Oct 2013 03:48:53 +0000 (20:48 -0700)]
GSettingsSchemaSource: fix parameter name in header

list_schemas() had the parameters called 'recursive' and 'non-recursive'
in the header instead of 'relocatable'.  Fix that.

10 years agoexporter: give error on Describe of missing action
Ryan Lortie [Mon, 28 Oct 2013 21:49:14 +0000 (14:49 -0700)]
exporter: give error on Describe of missing action

If someone calls org.gtk.Actions.Describe on a non-existent action then
return an exception instead of a trivial description (disabled, no
state, etc.).

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

10 years agoexporter: give error on Describe of missing action
Ryan Lortie [Mon, 28 Oct 2013 21:49:14 +0000 (14:49 -0700)]
exporter: give error on Describe of missing action

If someone calls org.gtk.Actions.Describe on a non-existent action then
return an exception instead of a trivial description (disabled, no
state, etc.).

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

10 years agoGSimpleAction: don't allow changing state type
Ryan Lortie [Mon, 28 Oct 2013 21:59:26 +0000 (14:59 -0700)]
GSimpleAction: don't allow changing state type

g_object_set() allowed us to bypass the usual checks that the state
doesn't change type and also leaked.

Fix that up by turning the state into a construct property (so that it
always gets set once during construction, even if only to NULL) and
then route the further sets through the C API so that they are subject
to the same checks.

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

10 years agoglib-compile-schemas: ignore qualified tags/attrs
Ryan Lortie [Mon, 28 Oct 2013 22:30:25 +0000 (15:30 -0700)]
glib-compile-schemas: ignore qualified tags/attrs

Ignore qualified (in the XML namespace sense) tags and attributes when
compiling GSettings schemas.

This will allow people to add custom tags and attributes to their schemas
without tripping up the compiler.

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

10 years agoGDBus: ignore qualified XML tags and attributes
Ryan Lortie [Mon, 28 Oct 2013 22:27:29 +0000 (15:27 -0700)]
GDBus: ignore qualified XML tags and attributes

Ignore qualified (in the XML namespace sense) tags and attributes when
parsing D-Bus introspection XML.

This will allow people to add custom tags and attributes to their D-Bus
interfaces without tripping up GDBus.

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

10 years agotests: add a ignore-qualified markup-collect case
Ryan Lortie [Mon, 28 Oct 2013 21:11:05 +0000 (14:11 -0700)]
tests: add a ignore-qualified markup-collect case

Add a case to markup-collect that exercises the new IGNORE_QUALIFIED
flag.

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

10 years agoGMarkup: add G_MARKUP_IGNORE_QUALIFIED
Ryan Lortie [Mon, 28 Oct 2013 21:05:51 +0000 (14:05 -0700)]
GMarkup: add G_MARKUP_IGNORE_QUALIFIED

Add a flag to GMarkupParserFlags to ignore qualified tags (along with
their contents) and attributes.

This will provide a nice way for some of our parsers (GDBus
introspection, GSettings schema, etc) to ignore additional tags that
users have added to their files, under a different namespace.

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

10 years agoGMarkup: share some common code for closing tags
Ryan Lortie [Mon, 28 Oct 2013 20:56:26 +0000 (13:56 -0700)]
GMarkup: share some common code for closing tags

The code for dealing with </foo> and the second half of <foo/> was
largely duplicated.  We can share a lot of it by using a common
function.

This slightly changes the behaviour of the parser under error
circumstances: previously the parser would deal with '<foo/}' by first
issuing the end_element callback and then flagging the error due to the
unexpected character.  Now we will flag the unexpected character error
first, skipping the callback.

This behaviour change required modifying the testsuite.

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

10 years agotest: g_debug messages shouldn't affect g_assert_expected_messages
Stef Walter [Mon, 28 Oct 2013 09:12:29 +0000 (10:12 +0100)]
test: g_debug messages shouldn't affect g_assert_expected_messages

Debug messages are meant to give insight into how a process is
proceeding, and are unpredictable in nature. They also often have
line numbers in them.

This patch ignores debug messages in g_test_assert_expected_messages().

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

10 years agoGSettings: fix for loop in 'extends' functionality
Ryan Lortie [Mon, 28 Oct 2013 19:10:13 +0000 (12:10 -0700)]
GSettings: fix for loop in 'extends' functionality

Obvious mistake :(

10 years agogsettings(1): stop using deprecated APIs
Ryan Lortie [Mon, 28 Oct 2013 17:54:08 +0000 (10:54 -0700)]
gsettings(1): stop using deprecated APIs

Stop using the recently-deprecated GSettings APIs.

Use the GSettingsSchema-based APIs instead.

This fixes a number of bugs and also a net reduction of code. In
particular, list-schemas will now work in context of a given --schemadir
argument.

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

10 years agogsettings(1): use global variables
Ryan Lortie [Mon, 28 Oct 2013 17:23:29 +0000 (10:23 -0700)]
gsettings(1): use global variables

The number of arguments passed to each function is about to increase, so
just use global variables instead.

This is a commandline tool, after all...

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

10 years agoGSettingsSchemaKey: add introspection APIs
Ryan Lortie [Mon, 28 Oct 2013 00:03:04 +0000 (17:03 -0700)]
GSettingsSchemaKey: add introspection APIs

Add g_settings_schema_has_key() and _get_range(), _range_check(),
_get_value_type(), _get_default_value() methods on GSettingsSchemaKey.

Deprecate the equivalent APIs on GSettings.

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

10 years agobump version
Ryan Lortie [Mon, 28 Oct 2013 17:23:29 +0000 (10:23 -0700)]
bump version

dconf needs the new version with read_user_value() on the backend API.

10 years agoGSettings: add getters for user/default value
Ryan Lortie [Sun, 27 Oct 2013 17:34:01 +0000 (10:34 -0700)]
GSettings: add getters for user/default value

Add two new APIs: g_settings_get_user_value() and
g_settings_get_default_value().   Together, these should allow the
inspection of all interesting cases of "is this key set?" and "what
would happen if I reset this key?"

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

10 years agoGSettings: small internal refactor
Ryan Lortie [Sun, 27 Oct 2013 17:33:08 +0000 (10:33 -0700)]
GSettings: small internal refactor

Add two boolean parameters to our internal getter utility function in
anticipation of the coming addition of g_settings_get_user_value() and
g_settings_get_default_value() APIs.

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

10 years agoGSettingsBackend: add read_user_value() API
Ryan Lortie [Sun, 27 Oct 2013 16:42:32 +0000 (09:42 -0700)]
GSettingsBackend: add read_user_value() API

This will get the 'user' value from the database (ie: the one that the user has
control over).

Provide a default implementation that chains to ->read().  That will work for
all of our internal backends which don't have a concept of layering or
lockdown.

The delayed backend implments "user value" by returning anything that's
in the changeset (incuding an explicit NULL) or chaining up otherwise.

We will use this for g_settings_get_user_value().

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

10 years agogio: Remove an unused variable from Makefile.am
Philip Withnall [Mon, 28 Oct 2013 17:07:49 +0000 (17:07 +0000)]
gio: Remove an unused variable from Makefile.am

RESOLVER_LIBADD was not defined anywhere (its functionality has
migrated to NETWORK_LIBS instead).

10 years agodocs: Mention that generated code should not be kept
Emmanuele Bassi [Mon, 14 Oct 2013 18:41:54 +0000 (19:41 +0100)]
docs: Mention that generated code should not be kept

Code generated by gdbus-codegen should neither be checked in into
revision control, nor should be distributed.

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

10 years agogdbus-codegen maintains ABI for type structures
Emmanuele Bassi [Mon, 14 Oct 2013 18:40:53 +0000 (19:40 +0100)]
gdbus-codegen maintains ABI for type structures

Make it explicit, to avoid changes that could potentially lead to
breakage in user code.

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

10 years agogdbus-codegen: Take into consideration MAX_ALLOWED for private data
Emmanuele Bassi [Mon, 14 Oct 2013 18:30:21 +0000 (19:30 +0100)]
gdbus-codegen: Take into consideration MAX_ALLOWED for private data

The G_ADD_PRIVATE() macro, and the auto-generated get_instance_private()
internal function, should be used conditionally depending on the maximum
allowed version of GLib, as defined by the GLIB_VERSION_MAX_ALLOWED
pre-processor symbol.

This allows generating code that can be compiled in projects that wish
to use an older API version of GLib through the use of the
GLIB_VERSION_MAX_ALLOWED symbol.

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

10 years agog_settings_schema_list: some fixes
Ryan Lortie [Mon, 28 Oct 2013 16:29:15 +0000 (09:29 -0700)]
g_settings_schema_list: some fixes

Prevent a crash in the case that gvdb_table_list() returns NULL (ie:
because a schema has no keys).

Stop a memory leak caused by pointlessly stealing keys from a hashtable
(after we quarked them already).

Stop allocating an extra entry at the end of an array for a terminator
(that we never wrote anyway) when all functions using this API refer to
the out-parameter length array.

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

10 years agoFix handling of icons in GNotification
Matthias Clasen [Mon, 28 Oct 2013 16:31:31 +0000 (12:31 -0400)]
Fix handling of icons in GNotification

The fdo backend was sending a uri where a file path
was expected.

10 years agoAdd a request_certificate virtual method to GTlsInteraction
Stef Walter [Wed, 28 Nov 2012 21:01:21 +0000 (22:01 +0100)]
Add a request_certificate virtual method to GTlsInteraction

This allows GTlsConnection implementations to request a certificate
from the user.

Fix ups by Dan Winship <danw@gnome.org>

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

10 years agoGKeyFileSettingsBackend: ignore file deletions
Matthew Barnes [Mon, 28 Oct 2013 00:26:33 +0000 (17:26 -0700)]
GKeyFileSettingsBackend: ignore file deletions

Ignore the keyfile being deleted (ie: by the user) instead of reporting
it to the application as all values being reverted back to their
originals.

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

10 years agoAdd test for extended schemas
Christian Persch [Mon, 28 Oct 2013 00:22:38 +0000 (17:22 -0700)]
Add test for extended schemas

The test checks that the keys of the base schema are all present in
the extended schema.

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

10 years agoGSettings: properly support 'extends'
Ryan Lortie [Mon, 28 Oct 2013 00:18:10 +0000 (17:18 -0700)]
GSettings: properly support 'extends'

Support the 'extends' attribute that has been supported by the compiler
for a long time by doing three things:

 - when creating a schema that extends another schema, lookup that other
   schema

 - when looking up keys and we can't find them in the schema, check
   (recursively) in the 'extends' schema

 - when listing all keys in a schema, also visit the extends schemas,
   but take care to avoid duplicates caused by overrides

Extend the testsuite to verify that it works.

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

10 years agogio: Fix typo in documentation
Ross Lagerwall [Fri, 25 Oct 2013 08:05:02 +0000 (10:05 +0200)]
gio: Fix typo in documentation

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

10 years agoAdd g_settings_schema_source_list_schemas()
Ryan Lortie [Sun, 27 Oct 2013 02:12:46 +0000 (19:12 -0700)]
Add g_settings_schema_source_list_schemas()

g_settings_list_schemas() and g_settings_list_relocatable_schemas() are
now deprecated.

This will allow listing off schemas on non-default sources and is a
better fit with the new direction the API is going.

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

10 years agogsubprocess: Add documentation about default input directions
Colin Walters [Sun, 27 Oct 2013 14:34:08 +0000 (10:34 -0400)]
gsubprocess: Add documentation about default input directions

10 years agogsubprocess: Fall back to plain F_DUPFD+fcntl for OS X <= Snow Lion
Colin Walters [Sun, 27 Oct 2013 14:21:13 +0000 (10:21 -0400)]
gsubprocess: Fall back to plain F_DUPFD+fcntl for OS X <= Snow Lion

Since it apparently doesn't have F_DUPFD_CLOEXEC.

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

10 years agoAdd a testcase for summary/description
Ryan Lortie [Sat, 26 Oct 2013 22:58:06 +0000 (18:58 -0400)]
Add a testcase for summary/description

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

10 years agoAdd g_settings_schema_key_get_summary/description
Ryan Lortie [Sat, 26 Oct 2013 22:57:55 +0000 (18:57 -0400)]
Add g_settings_schema_key_get_summary/description

Add an API to read the summary and description from the .xml schema
files.

This will be used by dconf-editor and gnome-tweak-tool.

This API is a bit heavy -- it parses the XML and builds a table.  It
also loads gettext domains for translation.  It only does these things
if it is used, however, so it will not impact normal applications.

We store the summary/description in a pair of hash tables on the schema
source (which we have a backref to as of a few commits ago).  We can't
use a global table because people might want to request summary and
description from non-default sources.  We don't want to use per-schema
tables because we'd have to reparse the directory every time (since we
cannot guess which file a schema may have been in).

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

10 years agoMake GSettingsSchemaKey public
Ryan Lortie [Sat, 26 Oct 2013 22:57:24 +0000 (18:57 -0400)]
Make GSettingsSchemaKey public

Take this private API and make it public along with a boxed type and
ref/unref functions.

Future commits will add accessors with new functionality and some that
allow us to deprecate functions on GSettings itself (such as
g_settings_get_range).

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

10 years agoGSettingsSchema: store a backref to the source
Ryan Lortie [Sat, 26 Oct 2013 22:50:39 +0000 (18:50 -0400)]
GSettingsSchema: store a backref to the source

Record in each GSettingsSchema object the source from which it came.

This will be useful in future commits.

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

10 years agoClean up GSettingsSchema logic
Ryan Lortie [Sat, 26 Oct 2013 22:49:58 +0000 (18:49 -0400)]
Clean up GSettingsSchema logic

The way we created the global schema list predates
g_settings_schema_source_new_from_directory() and therefore doesn't use
it.

Update it to use that function, removing some code.

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

10 years agotests: test g_hash_table_get_keys_as_array()
Ryan Lortie [Sun, 27 Oct 2013 16:24:40 +0000 (09:24 -0700)]
tests: test g_hash_table_get_keys_as_array()

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

10 years agoAdd g_hash_table_get_keys_as_array()
Ryan Lortie [Sun, 27 Oct 2013 01:48:42 +0000 (18:48 -0700)]
Add g_hash_table_get_keys_as_array()

Returns a %NULL-terminated array of the keys of a hashtable.

In the case that the hash table has strings for keys, this is actually a
gchar**.

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

10 years agogapplication: don't emit warnings for DBus calls
Giovanni Campagna [Fri, 25 Oct 2013 16:02:16 +0000 (18:02 +0200)]
gapplication: don't emit warnings for DBus calls

If a broken (or malicious) remote client calls Open or CommandLine
on a GApplication that does not implement those, return a DBus
error instead of going through and then emitting a warning.

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

10 years agogapplication: fix memory leak
Giovanni Campagna [Fri, 25 Oct 2013 16:01:51 +0000 (18:01 +0200)]
gapplication: fix memory leak

g_variant_get_child_value() returns a new GVariant, which we must
free.

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

10 years agowin32: use real random data for seed on win32
Ryan Lortie [Fri, 25 Oct 2013 16:22:42 +0000 (12:22 -0400)]
win32: use real random data for seed on win32

We can get cryptographically secure data from rand_s().

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

10 years agoAssamese translation updated
Nilamdyuti Goswami [Fri, 25 Oct 2013 07:14:48 +0000 (12:44 +0530)]
Assamese translation updated

10 years agoGLib 2.39.0 2.39.0
Ryan Lortie [Wed, 23 Oct 2013 19:09:07 +0000 (15:09 -0400)]
GLib 2.39.0

10 years agodocs: dist manpage gapplication.xml
Ryan Lortie [Thu, 24 Oct 2013 18:24:04 +0000 (14:24 -0400)]
docs: dist manpage gapplication.xml

10 years agotests: Add tests for the thumbnail verification code in GIO
Philip Withnall [Thu, 24 Oct 2013 11:09:27 +0000 (12:09 +0100)]
tests: Add tests for the thumbnail verification code in GIO

This code was added for use by the G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID
file attribute, but may end up being used elsewhere (e.g. in GVfs) as well.
As it’s dealing with untrusted external files, and the non-trivial PNG file
format, this commit adds several test cases to cover valid and invalid PNG
files.

The security model for the thumbnail verification code is that the user’s
cache directory is untrusted, and potentially any PNG file which is passed
to the verifier has been manipulated arbitrarily by an attacker.

This is a follow-up to commit fe7069749fe39a006985ec266260a3c02ee8c855.

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

10 years agoRevert "Use g_return_val_if_fail() for developer-only messages"
Colin Walters [Thu, 17 Oct 2013 20:57:10 +0000 (16:57 -0400)]
Revert "Use g_return_val_if_fail() for developer-only messages"

This reverts commit 00f0795a84d23f2e2654a86f8bd3a233c8af3771.

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

10 years agogsettings-tool: Add --version into general usage
Jiro Matsuzawa [Wed, 28 Aug 2013 16:05:29 +0000 (01:05 +0900)]
gsettings-tool: Add --version into general usage

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

10 years agoGSettings: verify path validity on constructors
Ryan Lortie [Wed, 23 Oct 2013 20:42:12 +0000 (16:42 -0400)]
GSettings: verify path validity on constructors

Don't allow constructing GSettings objects with invalid paths.

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

10 years agogthemedicon: Fallback to non-symbolic icons
Olivier Brunel [Tue, 8 Oct 2013 14:11:44 +0000 (16:11 +0200)]
gthemedicon: Fallback to non-symbolic icons

When doing fallback for symbolic icons, we first shorten the name at dashes
while preserving the -symbolic suffix. But after exhausting that, we should also
try stripping the suffix.

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

Signed-off-by: Olivier Brunel <jjk@jjacky.com>
https://bugzilla.gnome.org/show_bug.cgi?id=710254

10 years agogrand: Document this is not for cryptographic purposes
Colin Walters [Wed, 23 Oct 2013 20:41:09 +0000 (16:41 -0400)]
grand: Document this is not for cryptographic purposes

While this is obvious to seasoned experts upon inspection, it is
really worth documenting explicitly.

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

10 years agogdbus: Ensure message matching always succeeds against path_namespace='/'
Philip Withnall [Wed, 23 Oct 2013 14:45:15 +0000 (15:45 +0100)]
gdbus: Ensure message matching always succeeds against path_namespace='/'

This copies the fix from upstream D-Bus bug
https://bugs.freedesktop.org/show_bug.cgi?id=70799 to the GDBusDaemon
implementation, ensuring that matching against path_namespace='/' succeeds
for all keys (i.e. it’s a no-op).

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

10 years agogtester: only remove source if not already dead
Ryan Lortie [Wed, 23 Oct 2013 18:17:48 +0000 (14:17 -0400)]
gtester: only remove source if not already dead

Don't attempt to g_source_remove() a source for which we already returned FALSE
from the handler.

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

10 years agotests: expect critical on failure to remove source
Ryan Lortie [Wed, 23 Oct 2013 15:10:00 +0000 (11:10 -0400)]
tests: expect critical on failure to remove source

We've added a g_critical() on failure to remove sources, so make sure we
expect to see that (instead of failing the test due to the unexpected
message).

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

10 years agogmain: test g_source_remove() with invalid ID
Ryan Lortie [Wed, 23 Oct 2013 15:04:01 +0000 (11:04 -0400)]
gmain: test g_source_remove() with invalid ID

Make sure we get the proper critical displayed.

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

10 years agogmain: Warn when g_source_remove() fails
Bastien Nocera [Wed, 23 Oct 2013 13:38:58 +0000 (15:38 +0200)]
gmain: Warn when g_source_remove() fails

Trying to remove a non-existent source should really be
a programming error, as the programmer could be trying to
use the wrong function to remove a callback, as seen when
GtkScrolledWindow tried to remove ID from another function
using g_source_remove().

See https://bugzilla.gnome.org/show_bug.cgi?id=710666#c12

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

10 years agofile-info: Add a G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID attribute
Ryan Lortie [Fri, 11 Oct 2013 10:22:31 +0000 (11:22 +0100)]
file-info: Add a G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID attribute

This indicates whether the thumbnail (given by G_FILE_ATTRIBUTE_THUMBNAIL_PATH)
is valid — i.e. to represent the file in its current state. If
G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID is FALSE (for a normal _or_ failed
thumbnail) it means the file has changed since the thumbnail was generated, and
the thumbnail is out of date.

Part of checking thumbnail validity (by the spec) involves parsing
headers out of the thumbnail .png so we include some (small) code to do
that in a separate file.  We will likely want to copy this code to gvfs
to do the same for GVfsFile.

Heavily based on a patch from Philip Withnall <philip.withnall@collabora.co.uk>
who suggested the feature and designed the API.

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

10 years agoGMemoryOutputStream: docs and whitespace fixes
Ryan Lortie [Tue, 22 Oct 2013 19:51:15 +0000 (15:51 -0400)]
GMemoryOutputStream: docs and whitespace fixes

Document the difference between resizable and fixed-sized streams,
particularly with regards to sizing and seeking.

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

10 years agoGMemoryOutputStream: improve seek tests
Ryan Lortie [Tue, 22 Oct 2013 20:15:29 +0000 (16:15 -0400)]
GMemoryOutputStream: improve seek tests

Improve test coverage for testing seeking on fixed vs. resizable
GMemoryOutputStream.

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

10 years agoChange semantics of seek on memory output stream
Ryan Lortie [Wed, 23 Oct 2013 15:25:56 +0000 (11:25 -0400)]
Change semantics of seek on memory output stream

It is our intention that memory output streams should operate in two
distinct modes, depending on if a realloc function was provided or not.

In the case that we have a realloc function (resizable mode), we want
the stream to behave as if it were a file that started out empty.  In
the case that we don't have a realloc function (fixed-sized mode), we
want the stream to behave as a block device would.

To this end, we introduce two changes in functionality:

 - seeking to SEEK_END on a resizable stream will now seek to the end of
   the valid data region, not to the end of the allocated memory (which
   is really just an implementation detail)

 - seeks past the end of the allocated memory size are now permitted,
   but only on resizable streams.  The next write will grow the buffer
   (inserting zeros between).

Some tweaks to testcases were required in order not to break the build,
which indicates that this is an API break, but it seems unlikely that
anyone will be effected by these changes 'in the real world'.

Updates to documentation and further testcases are in following commits.

Based on a patch from Maciej Piechotka <uzytkownik2@gmail.com>.

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

10 years agoGSeekable: document seek-past-end semantics
Ryan Lortie [Tue, 22 Oct 2013 19:01:16 +0000 (15:01 -0400)]
GSeekable: document seek-past-end semantics

Introduce the concept of "fixed" vs. "resizable" streams and document
how g_seekable_seek() works for each case.

We don't include g_seekable_is_fixed_size() at this point because we
don't know if anyone would require it.  This may appear in the future if
someone asks for it, however.

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

10 years agogdbus: Work around a D-Bus bug with path_namespace='/' match rules
Philip Withnall [Wed, 23 Oct 2013 14:07:46 +0000 (15:07 +0100)]
gdbus: Work around a D-Bus bug with path_namespace='/' match rules

D-Bus versions < 1.6.18 (i.e. all current versions) have a bug with the
path_namespace='/' match rule key. It should conceptually match everything,
but actually matches nothing. This results in no property change (or other)
signals being forwarded to the D-Bus client.

The work-around implemented in GDBusObjectManagerClient is to remove the
path_namespace match key if its value is ‘/’.

For the upstream D-Bus bug, see:
https://bugs.freedesktop.org/show_bug.cgi?id=70799

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

10 years agog_file_error_from_errno: Remove unneeded breaks
Bastien Nocera [Fri, 18 Oct 2013 12:37:31 +0000 (14:37 +0200)]
g_file_error_from_errno: Remove unneeded breaks

Just wasting space

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

10 years agoGKeyfile: don't leak on failed get_(u)int64
Ryan Lortie [Tue, 22 Oct 2013 20:24:41 +0000 (16:24 -0400)]
GKeyfile: don't leak on failed get_(u)int64

In the case that g_key_file_get_(u)int64 fails to parse the integer,
make sure we free the string before returning.

Reported by Andrew Stone <astonecc@gmail.com>

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

10 years agogobject: simplify object-in-construction handling
Dan Winship [Sun, 20 Oct 2013 13:27:11 +0000 (09:27 -0400)]
gobject: simplify object-in-construction handling

Rather than keeping a global list of objects that are being
constructed, use qdata on the object itself like we do with several
other properties now.

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

10 years agogobject: forbid finalization-during-construction
Dan Winship [Mon, 29 Apr 2013 17:04:11 +0000 (13:04 -0400)]
gobject: forbid finalization-during-construction

If a constructor() implementation created an object but then unreffed
it rather than returning it, that object would get left on the
construction_objects list, which would cause problems later when that
memory location got reused by another object.

"Fix" this by making it fail intentionally, and add a test for it (and
for the normal, working singleton case).

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

10 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.

10 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...

10 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.

10 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.

10 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

10 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

10 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

10 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

10 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

10 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.

10 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

10 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

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

10 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

10 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