Commit Graph

15345 Commits

Author SHA1 Message Date
Ryan Lortie
ae52ab3d11 GOption: add strict posix mode
Add a "posixly correct" mode to GOption to stop parsing arguments as
soon as the first non-option argument is encountered.

We determine the default value on the basis of duplicating the behaviour
of the system getopt() implementation (which we directly check the
behaviour of at runtime).  On GNU systems this allows the user to modify
our behaviour using POSIXLY_CORRECT.

The user can change the value by g_option_context_set_strict_posix(),
which might be useful for some usecases of GOptionContext (as mentioned
in the doc string of this new function).

https://bugzilla.gnome.org/show_bug.cgi?id=723160
2014-10-15 23:37:45 +02:00
Matthias Clasen
f2786908a8 GApplication: Plug a memory leak
We were not freeing resource_path.
2014-10-14 23:22:14 -04:00
Jasper St. Pierre
5a0a85e444 gdesktopappinfo: Fix copy/paste typo from e24e89b
Commit e24e89b accidentally ironically introduced a typo when replacing
the code with symbolic contents. Specifically, "Added Associations" was
replaced with "Default Applications" when reading defaults.list, giving
a warning about the file containing a "Default Applications" group.

If this was intended, it should have not been lumped in with a cleanup.
2014-10-14 19:17:53 -07:00
Benjamin Otte
e054bbfe16 gfile: Clarify docs
Clarify corner cases that were unclear while reviewing a GTK patch.
2014-10-12 01:57:02 +02:00
Benjamin Otte
6e994d0656 Bump version to 2.43.0
We have new API.
2014-10-12 01:29:27 +02:00
Benjamin Otte
36d8b941d4 signal: Keep only one list of emissions
There is no need to keep 2 lists.

This simplifies the code and gets rid of the only user inside glib of
G_HAVE_GROWING_STACK.

https://bugzilla.gnome.org/show_bug.cgi?id=736284
2014-10-12 00:27:06 +02:00
Matthias Clasen
58ec89ea7c Fix a return_if_fail confusion
This slipped through my editing of the patch.
2014-10-11 15:53:13 -04:00
Owen W. Taylor
011bf876e7 Add simple instance count facility
Add GOBJECT_DEBUG=instance-count which enables internal accounting
of the number of instances of each GType, and g_type_get_instance_count()
to retrieve the result.

https://bugzilla.gnome.org/show_bug.cgi?id=354457
2014-10-11 13:54:29 -04:00
Krasimir Chonov
aa401aef87 Updated Bulgarian translation 2014-10-11 08:19:43 +03:00
Matthias Clasen
26c66ab1b9 Clarify g_propagate_error docs
I just ran into a bug that was caused by having src being a
persistent GError* that was not cleared after propagating it.
2014-10-10 14:17:56 -04:00
Benjamin Gilbert
0bfea5e772 Fix g_cond_timed_wait() timeout with !CLOCK_MONOTONIC
g_get_monotonic_time() and g_get_real_time() now always use different
clocks, so we cannot avoid correcting for their offset.  Fixes failure
to time out on Mac OS X.

https://bugzilla.gnome.org/show_bug.cgi?id=738197
2014-10-10 06:41:55 -04:00
Aleksander Morgado
549e7b0de6 garray: initialize allocated size in g_byte_array_new_take()
Internal allocation size (array->alloc) was being kept to 0 when a new
GByteArray was created from an already existing heap-allocated buffer.

Among other things, this was making g_byte_array_set_size() fully clear all
the buffer contents (not just the newly allocated memory) when
G_DEBUG=gc-friendly was being used...

  if (G_UNLIKELY (g_mem_gc_friendly))
    memset (array->data + array->alloc, 0, want_alloc - array->alloc);

https://bugzilla.gnome.org/show_bug.cgi?id=738170
2014-10-08 20:51:47 +02:00
Matthias Clasen
de82b641b0 Add advice on g_cancellable_reset
Don't use it at home.
2014-10-06 22:41:06 -04:00
Aleix Conchillo Flaqué
da053e345b tlscertificate: add support for certificate chains
This patch changes the behavior of the following functions:

   g_tls_certificate_new_from_pem
   g_tls_certificate_new_from_file
   g_tls_certificate_new_from_files

If more than one certificate is found it will try to load the chain.

It is assumed that the chain will be in the right order (top-level
certificate will be the last one in the file). If the chain cannot be
verified, the first certificate in the file will be returned as before.

https://bugzilla.gnome.org/show_bug.cgi?id=729739
2014-10-06 10:19:48 -07:00
Michael Catanzaro
4454b81536 Fix typo 2014-10-05 12:11:21 -05:00
Milo Casagrande
6cd13d34fe Updated Italian translation 2014-10-05 13:07:12 +00:00
Matthias Clasen
5cbc94d829 GDataSet: Add more tests
These tests exercise the NULL key fix from the previous commit.
2014-10-02 14:41:01 -04:00
Matthias Clasen
f6a9d04796 GDataSet: silently accept NULL/0 as keys
This used to be the behaviour before we made these functions
threadsafe; keep it that way.

https://bugzilla.gnome.org/show_bug.cgi?id=737741
2014-10-02 14:40:16 -04:00
Bastien Nocera
e24e89bc07 gdesktopappinfo: Use symbolic names in the code
We have #defines for the key file groups, so use them to avoid typos.

https://bugzilla.gnome.org/show_bug.cgi?id=736273
2014-09-30 14:41:43 +02:00
Ting-Wei Lan
45344f3622 GCredentials: Fix ABI break when adding NetBSD support
https://bugzilla.gnome.org/show_bug.cgi?id=728256
2014-09-30 00:42:00 +08:00
Ryan Lortie
682bca0950 Add version macros for 2.44 2014-09-29 11:40:10 -04:00
Philip Withnall
a4612a922b tests: Fix some minor leaks in the unit tests
https://bugzilla.gnome.org/show_bug.cgi?id=737446
2014-09-27 10:30:39 +01:00
Sébastien Wilmet
cb2c6eef0a gslist: indentation fix 2014-09-27 00:04:55 +02:00
Sébastien Wilmet
66ef10eec9 docs: syntax highlighting for the code examples
In the sections Concepts, Tools and Tutorial.

https://bugzilla.gnome.org/show_bug.cgi?id=736914
2014-09-26 23:36:26 +02:00
Philip Withnall
1c6df7aaeb gmain: Unref child sources when finalising a GSource
If a GSource is created, *not* attached to a GMainContext, and then has
child sources added, dropping the last reference to the parent GSource
will leak its references to its child sources. Currently, child sources
are only unreffed when g_source_destroy() is called on the parent.

https://bugzilla.gnome.org/show_bug.cgi?id=737338
2014-09-25 13:59:25 +01:00
Philip Withnall
eaca86801e gmain: Fix some signed/unsigned integer comparisons
Just to shut gcc up.

https://bugzilla.gnome.org/show_bug.cgi?id=737338
2014-09-25 09:52:50 +01:00
Sweta Kothari
42d0dc363e Updated gujarati translations 2014-09-24 23:09:32 +05:30
Krishnababu Krothapalli
0ab9d66b05 Updated Telugu translation 2014-09-23 14:28:34 +00:00
Hib Eris
e1b84e3296 Include <stdint.h> in glib/valgrind.h
This ensures the uintptr_t type is defined on mingw-w64.

Fixes compile error:

make[4]: Entering directory
`/home/abuild/rpmbuild/BUILD/glib-2.42.0/gobject'
  CC       libgobject_2_0_la-gtype.lo
In file included from gtype.c:24:0:
../glib/valgrind.h: In function 'VALGRIND_PRINTF':
../glib/valgrind.h:5601:4: error: unknown type name 'uintptr_t'
    uintptr_t _qzz_res;
    ^

https://bugzilla.gnome.org/show_bug.cgi?id=737143
2014-09-23 09:08:16 -04:00
Saibal Ray
f5ed7d2d3e Updated Bengali (India) translation 2014-09-23 11:27:44 +00:00
Philip Withnall
f41ebebd34 gtask: Ignore errors from g_thread_pool_push()
g_thread_pool_push() only returns an error if it fails to spawn a new
thread. However, it unconditionally adds the task to its worker queue,
so:
 • if _any_ threads exist in the pool, the task will eventually be
   handled; and
 • if _no_ threads exist in the pool, the task will be handled if one
   is eventually successfully spawned.
If no more threads are ever spawned, the process probably has bigger
problems than a single GTask which is taking forever to complete.

https://bugzilla.gnome.org/show_bug.cgi?id=736806
2014-09-23 08:08:45 +01:00
Philip Withnall
925913d8dd gtask: Document signal handler reference counting
Explain why the signal handler holds a reference to the GTask, even
though that causes a reference loop at first glance.

https://bugzilla.gnome.org/show_bug.cgi?id=736806
2014-09-23 08:08:25 +01:00
Philip Withnall
c6838ffaa1 gtask: Fix a signed/unsigned integer comparison
The GSource times assigned to creation_time are always signed.

https://bugzilla.gnome.org/show_bug.cgi?id=736806
2014-09-23 08:08:25 +01:00
Ryan Lortie
26a240fd10 GLib 2.42.0 2014-09-22 13:15:17 -04:00
A S Alam
c8d884da43 update Punjabi Translation for 3.14 release 2014-09-21 08:52:43 -05:00
Rajesh Ranjan
db41a84239 Updated Hindi translation 2014-09-21 04:14:06 +00:00
YunQiang Su
d3c65dcbba Revert "update zh_CN translation"
Add wrong po file
This reverts commit ee3d55573f.
2014-09-21 10:58:01 +08:00
YunQiang Su
ee3d55573f update zh_CN translation 2014-09-21 10:30:53 +08:00
Tong Hui
f550be0c6a update zh_CN translation 2014-09-21 10:24:22 +08:00
Ask H. Larsen
a2d4a612c6 Updated Danish translation 2014-09-20 17:19:18 +02:00
Ryan Lortie
dceff8fc2c gmain: improve g_source_set_name thread safety
Step up thread safety on g_source_set_name() to the same standard as all
other GSource functions: after we are attached to a main context, this
function should be threadsafe.

https://bugzilla.gnome.org/show_bug.cgi?id=736683
2014-09-19 13:39:00 -04:00
Ryan Lortie
1cbdbef772 gsource: clarify restrictions on non-existant IDs
Document that one must not use the "by id" source APIs with non-existent
IDs.  The real justification behind this restriction is that the reuse
of source ids makes it unsafe to call these functions unless you're
absolutely sure that the source exists and it belongs to you.  If you
call one of these functions on a source that may already have been
removed then you run the risk of finding someone else's source (with
your reused id).

This also bails us out of a slightly tricky situation with respect to
the threadsafety of g_main_context_find_source_by_id().  The fact that
this function doesn't return a reference implies that its return value
cannot be safely accessed unless we already know for sure that a
reference is being held elsewhere (by example, by the main context
itself if we know that the source has not been removed).  The function
itself, however, performs an access to the value, which could result in
a crash.

If we mandate that it is only valid to call this function on
known-to-exist source IDs then we dodge this problem.

https://bugzilla.gnome.org/show_bug.cgi?id=736683
2014-09-19 13:39:00 -04:00
Simon McVittie
7db1baf590 GVariant: say that serialized form needs an out-of-band length
This confused me for a while, because it isn't the same as D-Bus.
Like GVariant, the D-Bus serialization needs an out-of-band
endianness and type indicator, but unlike GVariant, serialized
D-Bus objects encapsulate their own length (often by starting with
a byte-count). This does come at some redundancy cost, so I can see
why the more efficient GVariant format does this the way it does;
but it's a difference between D-Bus and GVariant that seems worth
calling out.

It's also relevant for the designers of file or message-framing
formats: with D-Bus serialization it would be feasible to say "the file
starts with a little-endian D-Bus variant, followed by...",
but in GVariant you wouldn't be able to deserialize the variant
unless you either assume that it extends to end-of-file, or have
an explicit length.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=736975
Reviewed-by: Ryan Lortie
2014-09-19 16:58:23 +01:00
Matthias Clasen
174ebaefcc gresource: Make extract work better
When no section is specified, look for the resource to extract
in all sections - previously, we would stop after the first
section.
2014-09-18 15:26:36 -04:00
Matthias Clasen
5c951e5b04 gresource: Use GError in more places
The API gives us an error message, lets use it.
2014-09-18 14:52:03 -04:00
Sébastien Wilmet
dfaaf37338 Update URLs library.gnome.org -> developer.gnome.org 2014-09-18 20:32:43 +02:00
Мирослав Николић
4fb9421528 Updated Serbian translation 2014-09-17 21:11:50 +02:00
Sandeep Sheshrao Shedmake
5486481fab Updated Marathi Translations 2014-09-17 10:30:43 +05:30
Jasper St. Pierre
38a0614225 GApplication:handle-local-options: document return value
The return value for this signal was documented in the prose, but not
properly in a Returns: stanza.  Fix that.
2014-09-16 17:49:49 -04:00
Jasper St. Pierre
8061694c49 goption: Add G_OPTION_FLAG_NONE
This is helpful to better document code, as G_OPTION_FLAG_NONE is more
readable than 0.
2014-09-16 17:49:40 -04:00