Commit Graph

2514 Commits

Author SHA1 Message Date
David Zeuthen
4e7ef619eb GDBusObjectManagerClient: Add locking
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-29 16:20:50 -04:00
David Zeuthen
fcefc71d59 GDBusObjectProxy: Add locking
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-29 15:29:40 -04:00
David Zeuthen
fb94a0299b GDBusObjectSkeleton: Add locking
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-29 15:20:02 -04:00
David Zeuthen
faec5d6b5c GDBusInterfaceSkeleton: Add locking
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-29 15:20:02 -04:00
Matthias Clasen
1b28408b8b Spelling fixes
Spelling fixes in comments and docs, provided by
Kjartan Maraas in bug 657336.
2011-08-29 14:49:32 -04:00
Kalev Lember
41e4db8076 gio/tests/gtlsconsoleinteraction: Work around missing getpass() on win32
Loosely based on a patch by Sam Thursfield <ssssam@gmail.com>.
https://bugzilla.gnome.org/show_bug.cgi?id=656341
2011-08-28 16:45:53 +03:00
Matthias Clasen
be555ed2d0 Fix symbol lists 2011-08-27 23:30:43 -04:00
Matthias Clasen
6e80885c8d Spell out file descriptors in a message
Translators don't necessarily know what 'fds' are.
Pointed out in bug 657454.
2011-08-27 13:18:45 -04:00
Matthias Clasen
1a2265889b GDBusMessage: Use ngettext() where appropriate
Pointed out in bug 657452.
2011-08-27 13:17:07 -04:00
Dan Winship
06b23e2b54 gsocketaddress: don't return ABSTRACT if the OS doesn't support it
FreeBSD apparently has non-0-length (but nameless) ANONYMOUS sockets.
Fix the heuristics here.
2011-08-27 12:28:03 -04:00
Dan Winship
aa10574dc3 gunixcredentialsmessage: fix this on FreeBSD
pointed out by Henry Hu
https://bugzilla.gnome.org/show_bug.cgi?id=628904
2011-08-27 12:28:03 -04:00
Dan Winship
cef679d004 GSocket: fix GIOCondition on timed-out socket operation
The docs for g_socket_set_timeout() claimed that if an async operation
timed out, the GIOCondition passed to the source callback would be
G_IO_IN or G_IO_OUT (thus prompting the caller to call
g_socket_receive/send and get a G_IO_ERROR_TIMED_OUT), but in fact it
ended up being 0, and gio/tests/socket.c was erroneously testing for
that instead of the correct value. Fix this.
2011-08-27 12:28:03 -04:00
Og B. Maciel
c04496d98d Fixed typo: s/ether/enter. 2011-08-26 11:07:32 -04:00
Stef Walter
d789e78dff giomodule: When loading GIO_EXTRA_MODULES skip duplicates
* Load modules from paths listed in GIO_EXTRA_MODULES environment
   variable first.
 * Ignore duplicate modules based on module basename.
 * Add the concept of GIOModuleScope which allows other callers to
   skip duplicate loaded modules, or block specific modules based on
   basename.
 * Document behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=656914
2011-08-26 15:27:19 +02:00
Stef Walter
41432cb375 Make GTlsInteraction virtual methods cancellable
* Add cancellable argument to g_tls_interaction_ask_password
   and g_tls_interaction_ask_password_async.
 * This is API breakage, but this API has not yet been released
   in a stable release (and very unlikely used yet).
 * Since we're breaking unreleased API, expand amount of padding
   on GTlsInteractionClass because we're going to need it.

https://bugzilla.gnome.org/show_bug.cgi?id=656443
2011-08-26 07:34:31 +02:00
Dieter Verfaillie
a2614efd14 Make gdbus-codegen 'relocatable' at runtime on Windows.
https://bugzilla.gnome.org/show_bug.cgi?id=650763
2011-08-25 17:23:00 -04:00
Dieter Verfaillie
acb5b852c1 gdbus-codegen: Revert to using /usr/bin/env for Python
After a lot of discussion, we decided /usr/bin/env is the most
flexible for now.

https://bugzilla.gnome.org/show_bug.cgi?id=650763
2011-08-25 17:19:27 -04:00
Dieter Verfaillie
cd0cd95078 Introduce the UNINSTALLED_GLIB_SRCDIR environment variable
This makes it possible to avoid setting PYTHONPATH in
Makefile.am files.

https://bugzilla.gnome.org/show_bug.cgi?id=650763
2011-08-25 16:55:49 -04:00
Dieter Verfaillie
5391aae009 Introduce the UNINSTALLED_GLIB_BUILDDIR environment variable
This makes it possible to also use relative imports for
gdbus-codegen's config module.

https://bugzilla.gnome.org/show_bug.cgi?id=650763
2011-08-25 16:55:49 -04:00
Dieter Verfaillie
5dc3c2efc8 Use relative imports for the gdbus/codegen package
But not yet for the config module (but is taken care
of in a followup patch).

https://bugzilla.gnome.org/show_bug.cgi?id=650763
2011-08-25 16:55:47 -04:00
Dieter Verfaillie
0eaec4e59a Avoid using - (hyphen) in gdbus-codegen directory name
It's an invalid character in Python module names and prevents us from
being able to import it.

https://bugzilla.gnome.org/show_bug.cgi?id=650763
2011-08-25 16:55:46 -04:00
Ionut Biru
33831bda24 Use detected PYTHON shebang in gdbus-codegen
Change the hardcoded /usr/bin/python shebag from gdbus-codegen.in into
@PYTHON@. Is used in Makefile.am to use detected python binary.

$(AM_V_GEN) sed -e 's,@libdir\@,$(libdir),' -e 's,@PYTHON\@,$(PYTHON),'
$< > $@.tmp && mv $@.tmp $@

Signed-off-by: Ionut Biru <ibiru@archlinux.org>

https://bugzilla.gnome.org/show_bug.cgi?id=657274
2011-08-25 13:35:35 -04:00
Matthias Clasen
471593ebf0 GCancellable: Small annotation additions
https://bugzilla.gnome.org/show_bug.cgi?id=657243
2011-08-24 21:25:31 -04:00
Philip Withnall
ff0cf7b681 Bug 657206 — GInputStream leaked in g_file_icon_load_async()
Add a missing unref to g_file_icon_load_async().

Closes: bgo#657206
2011-08-24 07:54:29 +01:00
Eduardo Lima Mitev
30d9636df2 GIO: Add more missing GI annotations
- g_io_extension_point_register()
 - g_io_extension_point_lookup()
 - g_io_extension_point_implement()

https://bugzilla.gnome.org/show_bug.cgi?id=625383
2011-08-23 19:56:36 -04:00
David Zeuthen
e604b2d0af gdbus-codegen: update comment in code to reflect reality
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-23 12:57:14 -04:00
David Zeuthen
05448a6bef gdbus-codegen: Rework C property getters
Rework property getters to use a vfunc so we can take the fast path
and avoid allocating memory for both the skeleton and the proxy
cases. This requires some special case because of how GVariant expects
you to free memory in some cases, see #657100. Add test cases for
this.

Document the _get_ functions as not being thread-safe and also
generate _dup_ C getters (which are thread-safe).

Mark all the generated _get_, _dup_ and _set_ as (skip) as non-C
languages should just use GObject properties and not the (socalled)
"C binding".

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-23 12:54:27 -04:00
Colin Walters
5b68b49b20 GTimeZoneMonitor: Revert addition of this class
The main rationale for adding it was to avoid having gnome-shell
mmap'ing /etc/localtime once a second.  However, we can just as easily
run inotify there, and given no one else was clamoring for a way to
detect when the time zone changes, I don't see a need for public API
here - at least not yet.

In the bigger picture, I just don't believe that the vast majority of
applications are going to go out of their way to instantiate and keep
around a random GTimeZoneMonitor class.  And if they do, it's has the
side effect that for other bits of code in the process, local GDateTime
instances may start varying again!

So, if code can't rely on local GDateTime instances being in a
consistent state anyways, let's just do that always.  The
documentation now says that this is the case.  Applications have
always been able to work in a consistent local time zone by
instantiating a zone and then using it for GDateTime constructors.

We fix the "gnome-shell stats /etc/localtime once a second" issue by
using timerfd (in glib) and inotify (in gnome-shell).

https://bugzilla.gnome.org/show_bug.cgi?id=655129
2011-08-22 11:12:37 -04:00
Stef Walter
26548e05bb Merge branch 'concurrent-cancellable' 2011-08-19 11:21:11 +02:00
Stef Walter
54579bf88f gio: GCancellable can be used concurrently
* Update documentation to note that GCancellable can be used
   concurrently by multiple operations.
 * Add documentation to g_cancellable_reset that behavior is
   undefined if called from within cancelled handler.
 * Add test for multiple concurrent operations using the same
   cancellable.

https://bugzilla.gnome.org/show_bug.cgi?id=656387
2011-08-19 11:13:37 +02:00
Brian Cameron
b5f1ea4bb1 void functions should not return. Fixes bug #656675. 2011-08-17 03:01:14 -05:00
Ryan Lortie
0a4663343f distcheck fixes 2011-08-15 21:01:23 -04:00
Simon McVittie
67cf3ea368 Add a stress-test for GDBusProxy in threads with no default main context
Destroying a GDBusProxy in a thread used to race with NameOwnerChanged
being delivered to the main context's thread (GNOME #651133).

Also, g_dbus_proxy_call_sync in a thread would race with NameOwnerChanged
being delivered to the main context's thread and rewriting the name_owner
(GNOME #656039).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=656039
Bug-NB: NB#259760
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:50:04 -04:00
Simon McVittie
85214d1e7f GDBusProxy: hold properties_lock while using any mutable property
This changes the meaning of "properties_lock" from "lock for D-Bus
properties" to "lock for GObject properties".

The most common problem, and the only one I've reproduced in a regression
test, is name_owner, which can be updated by the thread that owns
the GDBusProxy's main context (i.e. the thread-default main context of
the thread that constructed it) at the same time that a blocking call
is made. When a GDBusProxy is constructed in a thread-pool thread for
short-term use, the main context will typically be the global default
main context (which is actively running in the main thread!), making
this extremely problematic.

The interface info is perhaps a theoretical concern - one thread could
conceivably set it at the same time that another thread uses it, but only
in relatively pathological situations. The current API for this does have
the problem that it returns a borrowed ref, but interface info is
hopefully permanent anyway.

The default timeout is probably only a theoretical concern - it's just an
int, so writes are indivisible, and there's no worry about whether
something has been freed - but to be safe, let's hold the lock for that
too.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=656039
Bug-NB: NB#259760

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:50:03 -04:00
Simon McVittie
5909cb1031 GDBusProxy: factor out async_init_data_set_name_owner
This removes the need for async_init_get_name_owner_cb to cope with being
called without a real GAsyncResult, and will simplify the addition of
correct thread-locking.

In async_init_data_set_name_owner, use the name_owner parameter instead
of the corresponding member of GDBusProxyPrivate, partly to reduce
pointer-chasing but mainly to avoid needing to hold the lock.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:50:01 -04:00
Simon McVittie
03ae974f7c g_dbus_proxy_get_property: use accessors for all mutable state
These ought to have thread-locking, and having it in the accessor seems
better than duplicating it here.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:50:00 -04:00
Simon McVittie
20387d262f GDBusProxy: if a well-known name is not owned, don't GetAll from the dbus-daemon
If you run:

    ( cd gio/tests && G_DBUS_DEBUG=all ./gdbus-proxy-well-known-name )

you can see that in the case where the name com.example.TestService isn't
owned yet, the GDBusProxy calls GetAll() with no destination, resulting
in an error reply from the peer (the dbus-daemon itself). That's clearly
not right!

However, if priv->name is NULL, that indicates the special case where we
really do want to talk directly to a peer, instead of via the bus daemon
(most likely to be used on peer-to-peer connections); in that special
case, do call GetAll().

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:49:58 -04:00
Ryan Lortie
2b0171a808 g_settings_bind: add some g_return checks
https://bugzilla.gnome.org/show_bug.cgi?id=636405
2011-08-15 10:43:32 -04:00
David Zeuthen
20a4f2578f GDBusObjectManagerClient: Emit signals on proxy before emitting on manager
This is needed because the proxy may need to update its internal state
which a signal handler connected to the manager may rely on.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 05:43:24 -04:00
Sjoerd Simons
a9ca74efb1 Don't finish gtls connection if the handshake failed
https://bugzilla.gnome.org/show_bug.cgi?id=656283
2011-08-13 16:15:11 -04:00
Matthias Clasen
ae496a52a9 GDBusProxy: on_properties_changed initialize some variables
This avoids calling g_variant_unref and g_free on uninitialized memory
if PropertiesChanged is received in the creating thread's thread-default
main context's thread, at the same time as releasing the last ref in
another thread. This would result in "goto out" before the variables
freed after that label had been initialized to NULL.

Based on a patch by Simon McVittie, bug 656282
2011-08-13 16:09:41 -04:00
David Zeuthen
428f49b9c8 In addition to /media and $HOME, also show mounts in $XDG_USER_DIR
Prepare for the future where udisks will use $XDG_USER_DIR/Volumes
instead of /media when mounting filesystems on behalf of the user.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-12 11:10:22 -04:00
Martin Pitt
c3fd789bb7 [gi] Add missing (out) annotation to g_dbus_{node,interface}_info_generate_xml() 2011-08-11 14:09:23 +02:00
Martin Pitt
782f839383 [gi] Add missing Gio transfer annotations 2011-08-11 11:38:20 +02:00
Martin Pitt
0e54825120 [gi] Fix parameter name typos in Gio docstrings
Found by GIR compiler when building gobject-introspection:

gir/gio-2.0.c:33525: Warning: Gio: g_tls_password_set_description: unknown
parameter 'flags' in documentation comment, should be one of 'password',
'description'
gir/gio-2.0.c:14568: Warning: Gio: g_action_group_action_state_changed: unknown
parameter 'state' in documentation comment, should be one of 'action_group',
'action_name', 'value'
2011-08-11 11:38:19 +02:00
Martin Pitt
b2c6b801bc [gi] Add missing transfer annotation to g_dbus_node_info_lookup_interface() 2011-08-10 22:51:32 +02:00
Martin Pitt
c783bfd4e7 [gi] Add missing (allow-none) annotations to g_dbus_connection_register_object() 2011-08-09 14:52:53 +02:00
Dan Winship
cfa90b8fc1 gio/tests/.gitignore: fix 2011-08-05 19:43:47 -04:00
Murray Cumming
d728c00a04 gio enums: Remove trailing commas 2011-08-04 21:47:07 +02:00
Stef Walter
29aae440fb Fix up ABI symbols after GTlsDatabase merge.
https://bugzilla.gnome.org/show_bug.cgi?id=636572
2011-08-04 09:43:45 +02:00
Stef Walter
0f99cfa882 GTlsDatabase and related objects
The database is an abstract object implemented by the various TLS
backends, which is used by GTlsConnection to lookup certificates
and keys, as well as verify certificate chains.

Also add GTlsInteraction, which can be used to prompt the user
for a password or PIN (used with the database).

https://bugzilla.gnome.org/show_bug.cgi?id=636572
2011-08-04 08:54:55 +02:00
kotarou
a187199efd build: Pass ZLIB_CFLAGS for gio build
Otherwise we will fail if zlib is in an alternative prefix.

Commit message written by Colin Walters <walters@verbum.org>

https://bugzilla.gnome.org/show_bug.cgi?id=655769
2011-08-03 08:47:01 -04:00
Owen W. Taylor
ee63179b71 g_cancellable_get_fd: silently return -1 for NULL cancellable
This keeps compatibility with previous behavior.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-01 16:24:34 -04:00
David Zeuthen
659ba3d0b3 GDBusConnection: Only apply exit-on-closed semantics if properly initialized
Otherwise there is no point in gracefully handling the error...

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-01 11:58:05 -04:00
Nicolas Dufresne
dbb78fe57d Added TLS PEM parser unit test 2011-07-27 16:23:33 -04:00
Nicolas Dufresne
fdfb42b9f2 Rework PEM parsing to not be order dependent
Some valid PEM file would not work because the private key was put
before the certificate.
2011-07-27 16:23:33 -04:00
Tomas Bzatek
fb45baaf8c Docs: Correct the namespace for g_file_query_filesystem_info() 2011-07-26 17:32:53 +02:00
David Zeuthen
b7f3638e5c More gdbus-codegen fixed to build on non-Unix
https://bugzilla.gnome.org/show_bug.cgi?id=655148#c6

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-07-26 10:05:57 -04:00
Ryan Lortie
633fd86815 glocalfile: don't bother with fstype on win32
Fixes the broken build on Windows.
2011-07-26 11:20:12 +02:00
Ryan Lortie
12f516b44c Merge branch 'gwakeup' 2011-07-26 10:50:25 +02:00
Ryan Lortie
c81eb121a1 GWakeup: make it private API
Colin requests that we keep this one private for now.

Include it at each point of use (libglib, libgio, tests).
2011-07-25 18:51:03 +02:00
David Zeuthen
32b1349a23 More fixes for non-Unix builds
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-07-25 10:31:17 -04:00
David Zeuthen
f8b98841ad Fix the build on non-Unix
https://bugzilla.gnome.org/show_bug.cgi?id=655148

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-07-25 09:56:01 -04:00
Ryan Lortie
0a971e46bf GCancellable: port to GWakeup 2011-07-25 15:30:35 +02:00
Murray Cumming
3769c1e173 Docs: Fix tiny typo. 2011-07-25 09:24:43 +02:00
Dan Winship
eac8d47e37 gio/tests/socket: add some basic IPv4 and IPv6 tests 2011-07-24 14:55:05 -04:00
Dan Winship
aefda965f6 GSocket: fix connected state after async connect
socket->priv->connected was only being set if g_socket_connect()
succeeded right away; in the case where it returns G_IO_ERROR_PENDING,
it never got set. Fix that by having g_socket_check_connect_result()
set it on success.
2011-07-24 14:54:45 -04:00
Matthias Clasen
4cb33b158b Explicitly unset the session bus address for the peer tests
Otherwise, we may run into trouble as opening a peer-to-peer
connection uses a socket client, which uses a proxy resolver
which may end up using gsettings, whose dconf backend may end
up using the session bus to talk to dconfd...
2011-07-23 21:59:49 -04:00
Matthias Clasen
d344e69dc2 Properly bring up a session bus for application tests
As pointed out in bug 644601, session_bus_up() requires
us to set up environment variables for things to work.
2011-07-23 21:16:28 -04:00
Matthias Clasen
1f9e84896b Fix a typo 2011-07-23 21:07:48 -04:00
Vincent Untz
ae7c48b955 GDesktopAppInfo: Add g_desktop_app_info_get_show_in()
Necessary for rebasing gnome-menus on top of GDesktopAppInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=655044
2011-07-23 10:05:12 +02:00
David Zeuthen
c404dbed11 gdbus-codegen: Add support for new org.gtk.GDBus.C.UnixFD annotation
Also add convenience _with_unix_fd_list variants to GDBusConnection,
GDBusProxy and GDBusMethodInvocation types to easily support this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-07-21 16:06:18 -04:00
David Zeuthen
03f673abc2 GDBus: Don't convert GVariant type 'h' to gint
The code-generator already uses GVariant* so generated code didn't
really work at all. We want that instead of gint to avoid confusion
because a 'h' instance is an _index_ into a GUnixFDList, not a file
descriptor.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-07-21 09:43:59 -04:00
David Zeuthen
419bfe325c gdbus-codegen: Use G_TYPE_STRV/gchar** for GVariant type 'ao'
This is possible now that we have better support for object path
arrays, see

 http://git.gnome.org/browse/glib/commit/?id=19878998bc386db78614f1c92ff8524a81479c7b

Note that this breaks the ABI of generated code but since
gdbus-codegen(1) has never yet been in a stable GLib release, this is
fine.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-07-21 09:32:38 -04:00
Benjamin Otte
a5e94cbd36 glocalfile: Fix compilation without USE_STATFS and USE_STATVFS 2011-07-21 02:58:15 +02:00
Giovanni Campagna
4e015d36a0 gdbusintrospection: fix introspection annotations
g_dbus_interface_info_lookup_* were incorrectly considered
(transfer full) by introspected bindings, and this caused memory
corruptions.

https://bugzilla.gnome.org/show_bug.cgi?id=622921
2011-07-20 13:50:20 -04:00
Ryan Lortie
c841c2ce3f GSettings: don't abort on missing schemas
Give a g_critical instead.
2011-07-20 14:06:36 +02:00
Ryan Lortie
06941419e3 Add some blacklisted mount directories
Another long-carried Debian patch.  No reason that we should not have
these few extra items in the (already long) upstream list.
2011-07-20 10:52:07 +02:00
Holger Berndt
d1e5161ab0 Document how to unset attributes
Unsetting won't work on all attributes. Currently, only
metadata attributes are supported.

https://bugzilla.gnome.org/show_bug.cgi?id=620423
2011-07-19 22:52:56 +02:00
Johan Dahlin
ec98953e42 Pass in NULL instead of g_cclosure_marshal_generic
NULL is now a shortcut for g_cclosure_marshal_generic, so avoid
referencing it directly.

https://bugzilla.gnome.org/show_bug.cgi?id=654917
2011-07-19 14:38:34 -03:00
Ryan Lortie
fe6dad271b GSettings: remove key length restrictions
The key length now stands effectively unlimited at 1024 characters.

https://bugzilla.gnome.org/show_bug.cgi?id=654536
2011-07-19 16:12:30 +02:00
Patrick Welche
7f289c924b Avoid failing arguments to statfs() test on systems which use statvfs.
- move choice of statfs vs statvfs from gio/glocalfile.c to configure.ac
- if statvfs is the choice, then don't check number of arguments to statfs()
- use choice in gio/gunixmounts.c as well

https://bugzilla.gnome.org/show_bug.cgi?id=617949
2011-07-18 14:17:28 -04:00
Ryan Lortie
8f5e0cd240 GDBusInterfaceSkeleton: fix odd use of floating refs
The get_properties() function was documented as returning a floating

Switch it over to returning a normal reference and patch a couple of
uses.

https://bugzilla.gnome.org/show_bug.cgi?id=654394
2011-07-12 19:44:21 +02:00
Ryan Lortie
58c247e51b GVariant: add g_variant_take_ref()
This function implements the following logic:

  if (g_variant_is_floating (value))
    g_variant_ref_sink (value);

which is used for consuming the return value of callbacks that may or
may not return floating references.

This patch also replaces a few instances of the above code with the new
function (GSettings, GDBus) and lifts a long-standing restriction on the
use of floating values as the return value for signal handlers by
improving g_value_take_variant().

https://bugzilla.gnome.org/show_bug.cgi?id=627974
2011-07-12 19:44:21 +02:00
Murray Cumming
bbe7eb09ec Docs: Fixed a typo. 2011-07-12 12:09:31 +02:00
Tim-Philipp Müller
7654a848e2 tests: fix glib_translations_work()
If setlocale() to our test locale fails, translations
won't work either.

https://bugzilla.gnome.org/show_bug.cgi?id=654017
2011-07-11 00:08:14 -04:00
Matthias Clasen
2caddda534 Take out the timeout from the large-message test
This is an attempt to make the test not fail on build slaves,
which currently getting a timeout error here.
2011-07-10 23:11:30 -04:00
Martin Storsjo
7c517bf350 Don't needlessly use "echo -e"
The -e parameter to echo isn't recognized by echo in POSIX sh,
but isn't needed when no escaped characters need to be
interpreted.

This fixes building glib with a mingw cross compiler on Mac OS X.

https://bugzilla.gnome.org/show_bug.cgi?id=654085
2011-07-10 20:47:02 -04:00
Colin Walters
182ed95861 GCancellable: Make eventfd() fall back to pipes on EINVAL too
https://bugzilla.gnome.org/show_bug.cgi?id=654232
2011-07-10 12:19:15 -04:00
Dan Winship
37ab5ced31 g_output_stream_splice: deal with overflow
On 32-bit machines in particular, bytes_written may overflow a gssize.
Notice when that happens and just return G_MAXSSIZE instead.

https://bugzilla.gnome.org/show_bug.cgi?id=649246
2011-07-06 08:39:38 -04:00
Matthias Clasen
9c09a48f57 Fix the build
When renaming a variable from _SCRIPTS to _DATA, it helps to
also rename all references.
2011-07-04 16:04:15 -04:00
Chun-wei Fan
fabbf82ae1 Updated GIO Visual Studio Projects
-In gio/Makefile.am, the name for one of the filters for capturing the
 sources for the GIO VS Project Files is corrected.
-Remove the GIO source file items in the VS project files templates as
 a result for this change, and move the entry of the "new"
 gregistrysettingsbackend.c into the filter in gio/Makefile.am
2011-07-04 21:47:59 +08:00
Ryan Lortie
8fdfa8bf33 Install completion scripts as DATA, not SCRIPTS
They are sourced by the shell and don't include a #!/bin/sh, so they shouldn't
be marked as executable.
2011-07-03 17:37:35 +02:00
Dan Winship
2080bb1dc0 gasyncresult: document that NULL GAsyncReadyCallback is allowed
https://bugzilla.gnome.org/show_bug.cgi?id=653484
2011-07-01 11:28:12 -04:00
Dieter Verfaillie
2456db2c00 GCancellable: Fix build on Win32
https://bugzilla.gnome.org/show_bug.cgi?id=653522
2011-06-30 09:32:32 -04:00
Emmanuele Bassi
847a8eb911 gio: Some more build fixes 2011-06-29 18:07:29 +01:00
Emmanuele Bassi
87a542bc96 Fix build
The g_return_val_if_fail() macro takes a return value.
2011-06-29 18:00:53 +01:00
Ryan Lortie
b73e53f577 parameter guards for GSimpleAction constructors 2011-06-29 17:32:21 +01:00
Ryan Lortie
bde41dacf7 GAction: make GObject properties read-only
GAction is a read-only interface (as is visible by the lack of _set() functions
on its API).  The properties on the interface currently force implementors to
support writing of the properties at construct time, however.

Lift that restriction.

Take advantage of this from GSimpleAction by nuking the set_property
function and setting the fields directly in the constructor.
2011-06-29 17:32:21 +01:00
Ryan Lortie
e6a25caa82 actions: merge testcases change_state and entries
Since we have support for change_state in GActionEntry now.
2011-06-29 16:20:52 +01:00
Ryan Lortie
276750aa7a Add 'change_state' callback to GActionEntry 2011-06-29 16:20:52 +01:00
Ryan Lortie
535dcf4f22 Add example for 'change-state' signal
Pulled from the testcase.
2011-06-29 16:20:52 +01:00
Ryan Lortie
d5915a4be3 Add testcase for GSimpleAction::change-state 2011-06-29 16:20:52 +01:00
Ryan Lortie
9a23ef6c2d Add 'change-state' signal to GSimpleAction
If connected, allows the user to control the result of
g_action_change_state().
2011-06-29 16:20:52 +01:00
Ryan Lortie
6383b3e709 Add example to docs for using GActionEntry 2011-06-29 16:20:52 +01:00
Ryan Lortie
5978a6edb5 Add a test case for GActionEntry 2011-06-29 16:20:52 +01:00
Ryan Lortie
7dd25022ee Add g_simple_action_group_add_entries()
A convenience API for creating lots of actions quickly.
2011-06-29 16:20:52 +01:00
Ryan Lortie
695a9a7993 allow NULL state in g_simple_action_new_stateful
as an undocumented feature
2011-06-29 16:20:52 +01:00
Ryan Lortie
5ff65d8695 Make 4 incompatible changes to the GAction API
This commit represents an API break to GAction in the following ways:

  - the 'set_state' entry in the GActionInterface vtable has been
    renamed to 'change_state'.  The number and order of vtable items has
    not otherwise changed.

  - g_action_set_state() has been renamed to g_action_change_state() to
    match the updated vtable entry.

  - the "state" property of the GAction interface has been changed to
    read-only to reflect the fact that g_action_set_state() no longer
    exists.

  - GSimpleActionClass has been hidden.  GSimpleAction can no longer be
    subclassed.

>> Rationale

g_action_set_state() has never been a true setter in the sense that
calling it will update the value of the "state" property.  It has always
been closer to "request 'state' to be changed to this value" with
semantics defined by the implementor of the interface.  This is why the
equivalent method in GActionGroup had its name changed from 'set' to
'change'.  This change makes the two interfaces more consistent and
removes any implication about the effect that calling set_state() should
have on the 'state' property.

>> Impact

This incompatible API break was undertaken only because I strongly
suspect that it will go entirely unnoticed.  If the break actually
affects anybody, then we will accommodate them (possibly going as far as
to revert this commit entirely).

The virtual table change only impacts implementors of GAction.  I
strongly suspect that this is nobody (except for GSimpleAction).

The hiding of GSimpleActionClass only impacts impacts subclasses of
GSimpleAction.  I strongly suspect that none of these exist.

The changing of the property to be read-only only affects people who
were trying to change the state by using GObject properties.  I strongly
suspect that this is nobody at all.

The removal of the g_action_set_state() call is the most dangerous, but
I still suspect that it will impact nobody outside of GLib.  If anybody
is impacted by this change then, at their request, I will reintroduce
the API as a deprecated alias for g_action_change_state().
2011-06-29 11:38:21 +01:00
Colin Walters
315210ecdb GCancellable: Fix build on Win32
https://bugzilla.gnome.org/show_bug.cgi?id=653522
2011-06-28 12:52:58 -04:00
Claudio Saavedra
3cbd5565ae GSimpleAction: fix typo 2011-06-24 16:04:54 +03:00
Colin Walters
fa87399280 GCancellable: Use Linux eventfd() instead of pipe
See commit f626dd2b4311bd82137c5b208ab2de288c3e6fae for rationale;
basically it's cheaper than a pipe.

https://bugzilla.gnome.org/show_bug.cgi?id=653140
2011-06-21 23:28:52 -04:00
Dan Winship
29bb7638a5 gio/Makefile.am: Remove stray references to $(marshal_sources) 2011-06-21 16:14:50 -04:00
Colin Walters
9053ad07ba Fix a srcdir!=builddir issue, and export that we support it
Future jhbuild versions will consume the BUILD API and automatically
use a builddir, so mark us as supporting it.
2011-06-21 10:30:07 -04:00
Colin Walters
b74e2a720a Stop using glib-genmarshal at build time
To help cross compilation, don't use glib-genmarshal in our
build.  This is easy now that we have g_cclosure_marshal_generic().

In gobject/, add gmarshal.[ch] to git (making the existing entry
points stubs).

In gio/, simply switch to using g_cclosure_marshal_generic().

https://bugzilla.gnome.org/show_bug.cgi?id=652168
2011-06-20 17:24:07 -04:00
David Zeuthen
322e25b535 GDBus: Unref worker from worker-thread to avoid race
... otherwise we might end up using the worker after it has been
freed. Reported by Dan Winship and Colin Walters.

This fix uncovered a bug in the /gdbus/nonce-tcp test case so "fix"
that as well to use a better way of having one thread wait for another
(using quotes for the word "fix" since it's pretty hackish to
busy-wait in one thread to wait for another).

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-20 16:32:03 -04:00
Colin Walters
d54c65448c gdbus-test-codegen: Allocate full integer space for uint16 properties
Because there is no G_TYPE_[U]INT16, we need to use integer types,
otherwise we'll end up overwriting memory (in this case on the stack).
2011-06-20 14:03:05 -04:00
Colin Walters
19610184c4 gdatainputstream: Add Since: tags and update gio-sections.txt
https://bugzilla.gnome.org/show_bug.cgi?id=652758
2011-06-17 08:52:23 -04:00
Colin Walters
28254a38a7 GDataInputStream: Add _utf8() variants of _read_line
These will validate the resulting line, and throw a conversion error.
In practice these will likely be used by bindings, but it's good
for even C apps too that don't want to explode if that text file
they're reading into Pango actually has invalid UTF-8.

https://bugzilla.gnome.org/show_bug.cgi?id=652758
2011-06-16 20:03:02 -04:00
Colin Walters
ff2f46a7f4 GDataInputStream: Clarify read_line() docs, mark as byte array
g_data_input_stream_read_line() and
g_data_input_stream_read_line_finish() don't do any encoding checks,
so we shouldn't call the returned value a "string" (which I'd like to
mean UTF-8).  Annotate them as byte arrays and add encoding warnings
to the docstrings.

https://bugzilla.gnome.org/show_bug.cgi?id=652758
2011-06-16 20:00:02 -04:00
Matthias Clasen
28008138c3 Silence a compiler warning 2011-06-14 21:06:17 -04:00
Matthias Clasen
b6a829c314 If dup fails don't call close() 2011-06-14 18:51:57 -04:00
Matthias Clasen
ba6e66bff1 Don't compare unsigned numbers with 0
It does not work.
2011-06-14 18:51:57 -04:00
David Zeuthen
a6d33d3a28 GDBusMessage: Optimize serializer and deserializer
... by using a switch instead of if-then-else.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-14 18:12:04 -04:00
Matthias Clasen
01e6cf1360 Don't do < 0 on an unsigned value
It won't work. read() returns a signed value, anyway.
2011-06-14 11:40:32 -04:00
Matthias Clasen
83d34f6309 Don't forget to free resources in an early return 2011-06-14 10:07:22 -04:00
Matthias Clasen
3dc34de0ff Avoid a deref-before-NULL-check warning 2011-06-14 10:04:06 -04:00
Matthias Clasen
339cac8fc7 Remove unneeded NULL check
We ensure 10 lines up that parameters is not NULL.
2011-06-14 09:53:26 -04:00
Matthias Clasen
cf7f50b28e Remove an unneeded NULL check
data->proxy cannot be NULL here, or we'd have crashed 10 lines up.
2011-06-14 09:50:55 -04:00
Matthias Clasen
4c63303f9f Silence an uninitialize variable warning 2011-06-14 09:44:45 -04:00
Matthias Clasen
114b9b2504 Fix up symbol lists and docs 2011-06-14 07:17:06 -04:00
Vincent Untz
b87d9405be GDesktopAppInfo: Fix declaration of g_desktop_app_info_get_nodisplay 2011-06-14 09:01:25 +02:00
Vincent Untz
86ffdf5570 GDesktopAppInfo: Add g_desktop_app_info_get_nodisplay
Necessary for rebasing gnome-menus on top of GDesktopAppInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=652385
2011-06-14 08:53:48 +02:00
Colin Walters
5ec6eafb0e gdbus-codegen tests: Fix usage of top_srcddir
Based on a patch from Rico Tzschichholz.
2011-06-13 14:17:44 -04:00
Dan Winship
7412e073d1 update .gitignores 2011-06-12 16:17:30 -04:00
Murray Cumming
4db88bd6e2 gioenums.h: Remove trailing commas 2011-06-09 20:17:52 +02:00
David Zeuthen
7ff248e822 gdbus: Don't pass an unintialized GError pointer
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-09 13:29:58 -04:00
David Zeuthen
30dfc35392 gdbus: Add --recurse and --only-properties options
These options are useful when debugging D-Bus services and working
with bug reports.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-09 13:22:18 -04:00
David Zeuthen
13b93f0c48 Bug 652197 – Improper handling of double values in GDBusMessage
Matthew Bucknall pointed out

  GDBusMessage does not serialize/deserialize double values correctly
  on platforms with strict alignment constraints (in my particular
  case, ARM926EJ-S).

This was reported in

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-09 12:02:30 -04:00
David Zeuthen
f819aa5f17 gdbus-codegen: Fix build
See https://bugzilla.gnome.org/show_bug.cgi?id=651998 for details.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-09 11:53:08 -04:00
Matthias Clasen
d6b341c38c Test the previous fix
Just make one of the existing GApplication test cases use
a dash in the id.
2011-06-08 22:38:11 -04:00
Ryan Lortie
f44cd41293 GApplication: allow '-' in application ID
By converting it to _ before trying to shove it into an object path.

https://bugzilla.gnome.org/show_bug.cgi?id=652025
2011-06-08 22:21:15 -04:00
Javier Jardón
20d56289b9 gconverter: Improve cross-references 2011-06-08 16:28:16 +01:00
Dan Winship
adf70f4596 Fix export_symbols variable in gio/Makefile.am
https://bugzilla.gnome.org/show_bug.cgi?id=646608
2011-06-07 17:22:58 -04:00
Dan Winship
686f32fcc2 Fix "Since" tags on g_data_input_stream_read_upto{,_async}
https://bugzilla.gnome.org/show_bug.cgi?id=647930
2011-06-07 17:19:24 -04:00
Colin Walters
ab0e9dbfa7 Generate $module-public-headers.txt file, feed it to gtk-doc
Rather than having the gtk-doc build machinery have a list of header
files to exclude, change the GLib build to dump a list of public
header files generated from the maintained Makefile.am files for
each of glib/, gobject/, gio/.

Also, for glib, always install glib-unix.h, even on non-Unix
platforms, for the same reason we install gwin32.h even on Unix.

https://bugzilla.gnome.org/show_bug.cgi?id=651745
2011-06-07 14:18:36 -04:00
Colin Walters
003e052442 gdbus-codegen: Clean config.pyc to make distcheck happy 2011-06-07 14:17:11 -04:00
Chun-wei Fan
09c98f18fc Update gsettings utilities in GIO
Avoid C99-style variable declaration
2011-06-07 10:49:29 +08:00
Chun-wei Fan
405b4ff4f4 Update the year in the *.rc.in files
Sorry this change came a bit late...
2011-06-07 08:55:31 +08:00
Colin Walters
62072b2a04 gdbus codegen: Ensure PYTHONPATH is set correctly for srcdir != builddir
We need to pick up the Python files from the source directory, so set
PYTHONPATH.
2011-06-06 17:14:45 -04:00
Dan Winship
1eb7efce8e Fix some socket docs issues, remove unused typedefs
pointed out by Matthias
2011-06-06 10:23:34 -04:00
David Zeuthen
f1e5af4e12 GDBusObject: Remove comment non-existant virtual functions
These were nuked a while ago.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-04 21:37:37 -04:00
Matthias Clasen
9a6529442c Fix doc syntax 2011-06-04 19:05:51 -04:00
Matthias Clasen
01f63b19f9 Fix links in gio docs 2011-06-04 18:48:19 -04:00
David Zeuthen
0b41002474 gdbus: Add a way to emit a signal
See https://bugs.freedesktop.org/show_bug.cgi?id=37890#c6 where it was
discovered that dbus-send(1) actually doesn't work (either libdbus-1's
flush implementation or dbus-send(1)'s usage of it is broken) so it's
useful to have here.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-04 12:36:38 -04:00
Matthias Clasen
87dc08ee4d Distcheck fixes
Fix VPATH builds.
2011-06-04 10:46:38 -04:00
Matthias Clasen
1aa348c14c Distcheck fixes
Accidentally committed debug leftover.
2011-06-04 10:45:54 -04:00
David Zeuthen
6d54505b2d Fix docs for D-Bus introspection data structures
Mark structs as boxed types and use /*< public >*/ so the struct
members are properly shown.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-03 14:39:04 -04:00
David Zeuthen
723adbc2fe Move gdbus-codegen example code and docs into separate directories
This avoids the generated types (e.g. ExampleAnimal, ExampleCat,
ExampleObject and ExampleObjectManagerClient) being referenced in the
core gio docs. This was requested by Matthias.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-03 14:18:56 -04:00
Colin Walters
7ed328aaf0 gdbus: Avoid blocking on worker thread in connection initialization
I can't see a reason to spin until the worker thread runs, so don't.
This avoids ugly sched_yield() calls that show up in strace and
annoy me; the code is cleaner now too.

We now grab the types needed for the WebKit workaround in the
thread creation area, but only release them when the thread itself
exits.

https://bugzilla.gnome.org/show_bug.cgi?id=651650
2011-06-01 16:43:34 -04:00
Matthias Clasen
a588974561 Expand content type docs slighly 2011-05-31 19:27:04 -04:00
muralis
a84e6f982f gthreadedresolver: fix hang on g_thread_pool_push() failure
In resolve_sync function in gthreadedresolver.c, if g_thread_pool_push
fails due to thread creation failure, we are just simply appending the
data to the queue of work to do. After the failure, we might wait
indefinitely in g_cond_wait. In case of g_thread_pool_push failure,
propagate the error so that this function does not blocks forever in
case of failure.

https://bugzilla.gnome.org/show_bug.cgi?id=651034
2011-05-31 08:56:50 -04:00
Neil Roberts
2df4750ace gsocket: Fix some cases of returning error without setting *error
g_socket_shutdown and g_socket_close were calling check_socket with a
NULL error parameter so any errors wouldn't get propagated up.

https://bugzilla.gnome.org/show_bug.cgi?id=651327
2011-05-28 19:46:15 -04:00
Neil Roberts
0703dbc21f gsocket: Fix the error message for a failed g_socket_shutdown
The GError message for g_socket_shutdown was reporting that it was
"Unable to create socket" which is presumably a cut-and-paste bug.

https://bugzilla.gnome.org/show_bug.cgi?id=651327
2011-05-28 19:46:14 -04:00
Antoine Jacoutot
56c0d0f384 Fix compile warnings on OpenBSD.
https://bugzilla.gnome.org/show_bug.cgi?id=651223
2011-05-28 18:59:38 -04:00
Matthias Clasen
2fb57ff46f Quiet down the build a bit 2011-05-28 14:29:08 -04:00
Matthias Clasen
7d0eac03e9 glib-compile-schemas: write informational messages to stdout
The fact that we return 0 here makes it clear that this
is not considered an error, so it makes sense to not
write these messages to stderr.
Proposed by Antoine Jacoutot,
https://bugzilla.gnome.org/show_bug.cgi?id=650882
2011-05-27 18:30:45 -04:00
Antoine Jacoutot
77f4f5aa02 Add glib credentials support to OpenBSD.
https://bugzilla.gnome.org/show_bug.cgi?id=650885
2011-05-27 14:22:56 -04:00
David Zeuthen
25440ce014 GDBusProxy: Mention gdbus-codegen in docs
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-26 10:18:44 -04:00
David Zeuthen
06f5de77f0 GDBusProxy: Fix incorrect locking
Pointed out by mclasen.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-26 10:07:38 -04:00
David Zeuthen
c0f4a63c89 GDBusProxy: Add locking and notes/guarantees about MT safety
This was discussed in

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-26 09:56:14 -04:00
David Zeuthen
7e0f890e38 GDBusProxy: Fix race condition when unsubscribing from signals
This was reported in bug 651133.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-26 09:26:29 -04:00
Richard Hughes
9936f961ba Correct the annotation for g_file_enumerator_get_container()
We don't ref the returned object, and alex has verified the gvfs implementation.
2011-05-26 12:37:36 +01:00
David Zeuthen
ab18737ead gdbus-codegen: Properly render @param and %TRUE in generated Docbook
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-24 00:27:43 -04:00
David Zeuthen
263ce3042c gdbus-codegen: Handle unexpected XML tags
This was reported in bug 650874. Add tests.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-23 23:23:10 -04:00
Giovanni Campagna
0aae977ac1 gdbusintrospection: fix introspection of DBus Introspection structures
Correctly mark fields as arrays (requires changing gobject-introspection
to pick those).

https://bugzilla.gnome.org/show_bug.cgi?id=646635
2011-05-23 22:15:56 +02:00
Ray Strode
eabad1923e Revert "gsettings-tool: warn if setting a value fails"
This reverts commit ea57feff96.

It makes the gsettings tool fail any time it tries to set a
key to a value, that the key already has.

https://bugzilla.gnome.org/show_bug.cgi?id=641768
2011-05-23 13:40:02 -04:00
Antoine Jacoutot
ce0f7cafa1 Fix build with gcc-2.*.
https://bugzilla.gnome.org/show_bug.cgi?id=650884
2011-05-23 13:05:49 -04:00
Matthias Clasen
b5056fbaf9 Simply symbols files
The grouping in files/headers is not used anymore, and
the function attributes neither. Adapt abicheck scripts
and .def file generation rules accordingly.
2011-05-23 00:21:06 -04:00
Ryan Lortie
9793919d7b Whitespace fixes 2011-05-18 17:56:50 -04:00
Ryan Lortie
0e63b57eea GApplication: fix remote action states
Fix up remote_action_info_new_from_iter() to do its job better and use
it from all places that it's appropriate.

Closes #650236.
2011-05-18 17:53:07 -04:00
Ryan Lortie
0e10116b3b Add debug output to GApplication actions example
Enough to clearly demonstrate bug #650236.
2011-05-18 16:13:03 -04:00
Ryan Lortie
8148a3c396 Fix gsettings tool string handling
There are some bugs caused by the way that gsettings-tool currently
attempts to help the user when they leave the quotes off of a string
value that they are setting.

Simplify the code to make it more robust and add some comments about why
it should be done this way.

https://bugzilla.gnome.org/show_bug.cgi?id=649915
2011-05-17 11:58:46 -04:00
Emmanuele Bassi
b5934de456 Add gdbus autogenerated xml files to the ignore file 2011-05-16 16:10:06 +01:00
David Zeuthen
11e01802ab gdbus-codegen: Ensure that generated skeletons are MT-safe
For example, if setting a property on a skeleton from another thread
than where it was constructed, the idle handler responsible for
emitting the PropertiesChanged() signal could run immediately and
clear skeleton->priv->changed_properties_idle_source causing
g_source_unref() to be called with a NULL pointer. This race was
easily be fixed by adding a lock to the skeleton object.

In addition to fixing this race, also move the code for setting up the
idle handler to a class handler for the GObject::notify signal. This
change allows use of g_object_freeze_notify() and g_object_thaw_notify()
to perform atomic property changes from another thread than the one
that the skeleton was created in.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-15 12:38:24 -04:00
David Zeuthen
ae10eca116 gdbus-codegen: Use (skip) annotation on return values
This was discussed in bug 649657.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-13 14:24:22 -04:00
David Zeuthen
b9e3e03767 GDBusConnection: Document that sockets are frobbed into non-blocking mode
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-12 15:36:34 -04:00
David Zeuthen
ce77614142 gdbus-codegen: Mark members in generated class instance structs as private
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-11 21:16:41 -04:00
David Zeuthen
5a811135f7 Add g_dbus_method_invocation_take_error() convenience method
Similar in spirit to g_simple_async_result_take_error().

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-11 20:57:54 -04:00
Colin Walters
d39731724a gdbus-codegen: Fix annotation parsing
It takes 3 options.
2011-05-11 17:13:57 -04:00
Maarten Bosmans
97cd6fa2e3 gdbus-codegen: Quote substitution variables
Avoids failure if they contain spaces.

Commit message written by Colin Walters <walters@verbum.org>

https://bugzilla.gnome.org/show_bug.cgi?id=649775
2011-05-11 15:47:00 -04:00
Colin Walters
61295f87c9 gdbus-codegen: Drop dependency on argparse
This is only in Python 2.7 or as a separate module.  Use optparse
which exists since 2.3.

https://bugzilla.gnome.org/show_bug.cgi?id=649988
2011-05-11 15:39:34 -04:00
Ryan Lortie
c2a2350cc1 GSettings: fix example in the docs 2011-05-10 15:25:54 +02:00
Giovanni Campagna
53dc341b0d GDBusMethodInvocation: fix introspection annotations
In particular (transfer full), to avoid a refcounting bug and a
segmentation fault.

https://bugzilla.gnome.org/show_bug.cgi?id=646635
2011-05-09 19:04:25 +02:00
Martin Pitt
21c2291496 [gi] Add missing allow-none annotations to GDBusConnection 2011-05-08 23:07:40 +02:00
Ryan Lortie
1361ec78cd GSettings: keep resets on loss of writability
Don't drop resets from a GDelayedSettingsBackend when the writability
changes.  Resets will always succeed, even against non-writable keys and
some people (gnome-screensaver) are using them in a way that they would
want them not to be forgotten.
2011-05-07 11:45:44 +02:00
Ryan Lortie
a38c97af51 Allow NULL to be stored into GSettings trees
This is used for resets (in theory) and currently it crashes when
freeing the tree.
2011-05-07 11:45:44 +02:00
David Zeuthen
720d6ec8e4 gdbus: Add a --timeout option
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-06 15:27:52 -04:00
David Zeuthen
f773bd8b76 gdbus-codegen: gracefully handle property get on proxy with no cached property
This can easily happen if the owner of the remote object vanishes. Of
course, when that happens, user code is already notified (by e.g. the
notify::g-name-owner signal) so it can avoid using the proxy but
requiring that is a bit harsh. IOW, before this patch this critical
error was printed

 GLib-GIO-CRITICAL **: g_dbus_gvariant_to_gvalue: assertion `value != NULL' failed

when that happened. With this patch, we just avoid setting the GValue
so the user will get the default value for its type instead. So, for
example, if the user code is getting a GVariant property on such a
defunct proxy, then he gets a NULL back. So unless said user code
checks the return value, criticals will still be printed if the NULL
GVariant is used for anything interesting.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-06 10:32:42 -04:00
Dan Winship
914d10055c Add two annotations for g-i 2011-05-05 15:18:22 -04:00
Colin Walters
8932a1a7a3 GSocket: Use MSG_CMSG_CLOEXEC
This ensures received file descriptors don't leak to child processes.

https://bugzilla.gnome.org/show_bug.cgi?id=649480
2011-05-05 14:09:11 -04:00
Chun-wei Fan
9f90408e97 Update gcancellable.c for Win32
errno.h is still required for Windows in this file...
2011-05-05 13:40:38 +08:00
Matthias Clasen
5b4da74bc7 More distcheck fixes 2011-05-04 20:45:46 -04:00
Matthias Clasen
d5d4659a60 Try to fix distcheck 2011-05-04 19:44:05 -04:00
Ray Strode
c062350159 gdbus-codegen: don't assert non-negativity for unsigned values
The code generator sprinkles a few asserts in its output of the form:

g_assert (prop_id - 1 >= 0 && prop_id - 1 < %d);\n

prop_id is unsigned, though, so this generates a compiler warning for
me.

This commit changes the code to merely check for prop_id != 0 instead of
prop_id - 1 >= 0
2011-05-04 12:45:22 -04:00
Alexander Larsson
d97cbc6731 gdbus-codegen: Make sure we pass -Werror
_g_value_equal might not always be used, so mark it G_GNUC_UNUSED
to make sure we're -Werror clean.
2011-05-04 13:54:34 +02:00
David Zeuthen
1ab29b6c4a GDBusObjectManagerServer: Allow setting :connection property
.. and add a C setter to do this. Also make the C getter return a
reference since the property may be set from another thread. Also
change the constructor to _not_ take a GDBusConnection since this is
something you almost always want to do _after_ creating it. The
API/ABI break is fine as there has never been a GLib release with this
type.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-04 03:43:52 -04:00
Colin Walters
542215b78a Rename g_unix_pipe_flags to g_unix_open_pipe
From IRC discussion, people liked this name more.

https://bugzilla.gnome.org/show_bug.cgi?id=649322
2011-05-03 23:34:17 -04:00
Colin Walters
c078223b38 GCancellable: Use g_unix_pipe_flags with FD_CLOEXEC
The old code was creating a pipe and setting FD_CLOEXEC
non-atomically.

https://bugzilla.gnome.org/show_bug.cgi?id=649225
2011-05-03 10:14:48 -04:00
Colin Walters
ed37970a04 g_unix_set_fd_nonblocking: New API to control file descriptor blocking state
And use it in relevant places in GLib.

https://bugzilla.gnome.org/show_bug.cgi?id=649225
2011-05-03 10:14:48 -04:00
Dan Winship
e56498ee0b Fix usage of _GNU_SOURCE
_GNU_SOURCE must be defined before including any other (system)
header, so defining it in glib-unix.h (and hoping no one has included
anything else before that) is wrong. And the "#define _USE_GNU"
workaround for this problem in gnetworkingprivate.h is even wronger
(and still prone to failure anyway due to single-include guards).

Fix this by defining _GNU_SOURCE in config.h when building against
glibc. In theory this is bad because new releases of glibc may include
symbols that conflict with glib symbols, which could then cause
compile failures. However, most people only see new releases of glibc
when they upgrade their distro, at which point they also generally get
new releases of gcc, which have new warnings/errors to clean up
anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=649201
2011-05-03 07:07:41 -04:00
Colin Walters
e71fdf6b5a Drop translated g_warning/g_error
http://mail.gnome.org/archives/desktop-devel-list/2011-March/msg00069.html
2011-05-02 14:44:25 -04:00
Dan Winship
181763438a Update .gitignores 2011-05-02 09:54:15 -04:00
Matthias Clasen
f4cff2b923 Some documentation additions 2011-05-01 23:02:53 -04:00
Ryan Lortie
426e1b6159 Remove duplicate GDBusInterface declaration
It was in gdbusinterface.h but also in giotypes.h.  Remove it from the
former.
2011-04-29 17:07:28 -04:00
David Zeuthen
92aed13eb8 Update docs to take comments/suggestions from Matthias into account
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-29 13:11:22 -04:00
David Zeuthen
0e352fdb18 Merge branch 'master' into gdbus-codegen 2011-04-29 12:01:35 -04:00
Alexander Larsson
9eba49a982 GFilterInputStream: close-base-stream should not be construct-only
This is a runtime changable property (by the methods for it), must
be a cut and paste error.
2011-04-29 16:14:17 +02:00
Colin Walters
27246c615d Update gio.symbols for previous two commits 2011-04-27 13:29:07 -04:00
Colin Walters
4098ddcb06 GDesktopAppInfo: Add g_desktop_app_info_get_generic_name
Necessary for rebasing gnome-menus on top of GDesktopAppInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=647967
2011-04-27 11:34:43 -04:00
Colin Walters
276e6a7be8 GDesktopAppInfo: Add g_desktop_app_info_get_categories()
This is needed to rebase gnome-menus on top of GDesktopAppInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=647903
2011-04-27 11:24:37 -04:00
Murray Cumming
6dcf505346 GDBusServer: Documentation: Improvements.
Provide a fuller description and lead people away if they arrived
here just looking for a way to provide a regular D-Bus service.

https://bugzilla.gnome.org/show_bug.cgi?id=646425
2011-04-26 23:21:02 -04:00
Christian Persch
71c7e49058 Use G_SIGNAL_MUST_COLLECT for VARIANT signals
Bug #643624.
2011-04-26 22:58:02 -04:00
Matthias Clasen
122a53a9bc Fix up some harmless FALSE <> NULL confusions
Reported in bug 643134.
2011-04-26 22:51:54 -04:00
Colin Walters
2a3f7f49b4 GDesktopAppInfo: Add "filename" property for bindings
GDesktopAppInfo violates the GObject rule that your C constructors
should just be thin wrappers around g_object_new().  While GKeyFile
isn't introspctable, this patch allows from JavaScript:

var app = new Gio.DesktopAppInfo({ filename: '/path/to/foo.desktop' });

https://bugzilla.gnome.org/show_bug.cgi?id=648425
2011-04-26 15:08:54 -04:00
Colin Walters
1056f2240c Squash some uninitialized variable compiler warnings
From GCC 4.6.
2011-04-26 13:29:05 -04:00
Dan Winship
df45856bba GSimpleAsyncResult: push thread context around callback
When an old pre-thread-default-context API that takes an explicit
GMainContext wants to call a gio API, it must call
g_main_context_push_thread_default() before, and
g_main_context_pop_thread_default() after the gio call, so that the
gio method will return its result to the desired GMainContext.

But this fails for methods like g_socket_client_connect_async() that
make a chain of multiple async calls, since the pushed/popped context
will only affect the initial call.

Fix this by having GSimpleAsyncResult itself push/pop the context
around the callback invocation, so that if the callback queues another
async request, it will stay in the same context as the original one.

https://bugzilla.gnome.org/show_bug.cgi?id=646957
2011-04-26 11:32:11 -04:00
David Zeuthen
0377fe7005 gdbus-codegen: Fix typo in generated docs
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-25 10:42:50 -04:00
David Zeuthen
bbe945183b gdbus-codegen: Generate GDBusObject{,Proxy,Skeleton} subtypes
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-25 09:29:18 -04:00
Michael Terry
a330c2f19f Don't ignore SUPPORTS_STARTUP_NOTIFICATION for commandline GAppInfos
https://bugzilla.gnome.org/show_bug.cgi?id=648416
2011-04-25 08:34:13 -04:00
David Zeuthen
58eb4da5c5 Fix build broken by previous commit
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-23 19:26:56 -04:00
David Zeuthen
b5b34fa2f2 gdbus-codegen: Include docs for generated code in the GIO docs
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-23 17:43:03 -04:00
Thomas Hindoe Paaboel Andersen
f42d97b88b docs: fix typos in networking classes 2011-04-20 21:08:15 +02:00
David Zeuthen
f0eeadf306 GDBusObjectManagerServer: make export() return whether the object was removed
This is useful in conjunction with g_warn_if_fail().

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-20 11:54:24 -04:00
Dan Winship
c2f670ef49 GSocketService: clarify transfer semantics of incoming connections
The @connection parameter to the ::incoming signal is (transfer none),
so you need to ref it if you want to keep it.

https://bugzilla.gnome.org/show_bug.cgi?id=647746
2011-04-20 11:24:46 -04:00
David Zeuthen
35b6c76244 gdbus-codegen: Document the generated FOO_PEEK_BAR() and FOO_GET_BAR() macros
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-20 09:00:16 -04:00
David Zeuthen
bd5da131a2 gdbus-codegen: Generate gtk-doc section docs
This is nice to have if using gtk-doc on the generated code. We could
also generate -sections.txt and .types files but we don't do that
right now...

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-19 14:40:34 -04:00
David Zeuthen
7a1d420889 gdbus-codegen: Set nick+blurb for properties to shut up gtk-doc
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-19 13:42:28 -04:00
David Zeuthen
271af675eb gdbus-codegen: It's GDBusProxyTypeFunc, not GDBusProxyFunc
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-19 13:39:12 -04:00
David Zeuthen
1ea370a1b1 gdbus-codegen: Document the generated ObjectManagerClient structs
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-19 13:16:10 -04:00
David Zeuthen
3238a6ffe7 gdbus-codegen: Add "Returns:" blurb for generated get_proxy_type()
This was forgotten.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-19 13:10:25 -04:00
David Zeuthen
68ba1bf074 gdbus-codegen: Generate docs when generating C code
This is handy for both gtk-doc and gobject-introspection.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-18 14:23:19 -04:00
David Zeuthen
affc6f7475 GDBusObjectManagerClient: Add a GDestroyNotify to the user_data
For bindings, obviously.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-16 15:24:42 -04:00
David Zeuthen
ea742e88e3 GDBus: Add some gobject-introspection annotations for new code
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-16 14:42:21 -04:00
David Zeuthen
3cef28a2f0 gdbus-codegen: Make generated code introspectable
Specific changes

 - Use get_type(), not get_gtype() for the GType function
   - so we need to use the lower-case name type_ for properties called type
 - Don't return a function pointer, just make the function returned
   available instead
 - Add (type) annotations in constructors so g-ir-scanner detects them as such
 - Add (transfer none) annotations to property getters
 - Add (out) annotations to D-Bus method call functions

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-16 14:08:47 -04:00
David Zeuthen
2e358e12f9 gdbus-codegen: Nuke debug spew
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 16:36:54 -04:00
David Zeuthen
a3fa748e54 gdbus-codegen: Never emit empty PropertiesChanged signals
It's not that it's actually a bug to do so per se, strictly speaking,
it's just pointless and wasteful.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 16:11:43 -04:00
David Zeuthen
6bccc46d15 gdbus-codegen: Don't send out PropertiesChanged if value ends up not changing
A fairly typical pattern is to have code that does

 foo_set_bar (object, "");
 if (some_condition)
   {
     foo_set_bar (object, "yes");
   }

where some_condition is often true every time @object is updated.

With this code, bar is essentially always "yes" but because of how
gdbus-codegen works, useless PropertiesChanged events got scheduled
and sent out. With this patch, we avoid that by always keeping the
original value around and comparing it only when we deem it's time to
send out the ::PropertiesChanged signal (typically in an idle but can
be forced by the user via flush()).

Also add a test case for this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 15:53:28 -04:00
Colin Walters
01602e1695 Fix some compiler warnings from gcc 4.6 2011-04-15 15:51:25 -04:00
Colin Walters
78203f3699 gapplication: Fix typo in property 2011-04-15 14:58:30 -04:00