summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-09-28Fix various minor documentation bugsHEADmasterSimon McVittie7-28/+60
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-28specialized types: improve documentation and document more thingsSimon McVittie3-55/+388
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-28dbus_g_type_collection_value_iterate, etc.: check that the type is suitableSimon McVittie1-4/+25
Otherwise we'd probably crash when we cast the vtable to an inappropriate type, and call its methods with inappropriate arguments as a result. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-28dbus_g_type_collection_get_fixed: check preconditions on the type and vtableSimon McVittie1-4/+10
Previously, if it wasn't a collection or didn't have the fixed_accessor, we'd just segfault. Not ideal. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-28dbus-gtype-specialized: warn if vtables have missing callbacksSimon McVittie1-1/+18
It's just about conceivable that they wouldn't segfault, if application authors carefully avoided the unimplemented functionality... but still. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-28Tidy up docs for DBusGError and its pseudo-methodsSimon McVittie2-16/+18
* attach the introductory doc-comments to the enum and macro names, not the internal function * remove docs for method parameters which didn't actually exist * more cross-references * make the domain macro visible in the documentation index Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Make gtk-doc DOC_SOURCE_DIR absolute, fixing out-of-tree docsSimon McVittie1-13/+38
I used an absolute path to avoid differing behaviour with older versions of gtk-doc, where DOC_SOURCE_DIR was relative to the *source* directory. Also resync doc/reference/Makefile.am with gtk-doc's example. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-09-27DBusGProxy: be more pedantic about boolean returnsSimon McVittie1-5/+5
Returning false doesn't strictly imply that the error is set; if you're being pedantic enough, it's really a tri-state where TRUE indicates success, FALSE indicates failure, and calling the function incorrectly results in undefined behaviour (currently a critical warning and returning FALSE). Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: NB#218973
2011-09-27DBusGProxy: misc documentation tidyingSimon McVittie2-9/+32
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27DBusGProxy: make argument names in declaration, definition and docs consistentSimon McVittie2-35/+32
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27DBusGProxy: mark struct contents as privateSimon McVittie1-0/+2
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Remove declaration of dbus_pending_call_get_g_type, which doesn't existSimon McVittie2-10/+0
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Add DBUS_TYPE_CONNECTION, DBUS_TYPE_MESSAGE to the docs, and document them ↵Simon McVittie2-5/+12
better Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Tidy up docs for DBusGMessageSimon McVittie2-11/+19
* document the instance struct * make argument names match the headers * document the GType macro, not the function it calls, and mention it in the documentation (since this is a boxed type, so it's non-obvious) Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Clean up docs for DBusGConnectionSimon McVittie2-10/+18
* introductory doc-comment for the (pseudo-)class * attach the doc-comment for the GType to the macro, not the internal function * rename function parameters to match what the header file says Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Ignore non-API source files correctlySimon McVittie1-7/+10
gtk-doc only cares about the basename of the files. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Remove stray empty subsectionSimon McVittie1-3/+0
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Mention which header to include in the gtk-docSimon McVittie1-0/+8
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-27Add some missing symbols to the docsSimon McVittie1-0/+6
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973
2011-09-21Micro versionSimon McVittie1-1/+1
2011-09-21dbus-glib 0.96dbus-glib_0.96Simon McVittie1-2/+2
2011-08-17test-dbus-glib: make lose() abort, and make lose_gerror() more informativeSimon McVittie1-17/+4
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17get_all_object_properties: if _dbus_gvalue_marshal fails, bail outSimon McVittie1-2/+25
This isn't necessarily OOM: _dbus_gvalue_marshal can fail due to programming errors. If so, raise a critical warning, then (if that wasn't fatal) return a D-Bus error to be sent to the caller. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17get_all_object_properties: note which operations can only fail via OOMSimon McVittie1-0/+12
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17get_all_object_properties: skip invalidly-named properties, with a criticalSimon McVittie1-0/+9
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17dbus-gobject: add and use connection_send_or_die to check for OOMSimon McVittie1-15/+25
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Conflicts: dbus/dbus-gobject.c
2011-08-17emit_signal_for_registration: assert that signal headers are all validSimon McVittie1-0/+4
This is an assertion, not a return_if_fail, because we already checked the object path in dbus_g_connection_register_g_object and the others in export_signals. After these checks, dbus_message_new_signal can really only fail on OOM. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17export_signals: check interface, signal names for validitySimon McVittie1-0/+14
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17object_registration_message: check for OOM when a property is absentSimon McVittie1-3/+5
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17object_registration_message: make logic/assertions slightly clearerSimon McVittie1-7/+6
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17object_registration_message: handle remote caller errors betterSimon McVittie1-6/+14
If the remote process sends us a wrong message, that's its fault, not ours; we should send back a comprehensible D-Bus error, and not spam to stderr. Previously, in each of these cases libdbus would have sent back NoReply, because we declined to handle the method call. One case that's still wrong is passing extra arguments to Get, GetAll or Set, like so: Get("com.example.Iface", "MyProperty", "extra") Set("com.example.Iface", "MyProperty", Variant("foo"), "extra") GetAll("com.example.Iface", "extra") dbus-glib has historically warned, ignored the extra argument(s) and sent back a reply as if they hadn't been there, whereas a stricter implementation (like telepathy-glib's TpDBusPropertiesMixin) would have sent back an error reply and done nothing. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17get_object_property: add brief documentationSimon McVittie1-0/+5
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17get_object_property: unwind on errors, and avoid returning NULLSimon McVittie1-10/+23
Also treat all errors here as programming errors (because this method should never fail), upgrading them from warning to critical; return a D-Bus error reply anyway, to be nicer to our callers. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17check_property_access: centralize error handling (and check for OOM)Simon McVittie1-26/+43
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17dbus-gobject: check for NULL when producing messagesSimon McVittie1-3/+3
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Conflicts: dbus/dbus-gobject.c
2011-08-17dbus-gobject: factor out reply_or_die, error_or_die and add error-checkingSimon McVittie1-33/+50
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17invoke_object_method: if marshalling an out argument fails, discard messageSimon McVittie1-11/+36
We shouldn't report this as OOM, because it probably wasn't (it's much more likely to be programming error); we should also continue through the arguments, so that we don't leak them. By abandoning the message as soon as we detect a programming error, we can use reply == NULL as an indicator of whether to keep appending. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17invoke_object_method, dbus_g_method_return_error: handle sending failureSimon McVittie1-2/+7
I just made it fatal, since it's either programming error or OOM. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17gerror_to_dbus_error_message: guarantee to return non-NULLSimon McVittie1-0/+6
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17invoke_object_method: if dbus_message_new_method_return fails, fail hardSimon McVittie1-1/+3
There's no point in doing graceful unwinding here, since it really shouldn't happen. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-17arg_iterate: documentSimon McVittie1-0/+40
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-15dbus_g_proxy_manager_unregister: if GetNameOwner failed, don't assertSimon McVittie1-4/+6
got_name_owner_cb never adds the proxy to the unassociated_proxies list if there is a D-Bus error other than NameHasNoOwner. Based on a patch from Janne Karhunen, for Maemo. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38408 Bug-NB: NB#116862 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-15Add a regression test for fd.o #38406Simon McVittie3-0/+282
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-15MyObject: register marshallers so individual tests don't have toSimon McVittie4-8/+20
These marshallers are actually dual-use: they're used to call certain methods on MyObject, and also to bind to its signals. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-15DBusGProxy: deal with errors in DBUS_G_VALUE_ARRAY_COLLECT_ALLSimon McVittie1-27/+66
G_VALUE_COLLECT can fail (admittedly, it's a programming error if it does). Previously, we leaked the resulting g_malloc'd string; now we emit a critical warning, free it, and abort the call. Based on patches from Kimmo Hämäläinen and Christian Dywan in Maemo's dbus-glib. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Bug-NB: NB#86280 Bug-NB: NB#180486 (CID-34419 to CID-34424 inclusive) Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-15dbus_g_proxy_call: simplify error handling now that call_id may be 0Simon McVittie1-12/+3
There's no need to special-case it any more - we can just use dbus_g_proxy_end_call_internal and rely on it to cope. This reverts the fix for fd.o #12675, since the commit before this one is more general. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-15DBusGProxy: cope gracefully with call_id == 0Simon McVittie1-0/+16
As well as happening on a programming error or OOM (which both provoke critical warnings), dbus_g_proxy_begin_call_internal() can legitimately fail if we got disconnected from D-Bus (so can't send any more), but are still working through our backlog of incoming messages (so we haven't got round to the Disconnected message yet, so the DBusGProxy hasn't emitted ::destroy). fd.o #12675 fixed dbus_g_proxy_call(), but dbus_g_proxy_call_with_timeout() and the asynchronous API still need similar treatment. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-08-03registrations test: fix race condition in adding match rulesSimon McVittie1-3/+25
If you don't block waiting for the reply to AddMatch, and you're using two connections to the bus, then messages sent from connection 2 might not be matched by connection 1, because they arrive before the AddMatch call from connection 1. This manifests itself as the /registrations/twice test *sometimes* failing (dependent on timing). Only tests with two parallel bus connections need this, but to be safe, I've added it throughout this test. Reviewed-by: Vivek Dasmohapatra <vivek@collabora.co.uk>
2011-07-25dbus-binding-tool: fixed "pretty" mode output for methods.Tim Waugh1-1/+1
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39475
2011-06-16Show warning if marshalling in dbus_g_method_return failsSimon McVittie1-1/+7
Based on a patch from Christian Dywan <christian.dywan@lanedo.com>. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29884 Bug-NB: NB#180486 Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>