Commit Graph

2922 Commits

Author SHA1 Message Date
Christian Persch
e194a9032f resources: tests: Plug a mem leak
==28778== 700 (20 direct, 680 indirect) bytes in 1 blocks are definitely lost in loss record 842 of 863
==28778==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==28778==    by 0x4084724: standard_malloc (gmem.c:85)
==28778==    by 0x40847C7: g_malloc (gmem.c:159)
==28778==    by 0x409B1E1: g_slice_alloc (gslice.c:1003)
==28778==    by 0x405396B: g_bytes_new_with_free_func (gbytes.c:173)
==28778==    by 0x405390D: g_bytes_new_take (gbytes.c:122)
==28778==    by 0x804C2B1: test_uri_query_info (resources.c:435)
2012-02-05 19:57:10 +01:00
Christian Persch
108e11875e resources: tests: Plug a mem leak
==28318== 38 (12 direct, 26 indirect) bytes in 1 blocks are definitely lost in loss record 613 of 865
==28318==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==28318==    by 0x4084724: standard_malloc (gmem.c:85)
==28318==    by 0x40847C7: g_malloc (gmem.c:159)
==28318==    by 0x4084AB4: g_malloc_n (gmem.c:361)
==28318==    by 0x4229599: g_resources_enumerate_children (gresource.c:806)
==28318==    by 0x804B39E: test_resource_registred (resources.c:283)
2012-02-05 19:57:10 +01:00
Christian Persch
74c262a8bd resources: tests: Plug a mem leak
==27820== 31 bytes in 1 blocks are definitely lost in loss record 587 of 866
==27820==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==27820==    by 0x4084724: standard_malloc (gmem.c:85)
==27820==    by 0x40847C7: g_malloc (gmem.c:159)
==27820==    by 0x4084AB4: g_malloc_n (gmem.c:361)
==27820==    by 0x409D6A1: g_strdup (gstrfuncs.c:356)
==27820==    by 0x4069FF7: g_get_current_dir (gfileutils.c:2544)
==27820==    by 0x804BCA7: test_resource_module (resources.c:370)
2012-02-05 19:57:09 +01:00
Christian Persch
ffe7a3293f resources: Plug a mem leak
==27020== 44 (24 direct, 20 indirect) bytes in 1 blocks are definitely lost in loss record 684 of 936
==27020==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==27020==    by 0x4084724: standard_malloc (gmem.c:85)
==27020==    by 0x40847C7: g_malloc (gmem.c:159)
==27020==    by 0x409B1E1: g_slice_alloc (gslice.c:1003)
==27020==    by 0x40BC038: g_variant_get_child_value (gvariant-core.c:969)
==27020==    by 0x40B5277: g_variant_get_variant (gvariant.c:749)
==27020==    by 0x4273182: gvdb_table_value_from_item (gvdb-reader.c:478)
==27020==    by 0x42731E8: gvdb_table_get_value (gvdb-reader.c:509)
==27020==    by 0x4228B36: do_lookup (gresource.c:280)
==27020==    by 0x4228F56: g_resource_get_info (gresource.c:492)
2012-02-05 19:57:09 +01:00
Christian Persch
fa37057169 resources: Plug a mem leak
==26427== 24 bytes in 1 blocks are definitely lost in loss record 608 of 965
==26427==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==26427==    by 0x4084724: standard_malloc (gmem.c:85)
==26427==    by 0x40847C7: g_malloc (gmem.c:159)
==26427==    by 0x409B1E1: g_slice_alloc (gslice.c:1003)
==26427==    by 0x40BC038: g_variant_get_child_value (gvariant-core.c:969)
==26427==    by 0x40BA89F: g_variant_valist_get (gvariant.c:4482)
==26427==    by 0x40BAC23: g_variant_get_va (gvariant.c:4681)
==26427==    by 0x40BAB29: g_variant_get (gvariant.c:4633)
==26427==    by 0x4228BA5: do_lookup (gresource.c:293)
==26427==    by 0x4228F51: g_resource_get_info (gresource.c:493)
2012-02-05 19:57:09 +01:00
Dan Winship
f43565c822 gio/tests/file: use g_file_new_tmp()
Rather than misusing g_file_open_tmp(), misuse g_file_new_tmp()
instead. Progress! (Also, gets rid of a compile warning about close()
on win32.)
2012-02-03 13:01:19 -05:00
Dan Winship
cc4c1e89f4 gio/tests/socket-common.c: add a missing #ifdef G_OS_UNIX 2012-02-03 12:58:53 -05:00
Dan Winship
d22c36cf00 gioenums.h: clean up a few GIOErrorEnum descriptions 2012-02-03 12:49:48 -05:00
Alexander Larsson
3b8ba958f5 Fix warning to refer to to-pixdata, not xmllint 2012-02-03 15:11:23 +01:00
Alexander Larsson
ac800fa8fe Fix GResourceFile get_parent()
This was erronously losing the last char.
2012-02-03 15:05:43 +01:00
Christian Persch
260a9cc290 resource: tests: Use g_assert_cmp[u]int
... instead of just g_assert(), so when the test does fail, one immediately
can see the actual value the variable had.
2012-02-02 23:44:44 +01:00
Christian Persch
cb1dd2143d resources: compiler: Fix entity processing of xml-stripblanks
Preserve entities instead of replacing them!

Bug #669173.
2012-02-02 23:44:40 +01:00
Christian Persch
296a2a72c6 resources: compiler: Make to-pixbuf failure fatal
Bug #669123.
2012-02-02 23:44:38 +01:00
Ryan Lortie
387ed239e2 gsettings tool: fix a memory error
8852d4e9a0 introduced a memory error by
taking the type of a GVariant, freeing the GVariant and using the type
after the free.

This delays the free until after we've used the type.

https://bugzilla.gnome.org/show_bug.cgi?id=669253
2012-02-02 10:53:50 -05:00
Kalev Lember
552b815365 gio: Convert data-to-c.c to perl
Helper scripts in C can be problematic for cross compiling: the compiler
produces executables for the target platform, which the host is usually
unable to run.

https://bugzilla.gnome.org/show_bug.cgi?id=669224
2012-02-02 16:22:42 +01:00
Benjamin Otte
053b011ccc docs: Clarify GSocketClient reuse policy 2012-02-01 16:25:23 +01:00
Kalev Lember
a60f475b36 gio/tests: Fix out-of-source build
The glib-compile-resources --generate-dependencies call was failing,
although not stopping the build.

Failed to open file 'test2.gresource.xml': No such file or directory
Failed to open file 'test3.gresource.xml': No such file or directory
Failed to open file 'test4.gresource.xml': No such file or directory
Failed to open file 'test.gresource.xml': No such file or directory
2012-02-01 15:53:55 +02:00
Kalev Lember
9cf678ed22 gio.symbols: Add g_static_* symbols
... which were added in b79cfda49c.
2012-02-01 15:53:54 +02:00
Kalev Lember
0bb201348f gresource-tool: include sys/mman.h conditionally
It's only needed for code guarded by HAVE_LIBELF, so ifdef the include
as well.
2012-02-01 15:53:54 +02:00
Alexander Larsson
47aa8c43e8 resources: Add to-pixdata preprocessing option 2012-01-31 16:07:09 +01:00
Alexander Larsson
b79cfda49c Make constructor-based resource registration malloc free
We need to do this because constructors run before main() and
thus before any call to g_mem_set_vtable, making it impossible to
use that function if constructors call g_malloc.

We do this by making the constructors just register the static data
for lazy registration, doing the lazy registration when using
the global resource set.
2012-01-31 10:51:44 +01:00
Alexander Larsson
2496c8b53e resources: Minor fixes to the docs 2012-01-31 10:51:23 +01:00
Matthias Clasen
e6713ec810 Fix distclean 2012-01-30 18:46:11 -05:00
Matthias Clasen
de0d7a335c Emit meaningful error messages
That is useful, even if this is only an internal tool.
I have been scratching my head why this tool would
break distcheck...
2012-01-30 17:53:48 -05:00
Matthias Clasen
77ebf9bfc5 Fix builddir != src builds 2012-01-30 17:26:33 -05:00
Matthias Clasen
796389d6c8 Some more documentation fixes 2012-01-30 16:23:01 -05:00
Matthias Clasen
49eeaa9bbd Assorted documentation fixes 2012-01-30 16:16:48 -05:00
Matthias Clasen
9fe3d34ae3 Move pragmas out of function body
It seems that older gcc does not like pragmas inside functions.
2012-01-30 15:26:15 -05:00
Matthias Clasen
96f9997387 Move pragmas out of function body
It seems that older gcc does not like pragmas inside functions.
2012-01-30 15:25:09 -05:00
Matthias Clasen
bdd0aada62 Silence another deprecation warning 2012-01-30 14:21:03 -05:00
Matthias Clasen
5ae5fc85f4 Silence a deprecation warning
Advantage of the new deprecation handling: there's pragmas
to shut them up locally.
2012-01-30 14:18:07 -05:00
Alexander Larsson
968f4e8d79 Move constructor macros to an internal header and into generated code
With this we're not longer exporting the constructor headers, which means
we're not tying ourselves to a macro that might need special tweaking on
a compiler-by-compiler basis.
2012-01-30 16:59:27 +01:00
Dan Winship
18cb864d12 gtlspassword.c: indentation fixes and doc clarifications 2012-01-30 09:00:36 -05:00
Ryan Lortie
9a7a98bf3b glib-compile-schemas: get strict about whitespace
It's important to have strict rules for handling of whitespace in
translated strings in GSettings schema files so that the tools
extracting the messages will end up with the same messages as the
runtime calling gettext().

The rules are designed to be simple and unambiguous yet cover most
normal uses in a convenient way.

Those rules are as follows (with rationale):

  - for <default> tags, the text content has its leading and trailing
    whitespace stripped off, but internal whitespace is not modified in
    any way.

    This allows for slightly more flexible use of whitespace without
    causing that whitespace to appear in the strings for translation.

  - for <summary> and <description> tags, the content is split into
    paragraphs.  Paragraphs are separated by two or more sequential
    newline characters.  Each paragraph has its leading and trailing
    whitespace removed and all other whitespace is normalised to a
    single ascii space character.  Finally, the paragraphs are rejoined,
    inserting exactly two newlines between them.

    This allows for longer explanations (particularly in the description
    tag) using a natural format that, when normalised, will display
    nicely in toolkits.

This patch implements the rules for <default> tags.  The schema compiler
currently ignores <summary> and <description> tags.
2012-01-28 01:23:05 +01:00
Ryan Lortie
da386705f9 GSettings: two memory use fixes
First, correct a rather dubious case of accessing a GSettingsSchemaKey
after clearing it.  This was technically okay because only the key name
was accessed (and it is not owned by the struct) but it looks very
wrong.

Second, have g_settings_backend_write() sink the passed in GVariant*.
Not all backends get this right, and I'm starting to like the pattern of
virtual function wrappers being responsible for sinking the parameters
that they are documented as consuming.
2012-01-27 03:00:23 -05:00
David Zeuthen
8e763aef43 gdbus-codegen: Use C array instead of GValueArray
GValueArray was deprecated in bug 667228 and since we never change the
size of the array, it was kinda dumb to just GValueArray in the first
place.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-01-26 14:56:29 -05:00
David Zeuthen
bc40fe582d GDBusInterface: add dup_object() method
This is needed for thread-safety ... yes, it would have been better to
make get_object() return a full reference and have something like a
peek_object() method return a borrowed reference for C convenience
(only a single vfunc would have been needed). But such an ABI break is
too late now...

Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-01-26 14:20:08 -05:00
David Zeuthen
eb6c35f7c3 gio.symbols: Remove removed g_menu_markup_* symbols
Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-01-26 14:06:59 -05:00
Ryan Lortie
2a90aba068 Drop the GMenu markup functions
The parser has been moved into Gtk in a modified form and the printer
was never really useful anyway (except for debugging/testing).
2012-01-25 21:05:27 -05:00
Matthias Clasen
4e9f59bff8 e G_SOURCE_CONTINUE/REMOVE internally
Now that we have these macros, we should use them.
This commit covers everything in gio/.
2012-01-25 16:15:18 -05:00
Christian Persch
5286dbb7e1 resources: tool: Fix a compiler warning
Use G_GSIZE_FORMAT.
2012-01-25 14:47:58 +01:00
Christian Persch
f42a5fb53b resources: compiler: Add autoselected output format
This allows simplifying the make rules.

Bug #668539.
2012-01-25 14:47:48 +01:00
Christian Persch
55d10d6bfd resources: compiler: Add dependency generator
Bug #668532.
2012-01-25 14:47:37 +01:00
Christian Persch
45783c5927 resources: compiler: Allow stripping blanks from xml data
It's hardly useful to bloat the resource data with blanks intended only
for human readability, so add a preprocessing option that uses xmllint --noblanks
to strip these.

Bug #667929.
2012-01-25 14:47:37 +01:00
Xan Lopez
73f5764fcd gresource-tool: fix the build 2012-01-25 10:28:27 +01:00
Matthias Clasen
a3b91b3691 gresource: Initialize i18n
...otherwise translations don't work. Pointed out by Kjartan Maraas.

https://bugzilla.gnome.org/show_bug.cgi?id=668561
2012-01-24 17:38:23 -05:00
Dan Winship
570514a95c GSocket: fix complile on platforms without source-specific multicast
Some platforms don't have the source-specific multicast sockopts, and
so would fail to compile. Fix that (and return an error if the caller
tries to use source-specific). Also clarify the docs a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=668468
2012-01-24 08:30:24 -05:00
Christian Persch
3f691c6f51 Write list-of value correctly
Fixes a c&p typo. Bug #639099.
2012-01-24 14:20:37 +01:00
Matthias Clasen
99c379f514 GMenuMarkup: call g_variant_ref_sink()
Watch out for them floating variants !
They are easily consumed...
2012-01-23 19:24:10 -05:00
Matthias Clasen
716cf35585 Add a resource tool
This lets you poke at resources in elf files and
standalone resource bundles. So far, only listing
and extracting resources is supported. The support
for elf files requires libelf.
2012-01-23 00:24:34 -05:00
Matthias Clasen
a461f70080 Silence some compiler warnings 2012-01-20 08:08:06 -05:00
Matthias Clasen
2c864a1bb2 Silence a compiler warning 2012-01-20 08:07:52 -05:00
Matthias Clasen
8852d4e9a0 Fix a refcounting error
'new' is created floating, therefore it is consumed by
g_settings_set, and unreffing it after that call is not right.
2012-01-20 08:03:38 -05:00
Ryan Lortie
d683c201f9 tests for GSettings action binding
https://bugzilla.gnome.org/show_bug.cgi?id=668279
2012-01-19 10:50:29 -05:00
Ryan Lortie
1d98d18f64 add a way to create a GAction from GSettings
g_settings_create_action() will create a GAction for the named key,
allowing it to be added to the action group of the application (so that
the setting can be directly manipulated from menus, for example).

https://bugzilla.gnome.org/show_bug.cgi?id=668279
2012-01-19 10:50:29 -05:00
Murray Cumming
41fbf42c3c gioenums.h: Remove a trailing comma. 2012-01-19 16:18:05 +01:00
Ryan Lortie
c95e908529 GSettingsSchema: ignore empty schema caches
glib-compile-schemas used to generate these.  They're harmless and they
mean that no schemas are installed in a particular directory, so just
ignore them.

https://bugzilla.gnome.org/show_bug.cgi?id=656301
2012-01-18 22:16:23 -05:00
Christian Persch
d8b295abb3 resources: Plug mem leaks in resource compiler
==13007== 173 bytes in 1 blocks are definitely lost in loss record 90 of 106
==13007==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==13007==    by 0x407DDBA: standard_malloc (gmem.c:85)
==13007==    by 0x407E318: g_try_malloc (gmem.c:271)
==13007==    by 0x40654DE: g_file_get_contents (gfileutils.c:756)
==13007==    by 0x804A531: main (glib-compile-resources.c:580)

==13007== 521 (56 direct, 465 indirect) bytes in 1 blocks are definitely lost in loss record 100 of 106
==13007==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==13007==    by 0x407DDBA: standard_malloc (gmem.c:85)
==13007==    by 0x407E160: g_malloc (gmem.c:159)
==13007==    by 0x4091D8D: g_slice_alloc (gslice.c:1003)
==13007==    by 0x40674A1: g_hash_table_new_full (ghash.c:676)
==13007==    by 0x804B252: gvdb_hash_table_new (gvdb-builder.c:76)
==13007==    by 0x43C66B2: (below main) (libc-start.c:226)
2012-01-18 19:43:17 +01:00
Ryan Lortie
54b986d918 GApplication: drop support for appmenu/menubars
This has been moved over to GtkApplication now.

https://bugzilla.gnome.org/show_bug.cgi?id=668118
2012-01-18 13:39:22 -05:00
Dan Winship
7a2e6ab791 update .gitignores 2012-01-18 13:28:00 -05:00
Dan Winship
da9d98728d Fix glib-compile-resources usage when cross-compiling
Copy the behavior of glib-genmarshal: require an installed copy of it,
and use that rather than the built copy.
2012-01-18 12:07:11 -05:00
Will Thompson
7a0bddd768 GDBusConnection: note that exit-on-close is sometimes TRUE
g_bus_get_finish() and g_bus_get_sync() both document that the returned
object will usually have exit-on-close set to TRUE, but the property's
documentation specified that its default is FALSE. While that's
technically true from a GObject perspective, it's not accurate from the
API user's perspective.

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

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Zeuthen <zeuthen@gmail.com>
2012-01-18 16:16:58 +00:00
Xavier Claessens
d077b66ee9 GUnixConnection: add async variant for send/receive_credentials()
https://bugzilla.gnome.org/show_bug.cgi?id=629503
2012-01-18 15:21:56 +01:00
Dan Winship
08036ce303 gsocket: make this compile on Windows again
https://bugzilla.gnome.org/show_bug.cgi?id=668071
2012-01-17 19:46:57 -05:00
Alexander Larsson
d825828b7b resources: Skip initial underscores in resource section names
Initial underscores are used in c identifier to make them private,
for instance in Gtk+. However, we don't want to have this in the
resource section name, that just looks ugly.
2012-01-17 12:32:37 +01:00
Dan Winship
7dfbe5aa30 gsocket: Use alternate IPv6 multicast group sockopt names
Apparently IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP are more portable than
IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMBERSHIP. (Windows and Linux have
both, but OS X only has the latter.)
2012-01-16 17:16:40 -05:00
Dan Winship
bf7408c30b GInetSocketAddress: add IPv6 flowinfo and scope_id fields
struct sin6_addr has two additional fields that struct sin_addr
doesn't. Add support for those to GInetSocketAddress, and make sure
they don't get lost when converting between glib and native types.

https://bugzilla.gnome.org/show_bug.cgi?id=635554
2012-01-16 13:37:02 -05:00
Dan Winship
c71fc7477e ginetaddress.c: fix an incorrect enum name in the docs 2012-01-16 13:37:02 -05:00
Sebastian Dröge
76f46b4f33 GSocket: Use correct type for SO_BROADCAST parameter 2012-01-16 19:22:28 +01:00
Sebastian Dröge
d44bb6ef64 GSocket: Reset the timeout in the GSocket GSource after it was triggered
https://bugzilla.gnome.org/show_bug.cgi?id=667989
2012-01-16 18:41:40 +01:00
Ole André Vadla Ravnås
fbdb8128dc GSocket: Add function to get the currently available bytes for reading
https://bugzilla.gnome.org/show_bug.cgi?id=668009
2012-01-16 18:41:40 +01:00
Sebastian Dröge
ffb5f8b101 GSocket: Add function to set/get the broadcast setting on a socket
https://bugzilla.gnome.org/show_bug.cgi?id=623187
2012-01-16 18:41:40 +01:00
Sebastian Dröge
5560d9b880 GSocket: Add function for setting unicast TTL 2012-01-16 18:41:40 +01:00
Sebastian Dröge
03b40522df GSocket: Add support for source-specific multicast (RFC 4604) 2012-01-16 18:41:40 +01:00
Sebastian Dröge
97f25892ea GSocket: Add possibility to join a multicast group only on a specific interface 2012-01-16 18:41:40 +01:00
Dan Winship
a62d1bb747 GSocket: Add multicast-related functions
Add APIs for sending and receiving multicast datagrams with GSocket.

Based on an earlier patch from Olivier Chalouhi.

https://bugzilla.gnome.org/show_bug.cgi?id=626589
2012-01-16 18:41:40 +01:00
Dan Winship
afe7a2d136 GAsyncInitable: fix subclassibility
If a class implements GAsyncInitable, and its parent also implements
it, then the subclass needs to call its parent's init_async() before
running its own. This was made more complicated by the fact that the
default init_finish() behavior was handled by the wrapper method
(which can't be used when making the super call) rather than the
default implementation itself. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=667375
2012-01-16 09:42:50 -05:00
Alexander Larsson
feb120eb40 Fix typo
registred_resources -> registered_resources
2012-01-16 10:38:35 +01:00
Christian Persch
87dc862408 Ensure to generate a flags GType for empty Flags enums
When the flags enum only has the default NONE = 0 entry, glib-mkenums
creates an enum type for it, not a flags type. Add an annotation to the
enum to ensure the correct GType is created.

Bug #667938.
2012-01-15 13:03:16 +01:00
Christian Persch
b717ef86ad resources: Use g_set_error_literal where appropriate 2012-01-15 13:03:09 +01:00
Christian Persch
870fc484d9 Add missing Since: docs 2012-01-15 13:02:59 +01:00
Rico Tzschichholz
0fd61489e5 gio/tests: Fix out-of-source build and use uninstalled libraries 2012-01-14 11:18:07 +01:00
Rico Tzschichholz
86cd3018e0 gio/tests: add some missing files to EXTRA_DIST 2012-01-13 23:48:12 +01:00
Rico Tzschichholz
e3fe256692 gio: Fix for -Wformat-security 2012-01-13 23:18:01 +01:00
Rico Tzschichholz
8735f53ae4 tests: Fix build failure of resources by linking against libgmodule-2.0.la 2012-01-13 22:35:44 +01:00
Alexander Larsson
056cec779a Add GResource functions to gio.symbols 2012-01-13 17:12:57 +01:00
Alexander Larsson
e041843b3e Support resource:/// uris 2012-01-13 17:12:57 +01:00
Alexander Larsson
75439298f8 Add tests for GResource 2012-01-13 17:12:53 +01:00
Alexander Larsson
827657491d Initial version of glib-compile-resources
This is the basic utility to create resource files, either binary
versions or source files that can be compiled into your app.
2012-01-13 17:12:50 +01:00
Alexander Larsson
b87cf49163 Initial version of GResource
GResource is a bundle of files combined into a single binary blog.
The API lets you access the files the resource contains by
using resource paths. You can also register resources with a
global list and access these globally in a merged resource namespace.

The normal way this is used is to link in the resources into your
application/library and have it be automatically registred.

Resources are compiled from an xml description using
glib-compile-resources.
2012-01-13 17:12:45 +01:00
Alexander Larsson
d85b722734 Merge remote-tracking branch 'gvdb/master' 2012-01-13 16:12:56 +01:00
Evan Nemerson
c3d6595f5a GIO: add lots of annotations for Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=667447
2012-01-11 15:50:08 -05:00
Philip Withnall
e98f17e5cf Bug 666700 — Add some missing (allow-none) annotations
Add some missing (allow-none) annotations to GContentType, GIcon and
GHashTable methods.

Closes: bgo#666700
2012-01-11 20:48:29 +00:00
Matthias Clasen
00c00e2f3f Add G_FILE_ATTRIBUTE_FILESYSTEM_USED to get exact used space
This is implemented by with statfs_buffer.f_bavail (free blocks
for unprivileged users) as a default way to retrieve real free space.
Based on a patch by Marcus Carlson, bug 625751.
2012-01-09 21:49:08 -05:00
Matthias Clasen
31960257a6 Make glocalfile.c more readable
The many nested ifdefs here really deserve some annotations.
Based on a patch by Marcus Carlson, bug 625751.
2012-01-09 21:35:13 -05:00
Ravi Sankar Guntur
0ed2cdb0d9 Use g_queue_free_full() convenience function.
https://bugzilla.gnome.org/show_bug.cgi?id=667331

Signed-off-by: Ravi Sankar Guntur <ravi.g@samsung.com>
2012-01-09 19:27:39 -05:00
Nguyễn Thái Ngọc Duy
b87f6f9f8c gio/gsocks5proxy: typo fix 2012-01-06 16:58:57 +07:00
Dan Winship
0da8db52cd Remove some cruft from an older version of the code 2012-01-05 12:57:18 -05:00
Michael Terry
382341dd99 gdesktopappinfo: Fix gtk-doc to mention Keywords not X-GNOME-Keywords
https://bugzilla.gnome.org/show_bug.cgi?id=667285
2012-01-05 11:19:22 -05:00
Javier Jardón
c735b54a63 gio/*: Use g_slist_free_full() convenience function 2012-01-05 04:57:47 +01:00
Michael Terry
31c3082e19 gdesktopappinfo: Avoid crash by NULL-ing data.pid_envvar before launch
https://bugzilla.gnome.org/show_bug.cgi?id=667279
2012-01-04 13:08:56 -05:00
Claudio Saavedra
8b96fb3761 GSocket: fix a couple of return values
g_socket_receive_with_blocking() and g_socket_send_with_blocking claim
to return -1 in error, their return type is gssize, and yet they
return FALSE if the initial g_return_val_if_fail() call fails.

https://bugzilla.gnome.org/show_bug.cgi?id=667226
2012-01-04 18:14:00 +02:00
Claudio Saavedra
f38a1dbca7 GSocket: add some more g_return_if_fail()s
https://bugzilla.gnome.org/show_bug.cgi?id=667225
2012-01-04 18:13:10 +02:00
Javier Jardón
928d2cea61 gio/*: Use g_list_free_full() convenience function 2012-01-03 16:53:47 +01:00
Javier Jardón
dde3401122 gio/gdbus-2.0/codegen/codegen.py: Use g_list_free_full() 2012-01-03 16:53:47 +01:00
Javier Jardón
ee044fd839 gio/tests: Use g_list_free_full() convenience function 2012-01-02 23:18:22 +01:00
Simon McVittie
34e3881f2f Add test for GDBusConnection singleton access racing with destruction
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=665211
2012-01-02 12:29:57 -05:00
Simon McVittie
1e09bfc77c GDBusConnection: use GWeakRef to make the singletons thread-safe
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=665211

https://bugzilla.gnome.org/show_bug.cgi?id=548954
2012-01-02 12:23:24 -05:00
William Hua
a07e9a5fb2 nextstep gsettings backend: whitespace police 2012-01-01 22:01:47 -05:00
William Hua
edd2aff575 thread-safe nextstep gsettings backend
simplified key reset logic
2012-01-01 21:59:39 -05:00
William Hua
9c10083844 GSettings: nextstep settings backend 2012-01-01 19:40:56 -05:00
Xan Lopez
00f43b22e5 ginetaddressmask: plug leak
==24706== 52 bytes in 1 blocks are definitely lost in loss record 7,248 of 13,092
==24706==    at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==24706==    by 0x70E9F5F: standard_malloc (gmem.c:85)
==24706==    by 0x70E9FE8: g_malloc (gmem.c:159)
==24706==    by 0x71018EC: g_slice_alloc (gslice.c:1003)
==24706==    by 0x710192B: g_slice_alloc0 (gslice.c:1029)
==24706==    by 0x7068526: g_type_create_instance (gtype.c:1872)
==24706==    by 0x705067B: g_object_constructor (gobject.c:1835)
==24706==    by 0x704FE47: g_object_newv (gobject.c:1699)
==24706==    by 0x7050612: g_object_new_valist (gobject.c:1816)
==24706==    by 0x704F894: g_object_new (gobject.c:1531)
==24706==    by 0x6F0F2F0: g_inet_address_new_from_bytes (ginetaddress.c:459)
==24706==    by 0x6F5D703: remove_network (gnetworkmonitornetlink.c:256)
==24706==    by 0x6F5DD80: read_netlink_messages (gnetworkmonitornetlink.c:386)
==24706==    by 0x6F2D5CA: socket_source_dispatch (gsocket.c:2505)
==24706==    by 0x70E1D45: g_main_dispatch (gmain.c:2513)
==24706==    by 0x70E2A06: g_main_context_dispatch (gmain.c:3050)
==24706==    by 0x70E2BE9: g_main_context_iterate (gmain.c:3121)
==24706==    by 0x70E2CAD: g_main_context_iteration (gmain.c:3182)
==24706==    by 0x6F60A05: g_application_run (gapplication.c:1599)
==24706==    by 0x42D011: main (ephy-main.c:472)

https://bugzilla.gnome.org/show_bug.cgi?id=667098
2012-01-01 19:01:14 +01:00
Simon McVittie
fa4792c35e various tests: do not provoke SIGTRAP with -m no-undefined
Some of the GLib tests deliberately provoke warnings (or even fatal
errors) in a forked child. Normally, this is fine, but under valgrind
it's somewhat undesirable. We do want to follow fork(), so we can check
for leaks in child processes that exit gracefully; but we don't want to
be told about "leaks" in processes that are crashing, because there'd
be no point in cleaning those up anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=666116
2011-12-27 17:51:09 -05:00
Matthias Clasen
cc03b3cdea Don't leak references to the menus 2011-12-24 23:01:17 -05:00
Matthias Clasen
f077127d01 Add a test for ids on submenu and section elements
The test checks that menus which are created via
<submenu id=...> or <section id=...> end up in the objects
hash table.
2011-12-24 22:59:10 -05:00
Matthias Clasen
37efbf4354 Menu markup: Support ids on submenu and section elements
This was supposed to work, but didn't.
Bug 666595.
2011-12-24 22:58:16 -05:00
Dan Winship
3f3e141ec8 Add GSocketClient::event, for tracking socket client status
This can be used for debugging, or for progress UIs ("Connecting to
example.com..."), or to do low-level tweaking on the connection at
various points in the process.

https://bugzilla.gnome.org/show_bug.cgi?id=665805
2011-12-22 15:44:24 -05:00
Dan Winship
57f279988c Add g_socket_connection_connect(), etc
Previously it was more or less assumed that GSocketConnections were
always connected, although this was not enforced. Make it explicit
that they don't need to be, and add methods to connect them, and
simplify GSocketClient by using those methods.

https://bugzilla.gnome.org/show_bug.cgi?id=665805
2011-12-22 13:22:25 -05:00
Ryan Lortie
6e7da987b4 GSettingsBackend: allow floating refs from read()
Use g_variant_take_ref() to allow for backends to return floating
GVariant instances from their read() implementations.
2011-12-22 00:24:20 -05:00
Cosimo Cecchi
adff60ed63 menu: documentation fixes
g_menu_new_section() does not exist, the comment meant
g_menu_item_new_section().
2011-12-21 12:36:19 +01:00
Ryan Lortie
ab0da3c282 GSimpleAction: fix some whitespace fail 2011-12-20 19:12:56 -05:00
Ryan Lortie
342e2faa29 GSimpleAction: tweak property flags
There's no need for 'enabled' and 'state' to be marked construct-only.
These properties are writable at all times.
2011-12-20 19:12:00 -05:00
Ryan Lortie
ebf572cdd8 GAction: back out changes to property flags
41e5ba86a7 introduced some changes to the
property flags of GAction.  These changes were not a reflection of the
actual interface of GAction but were necessary due to GObject being
overly-sensitive to flag changes on property overrides.

Now that the GObject bug is fixed, we can restore the GAction flags to
their correct values.

https://bugzilla.gnome.org/show_bug.cgi?id=666615
2011-12-20 14:58:38 -05:00
Matthias Clasen
68706bfa2b Add references to the dbus interface docs on the wiki
And strip out the (now) redundant copy of that information
from the sources.
2011-12-20 12:15:05 -05:00
Dan Winship
8f558d8010 gnetworkmonitornetlink.c: Fix a gsize->gssize
https://bugzilla.gnome.org/show_bug.cgi?id=666422
2011-12-19 15:20:08 -05:00
Ryan Lortie
5e8a10daf1 gitignore 2011-12-19 13:38:09 -05:00
Ryan Lortie
0a22f63ebe Drop public menu APIs from GApplication
This is moving to Gtk, but we don't want to do it all right now.
2011-12-19 12:34:16 -05:00
Ryan Lortie
0c094d6607 Drop the GApplication menu test 2011-12-19 12:34:16 -05:00
Giovanni Campagna
466432830c gsettings-tool: allow specifying custom schema dirs
It happens that one wants to customize settings for plugins or
shell extensions, that installing schemas in nonstandard locations.
This patch adds the --schemadir option to gsettings, and ensure
that the appropriate schema is found.

https://bugzilla.gnome.org/show_bug.cgi?id=666415
2011-12-19 10:33:55 -05:00
Florian Müllner
f59acb55c1 gdesktopappinfo: Use "Keywords" instead of "X-GNOME-Keywords"
The field has now been standardized, so drop the prefix.
2011-12-19 15:26:30 +01:00
Ryan Lortie
0971d36e4b GApplication: receiving end of GRemoteActionGroup
Use the fact that the action group exporter now speaks to
GRemoteActionGroup to get the platform data into GApplicion without
hacks.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-17 12:54:02 -05:00
Ryan Lortie
1807ef336a action group exporter: kill GApplication hackery
Use the GRemoteActionGroup interface, if available, instead.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-17 12:54:02 -05:00
Ryan Lortie
eefd08996f introduce GRemoteActionGroup
This interfaceifies the extra functions that were on GDBusActionGroup
for dealing with platform data.

The two main benefits of doing this:

  - no longer have to do a silly song and dance in GApplication to avoid
    calling GDBusActionGroup API from non-dbus-aware code

  - the interface can be reused by the action group exporter to avoid
    ugly and unbindable hook callbacks

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-17 12:54:02 -05:00
Ryan Lortie
ee9f104432 GApplication: send platform data for actions again
Use the _full variants of the GDBusActionGroup API to send platform data
for action invocations once again.
2011-12-16 22:24:03 -05:00
Ryan Lortie
f58df66d4d GDBusActionGroup: add _full variants of activation
This allows the platform_data to be explicitly specified.
2011-12-16 22:23:30 -05:00
Ryan Lortie
e5ed11bcf8 Revert "GDBusActionGroup: add static platform registration"
This reverts commit fcc9902e98.
2011-12-16 21:25:57 -05:00
Ryan Lortie
e370631f46 GApplication: emit signals on action changes
Now that we're a GActionMap the story about propagating signals from our
(now-constant) internal action group is vastly simplified.  If someone
calls g_application_set_action_group() then signals will stop working --
but this function is deprecated and they never worked before, so no big
loss there.

https://bugzilla.gnome.org/show_bug.cgi?id=643736
2011-12-16 11:43:59 -05:00
Ryan Lortie
fcc9902e98 GDBusActionGroup: add static platform registration
We provide a mechanism by which a 'platform' (eg: Gtk) can register some
hook functions to be called to collect platform-data at the point of
sending an outgoing action activation request and also to inform the
platform of this data on incoming requests (before and after dispatching
the actual request).

This can be used for forwarding timestamp and startup-notification
information (as is presently done in GApplication) but the before/after
hook could also be used for acquiring/releasing the Gdk lock or other
similar things.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-16 10:54:42 -05:00
Colin Walters
63e69b4958 GDBusActionGroup: Fix a typo in docs 2011-12-15 09:47:37 -05:00
Chris Coulson
162bafee37 Initialize service_loop before running the service thread
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666129
2011-12-14 21:15:35 -05:00
Matthias Clasen
a6eda97d8e menu markup: tolerate not having a hash table of objects
Various places in the code were assuming that the hash table was always
available. Fix this, and also avoid leaking strings now that the hash
table may be NULL.

Based on a patch by Simon McVittie, bug 666167
2011-12-14 21:05:38 -05:00
Simon McVittie
a1bd6e0717 tls-interaction test: use a weak pointer instead of a deliberate use-after-free
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Dan Winship <danw@gnome.org>
2011-12-14 15:59:29 +00:00
Ryan Lortie
0a7930d048 gdbus tests: remove buggy use of GMainLoop
g_main_loop_quit() only quits mainloops that are currently running --
not ones that may run in the future.  The way the gdbus-threading tests
are written can possibly result in a call to g_main_loop_quit() before
g_main_loop_run() has started.

The mainloops aren't actually used for anything other than signalling
the completion of the threads, so just use g_thread_join() for that.

https://bugzilla.gnome.org/show_bug.cgi?id=666129
2011-12-14 09:33:30 -05:00
Simon McVittie
995a2eb50b Plug some leaks in the GIO tests
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
2011-12-14 12:41:15 +00:00
Simon McVittie
fedc0cff51 Revert "g_menu_markup_start_element: tolerate not having a hash table of objects"
This reverts commit bcdb606411,
accidentally pushed before it was reviewed.
2011-12-14 12:39:06 +00:00
Simon McVittie
bcdb606411 g_menu_markup_start_element: tolerate not having a hash table of objects
I don't know whether this is the right fix, but gio/tests/gmenumodel
crashes out, which can't be right.
2011-12-14 12:31:31 +00:00
Simon McVittie
a48edddc19 GDBusActionGroup: don't leak param_str
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
2011-12-14 12:26:17 +00:00
Simon McVittie
fbab468da5 g_dbus_action_group_changed: don't leak iterator and its contents
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-12-14 12:26:16 +00:00
Matthias Clasen
b386d9ffb7 Add another menu parser test
This one concerns itself with objects.
2011-12-14 00:10:34 -05:00
Matthias Clasen
b153e38ff0 GMenuModel: Flesh out the docs some more 2011-12-13 23:16:25 -05:00