Commit Graph

14689 Commits

Author SHA1 Message Date
Shantha kumar
67b0afd5fd Tamil Translations Updated 2014-01-30 15:03:08 +05:30
Matthias Clasen
8548d16add Drop a no-longer-existing example from the docs
gapplication-example-menu.c was dropped in
0c094d6607, two years ago.
Time to remove its inclusion in the docs too.

https://bugzilla.gnome.org/show_bug.cgi?id=722973
2014-01-25 18:19:58 -05:00
Rico Tzschichholz
ee38a1af80 gobject: Add missing transfer annotation to g_boxed_copy 2014-01-23 17:22:19 +01:00
Rico Tzschichholz
46e13e5d49 gio: Add missing transfer annotation to g_simple_proxy_resolver_new 2014-01-23 17:21:32 +01:00
Chun-wei Fan
c5e989c6d8 glib/goption.c: Fix build on MSVC
Use #ifdef rather than #if, as MSVC does not like #if <macro> without
parens, and this is the normal usage in other cases like this.
2014-01-23 17:32:50 +08:00
William Jon McCann
1c8035066e glib: annotate some memory functions with allow-none 2014-01-22 17:51:12 -05:00
Nilamdyuti Goswami
f37439c1b1 Assamese translation updated 2014-01-22 22:25:26 +05:30
Rico Tzschichholz
5ca9bee524 gio: Fix some header/source parameter-naming mismatches 2014-01-22 14:21:41 +01:00
Rico Tzschichholz
cd86c0243c gsubprocess: Add missing transfer annotations to get_*_pipe() 2014-01-22 14:06:10 +01:00
Ryan Lortie
829464a3c7 test default GSimpleAction activation
Test the default handling of the "activate" signal on GSimpleAction.

https://bugzilla.gnome.org/show_bug.cgi?id=722503
2014-01-21 15:15:38 -05:00
Jasper St. Pierre
a497ad889e strfuncs: Make g_str_tokenize_and_fold introspectable 2014-01-21 12:08:07 -05:00
Jasper St. Pierre
ea22300620 gsettings: Fix annotations 2014-01-21 12:00:41 -05:00
Emmanuele Bassi
460e3e9d01 docs: Add missing GTest functions
The GTest message API is missing from the reference.
2014-01-20 20:03:40 +00:00
Chun-wei Fan
2cb9b8f994 glib/gtimezone.c: Check the size of tzi.DaylightName
We need to re-get the size of tzi.DaylightName before we call
RegQueryValue() because the buffer might not have enough room to hold the
value for tzi.DaylightName that would be acquired by RegQueryValueExA(),
even though the size of tzi.DaylightName and tzi.StandardName is the same.

This is a pitfall of RegQueryValue()[1] as not doing this can result in an
ERROR_MORE_DATA (234) failure, causing the acquisition of tzi.DaylightName
to fail.

This will fix the gdatetime/equal test, amongst some other tests in
gdatetime, at least on certain non-English version of Windows.

[1]: http://social.msdn.microsoft.com/Forums/vstudio/en-US/84f90854-e90c-4b63-8fc1-655a0b4645fd/regqueryvalueex-returns-errormoredata

https://bugzilla.gnome.org/show_bug.cgi?id=719344
2014-01-20 10:22:47 -05:00
Matthias Clasen
2330f7e65e Use __asm__ instead of asm
This is a little more robust as various compiler flags make
gcc forget about asm.

https://bugzilla.gnome.org/show_bug.cgi?id=693299
2014-01-20 08:43:02 -05:00
Matthias Clasen
ff9a61eed9 Fix CFLAGS manipulation
The code for ensuring that CFLAGS contain -g if
--enable-debug has been specified did not work right.

https://bugzilla.gnome.org/show_bug.cgi?id=685204
2014-01-20 08:16:09 -05:00
Matthias Clasen
fc6d6b6e10 GAction: remove a lie
Not only was the link to GtkAction broken, it is not true.

https://bugzilla.gnome.org/show_bug.cgi?id=722591
2014-01-20 07:37:42 -05:00
Matthias Clasen
93cda800f1 Try again to fix the freebsd build
https://bugzilla.gnome.org/show_bug.cgi?id=722526
2014-01-20 07:33:27 -05:00
Matthias Clasen
2efc2ef775 Clarify g_strchomp and g_strchug docs
https://bugzilla.gnome.org/show_bug.cgi?id=583036
2014-01-20 00:34:29 -05:00
A. Walton
deb8a9325b Clarify type transformability and comparability
If two GValues are transformable, it implies they are compatible,
so you do not need to check for compatibility yourself. Bump the
documentation to reflect this fact.

https://bugzilla.gnome.org/show_bug.cgi?id=707111
2014-01-19 23:51:51 -05:00
Matthias Clasen
647412603a More GTree and GNode formatting and documentation fixes
Among other things, add images for tree traversal types,
taken from Wikimedia Commons.
2014-01-19 23:49:12 -05:00
Matthias Clasen
5459d148d1 Move GTraverseType to gnode docs 2014-01-19 22:23:51 -05:00
Matthias Clasen
44db9f2a0f GQueue: documentation and formatting fixes 2014-01-19 22:03:40 -05:00
Matthias Clasen
a918519328 GList: Some further documentation and formatting tweaks 2014-01-19 21:37:28 -05:00
Olivier Sessink
86de6f0ebc tag: documentation enhancement for novice application developers
Adds some code examples how functions can be used. Adds a hint
to look at GQueue if access to the start and the end of the list
is required.

applying comments from Emmanuele Bassi and adds some more
improvements to clarify how functions should be used.

https://bugzilla.gnome.org/show_bug.cgi?id=683388
2014-01-19 20:43:51 -05:00
Simon McVittie
84f3147f43 glib-init: make static assertions about platform assumptions
GLib has a pervasive assumption that function and data pointers are
basically interchangeable, which is true in all modern ABIs,
but not actually guaranteed by ISO C. If someone tries to use GLib on a
platform where function and data pointers are different sizes, fail early.

https://bugzilla.gnome.org/show_bug.cgi?id=688406
2014-01-19 20:23:43 -05:00
Simon McVittie
a4480d5f71 GHashTable: statically assert that GHashTableIter works as intended
https://bugzilla.gnome.org/show_bug.cgi?id=688406
2014-01-19 20:23:43 -05:00
Simon McVittie
476aa9ae46 glib-private.h: add _glib_alignof 2014-01-19 20:23:30 -05:00
Ryan Lortie
8f6be404cb GMainContext: unref pending sources on destroy
It is possible (but unlikely) that there will be a non-empty list of
pending dispatches when we remove the last ref from a GMainContext.
Make sure we drop the refs on the sources appropriately.

Add a (now-working) testcase that demonstrates how to trigger the issue.

https://bugzilla.gnome.org/show_bug.cgi?id=139699
2014-01-19 17:41:18 -05:00
Matthias Clasen
2a3ee7ceaf Work around broken FreeBSD headers
It seems that including just pthread.h does not define
clockid_t on these systems.

https://bugzilla.gnome.org/show_bug.cgi?id=722526
2014-01-19 17:13:51 -05:00
Matthias Clasen
d102cf2b0f Fix the build
The thumbnail-verification test (indirectly) includes individual
headers, so define GIO_COMPILATION to make it work.
2014-01-19 08:58:28 -05:00
Marc-André Lureau
38a6ab3e0e win32: silence build warning
glocalfile.c: In function 'g_local_file_measure_size_of_file':
glocalfile.c:2654:3: warning: passing argument 2 of 'g_lstat' from
incompatible pointer type [enabled by default]
   if (g_lstat (name->data, &buf) != 0)
   ^
In file included from glocalfile.c:68:0:
../glib/gstdio.h:135:5: note: expected 'struct GStatBuf *' but argument
is of type 'struct _stati64 *'

https://bugzilla.gnome.org/show_bug.cgi?id=711547
2014-01-19 08:28:31 -05:00
Marc-André Lureau
a8f58fcfec win32: silence build warning
gdbusauthmechanismexternal.c: In function 'mechanism_client_initiate':
gdbusauthmechanismexternal.c:355:3: warning: 'initial_response' may be
used uninitialized in this function [-Wmaybe-uninitialized]
   return initial_response;
   ^
gdbusauthmechanismexternal.c:332:10: note: 'initial_response' was
declared here

https://bugzilla.gnome.org/show_bug.cgi?id=711547
2014-01-19 08:26:47 -05:00
Marc-André Lureau
2873b3c20c win32: silence build warning
glocalfileinfo.c: In function '_g_local_file_info_get':
glocalfileinfo.c:1955:11: warning: passing argument 3 of
'get_thumbnail_attributes' from incompatible pointer type [enabled by
default]
           get_thumbnail_attributes (path, info, &statbuf);
           ^
glocalfileinfo.c:1285:1: note: expected 'const struct GStatBuf *' but
argument is of type 'struct _stati64 *'
 get_thumbnail_attributes (const char     *path,

https://bugzilla.gnome.org/show_bug.cgi?id=711547
2014-01-19 08:25:33 -05:00
Matthias Clasen
b4474c0b6b Avoid a deprecation warning
https://bugzilla.gnome.org/show_bug.cgi?id=711547
2014-01-19 08:21:50 -05:00
Christophe Fergeau
7463bc1727 Adjust doc to Makefile.decl renaming
g_test_build_filename() API documentation still mentions Makefile.decl, but
it has been renamed to glib.mk in f9eb9eed

https://bugzilla.gnome.org/show_bug.cgi?id=722436
2014-01-19 08:13:03 -05:00
Ryan Lortie
9e81c07ad6 GSimpleAction: fix mistake in last commit
Some bad copy-paste happening here...
2014-01-18 14:27:26 -05:00
Ryan Lortie
1ec71144fb GSimpleAction: add default activate handler
If the action is stateful and the user doesn't have their own activate handler
then do some reasonable things for ourselves.

After a lot of experience using stateful GSimpleAction it turns out that
people almost always end up using it in the same ways:

A boolean-typed stateful action with no parameter is most likely going
to want to be toggled.  Any other type of action that has the parameter
type equal to the state type probably intends for activation to
represent a request to change the state.

This patch implements those two cases.  This will let people stop
writing their own trivial handlers over and over.

https://bugzilla.gnome.org/show_bug.cgi?id=722503
2014-01-18 14:19:37 -05:00
Ryan Lortie
258ac3b253 GOptionContext: add some notes about encodings
Add a note to the overview documentation for GOptionContext about why
you need to be careful about argv encoding on UNIX and about why you
should avoid argv entirely on Windows.  Mention some possible
alternative approaches, including a code example.

https://bugzilla.gnome.org/show_bug.cgi?id=722025
2014-01-17 20:13:46 -05:00
Ryan Lortie
e5f91951a1 GApplication: change commandline encoding policy
Clarify in the documentation that the commandline arguments passed
around by GApplication (to local_command_line and returned via
g_application_command_line_get_arguments()) are in the GLib filename
encoding (ie: UTF-8) on Windows, not the system code page.

Fix the mismatch that would result from having argv passed to
g_application_run() in main() on Windows (where it is in the system
code page) by ignoring argc/argv on Windows and calling
g_win32_get_command_line() for ourselves.  Document this.

This might be a slight API break on Windows: we documented that it was
possible to call g_application_run() with arguments other than argc/argv
and now doing that will result in those arguments being ignored.  It has
always been recommended practice to only call g_application_run() from
main() directly, however, and all of our code examples have shown only
this.  We will see if this causes any issues and consider reevaluating
the situation if so.

https://bugzilla.gnome.org/show_bug.cgi?id=722025
2014-01-17 20:06:37 -05:00
Ryan Lortie
643f2b348d g_file_new_for_commandline_arg: clarify encoding
Add a note to the documentation for g_file_new_for_commandline_arg()
that this function is intended to operate on strings already in the GLib
filename encoding on Windows.

This has been the case for a long time, but this documents the
requirement.

https://bugzilla.gnome.org/show_bug.cgi?id=722025
2014-01-17 20:05:41 -05:00
Ryan Lortie
673ee54cdd win32: add g_win32_get_command_line()
This returns the command line in GLib filename encoding format (ie:
UTF-8) for use with g_option_context_parse_strv().

This will allow parsing of Unicode commandline arguments on Windows,
even if the characters in those arguments fall outside of the range of
the system codepage.

https://bugzilla.gnome.org/show_bug.cgi?id=722025
2014-01-17 20:04:44 -05:00
Ryan Lortie
3352293ab5 g_option_context_parse_strv: use UTF-8 on Windows
Add another difference to the freshly-added g_option_context_parse_strv:
now, on Windows, its arguments on to be in UTF-8 instead of the argv[]
encoding (from the system codepage).

The documentation teases g_win32_get_command_line() which is a new
GLib-filename-encoding-based function that will be added in a following
commit.

https://bugzilla.gnome.org/show_bug.cgi?id=722025
2014-01-17 19:33:09 -05:00
Ryan Lortie
9592d40613 GOption: don't use "rand" in code example
rand() is a function defined in the libc, so our code example gives
warnings if you try to compile it.  Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=722025
2014-01-16 22:42:01 -05:00
Marc-André Lureau
d3c729bf0e gio: fix small memory leak on local xattr
g_strconcat() allocates memory, it needs to be freed.

==10653== 1,400 bytes in 50 blocks are definitely lost in loss record
1,838 of 1,851
==10653==    at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10653==    by 0x54ACB22: g_malloc (gmem.c:102)
==10653==    by 0x54ACE4D: g_malloc_n (gmem.c:343)
==10653==    by 0x54C8463: g_strconcat (gstrfuncs.c:589)
==10653==    by 0x4D6ED38: get_xattrs_from_fd (glocalfileinfo.c:660)
==10653==    by 0x4D71622:
_g_local_file_info_get_from_fd (glocalfileinfo.c:2028)
==10653==    by 0x4D731A0:
g_local_file_input_stream_query_info (glocalfileinputstream.c:356)
==10653==    by 0x4C996D8:
g_file_input_stream_query_info (gfileinputstream.c:148)
==10653==    by 0x4C863F6: file_copy_fallback (gfile.c:3120)
==10653==    by 0x4C86DD2: g_file_copy (gfile.c:3398)

https://bugzilla.gnome.org/show_bug.cgi?id=722357
2014-01-16 20:27:26 -05:00
Christian Schramm
fabdf80c7d gstringchunk: Use g_slist_free_full() where possible
We have that function, let's use it - instead of manually
freeing the elements of the slist in a loop (and reduce
the line count a bit).

https://bugzilla.gnome.org/show_bug.cgi?id=722326
2014-01-16 20:18:46 -05:00
Christian Schramm
5c5982709f gbookmarkfile: removed unused include 'gslist.h'
https://bugzilla.gnome.org/show_bug.cgi?id=722323
2014-01-16 20:15:31 -05:00
Jasper St. Pierre
c4934c9358 Update .gitignore 2014-01-15 10:37:59 -05:00
Ryan Lortie
e41dab438c GLib 2.39.3 2014-01-13 17:23:23 -05:00
Ryan Lortie
bcd276c2b4 more distcheck fixes 2014-01-13 17:23:22 -05:00