Commit Graph

2379 Commits

Author SHA1 Message Date
Ryan Lortie
cf26a6fc32 G_LOCK: port from GStaticMutex to GMutex
GCancellable made use of the undocumented G_LOCK_NAME macro in an
invalid way.  Fix that up while we're at it.
2011-09-21 15:55:36 -04:00
David Zeuthen
aabdb7e190 GDBusObject{Proxy,Skeleton}: Prefix properties with g- to avoid collisions
Otherwise we might collide with an interface called Connection.

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

This is for the same reason that GDBusProxy has its properties
prefixed with g-.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-21 12:35:40 -04:00
Ryan Lortie
1f5262d2c9 gunixmounts: exempt entries with "none" mountpoint
We ignore entries with mountpoint of "swap" and "ignore".  Add "none" to
that list, since Debian uses it.

Probably we should move to using our already-existing internal list of
things to ignore, but this patch is more minimally intrusive for now.

https://bugzilla.gnome.org/show_bug.cgi?id=654563
2011-09-21 10:20:08 -04:00
Xavier Claessens
6b39085016 gdbus-codegen: prepend arg_ to method/signal arg names
This is to avoid shadow declaration warning in the case an arg name
is "time" for example.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-21 07:45:50 -04:00
Xavier Claessens
70515ffe92 gdbus-codegen: Fix build errors in generated code
https://bugzilla.gnome.org/show_bug.cgi?id=659646
2011-09-21 10:22:24 +02:00
Dan Winship
855e13cc0a GThreadedResolver: don't overwrite errors
If a dns op was cancelled and then the abandoned op failed, it would
try to overwrite the original error. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=658769
2011-09-20 17:00:58 -04:00
Antoine Jacoutot
0db338bdb0 gunixmounts: Fix compilation on BSD
Commit afa82ae805 introduced a compilation
regression on BSD systems that use the sysctl(3) interface; we need to
declare the buffer len in _g_get_unix_mount_points()
BZ #659528
2011-09-20 16:58:00 +02:00
David Zeuthen
88f2b32eb0 GDBusObjectManagerServer: Add test for export_uniquely() method
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-19 17:31:21 -04:00
Matthew Barnes
b1c08ca419 GDBusObjectManagerServer: Use correct object path in export_uniquely() method
In registration_data_export_interface(), the object_path is obtained using:

object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (data->object));

But when exporting an object uniquely, the object_path is not assigned
to the GDBusObject until after all the interfaces are exported.
Therefore, registration_data_export_interface() is trying to export
the interface on the non-unique object path, which can lead to
run-time errors if an object already exists on that path.

Instead, registration_data_export_interface() should be passed the
object_path explicitly, as is done in
g_dbus_object_manager_server_export_unlocked().

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-19 16:45:05 -04:00
Philip Withnall
fe27bf0037 Don't close stream twice when splicing
Ensure that the output/target stream in a g_output_stream_splice_async()
operation is marked as closed if G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET is
passed to g_output_stream_splice_async(). This removes the possibility of
local FDs being closed twice because the stream's not marked as closed.

This is implemented by calling g_output_stream_close() from within
g_output_stream_splice_async() instead of calling the stream's close_fn()
directly.

Closes: bgo#659324
2011-09-19 10:13:52 +02:00
Dan Winship
eb45a590fa gsocks5proxy, gsocks4aproxy: simplify some error messages
There's no need to include the exact max length in the error messages,
and it makes it look like the strings need to use ngettext() if you do.

https://bugzilla.gnome.org/show_bug.cgi?id=658206
2011-09-18 10:49:58 -04:00
Ryan Lortie
b83e0a39fb glib-compile-schemas: remove --uninstall option
This option does nothing as has been documented as "will be removed
soon" for the vast majority of its life.
2011-09-17 19:11:10 -04:00
David Zeuthen
48494dd552 gdbus-codegen: Support Ugly_Case for given C namespace
https://bugzilla.gnome.org/show_bug.cgi?id=658976

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 16:01:13 -04:00
David Zeuthen
c6c2c10946 gdbus-codegen: Single letter namespaces get dropped from symbol names
https://bugzilla.gnome.org/show_bug.cgi?id=659082

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 15:20:00 -04:00
Simon McVittie
e34e8a25a0 _g_dbus_worker_new: hold a ref until we have done the initial read
Otherwise, we could use-after-free the GDBusWorker, if its last-unref
is immediately after _g_dbus_worker_new returns (before the worker thread
does its initial read).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:00:22 -04:00
Simon McVittie
698eeb3ef6 GDBusWorker: as a precaution, access 'stopped' boolean atomically
This member is written in _g_dbus_worker_stop from arbitrary threads, and
read by the worker thread, so it should be accessed atomically.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:00:22 -04:00
Simon McVittie
20497f7af9 Regression test for closing a stream, slowly, while a message is queued
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:00:22 -04:00
Simon McVittie
c180ea13ae GDBusWorker: annotate more functions with lock/pending state
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:00:22 -04:00
Simon McVittie
8097e2de85 GDBusConnection: delegate to the worker to close the stream
We can't safely close the output part of the I/O stream until any
pending write or flush has been completed. In the worst case, this could
lead to an assertion failure in the worker (when the close wins the
race) or not closing the stream at all (when the write wins the race).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:00:22 -04:00
Simon McVittie
a8f75f21b4 GDBusWorker: combine num_writes_pending with flush_pending
num_writes_pending was a counter, but it only took values 0 or 1, so make
it a boolean: it would never make sense to be trying to write out two
messages at the same time (they'd get interleaved).

Similarly, we can never be writing and flushing at the same time (that'd
mean we were flushing halfway through a message, which would be pointless)
so combine it with flush_pending too, calling the result output_pending.

Also assert that it takes the expected value whenever we change it,
and document the locking discipline used for it, including a subtle
case in write_message_in_idle_cb where it's not obvious at first glance
why we don't need the lock.

(Having the combined boolean at the top of the block of write-related
struct members improves struct packing on 64-bit platforms, by packing
read_num_ancillary_messages and output_pending into one word.)

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:00:22 -04:00
Ryan Lortie
05ef173466 Disable two GDBus tests
These tests try to use GMainContext across fork() which now fails a lot
more violently than it used to.

See https://bugzilla.gnome.org/show_bug.cgi?id=658999 for information.
2011-09-16 11:18:26 -04:00
Murray Cumming
0bb01a150f Revert "Add g_memory_input_stream_new_from_data_full/add_data_full() apis"
I'm not sure that this API is right now that I try to use it.

This reverts commit 42738469d1.
2011-09-16 16:09:56 +02:00
Tristan Van Berkom
42738469d1 Add g_memory_input_stream_new_from_data_full/add_data_full() apis
Add an extra state pointer and an extra GDestroyNotify function
to the 'Chunk' definition... allowing bindings to attach some extra
state to memory chunks (to get memory management correctly from
language bindings).
Bug #589887
2011-09-16 15:37:06 +02:00
Ryan Lortie
43007aa2d2 GApplication: don't create a mainloop
Just iterate the main context directly.  Also: avoid calling the virtual
functions for mainloops.

https://bugzilla.gnome.org/show_bug.cgi?id=658805
2011-09-14 14:09:12 -04:00
Ryan Lortie
39294664a6 GApplication test: fix testcase to avoid fork()
The GApplication test case tried to fork() while using GMainLoop,
causing problems.  Avoid doing that by splitting the child process into
a separate program and spawning it in the usual way.

https://bugzilla.gnome.org/show_bug.cgi?id=658999
2011-09-14 14:09:12 -04:00
Ryan Lortie
01f9479438 GApplication: add chain-up checks
Make sure ::startup and ::shutdown are being chained up.
2011-09-14 14:00:08 -04:00
Brian Koning
15b1c1bf4f GApplication: introduce ::shutdown
Introduce ::shutdown as a dual to ::startup.

https://bugzilla.gnome.org/show_bug.cgi?id=643934
2011-09-14 13:45:44 -04:00
Tomas Bzatek
659b287a92 gdbus-codegen: Fix segfault when remote property is invalidated
The 'key' variable is no longer valid outside the cycle, owned and
probably already freed by GVariant. This causes apps to segfault
when proxy is constructed and a property on remote d-bus service
changes (actually is invalidated). Looks like a typo anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=659070
2011-09-14 19:02:01 +02:00
Richard Hughes
8152e3f54e Fix the description for g_app_info_get_icon()
It can return NULL when there is no default icon.
2011-09-13 16:38:40 +01:00
Ryan Lortie
1b03391984 Merge remote-tracking branch 'gvdb/master' 2011-09-12 08:12:57 -04:00
Matthias Clasen
2d44a45b6b GDesktopAppInfo: Improve docs 2011-09-12 01:56:45 -04:00
Matthias Clasen
05342d0a93 Fix formatting in a doc comment 2011-09-12 01:49:01 -04:00
Matthias Clasen
73c427fab9 Expand mimeapps test
This adds a test involving both defaults.list and mimeapps.list.
2011-09-12 01:46:48 -04:00
Matthias Clasen
2ba5a79a70 Also check api results
In addition to looking at mimeapps.list, check that the default
and recommended apps returned by g_app_info api are as expected.
2011-09-11 23:39:29 -04:00
Matthias Clasen
75c989b9ab Revert "Fix default setting generation in g_desktop_app_info_set_as_last_used"
This reverts commit a13f5ca4da.
2011-09-11 23:28:45 -04:00
Matthias Clasen
938e57dd4b Adapt tests to string changes 2011-09-11 23:28:44 -04:00
Matthias Clasen
ec3653be00 glib-compile-schemas: Pedantic string fixes
Replace 'can not' by 'cannot' in several places. String change!

https://bugzilla.gnome.org/show_bug.cgi?id=658207
2011-09-10 10:36:56 -04:00
Josselin Mouette
a13f5ca4da Fix default setting generation in g_desktop_app_info_set_as_last_used
* Do not ignore the system default
 * Do not exclude the last used being set from the default list

This fixes the default applications dialog in control-center.

https://bugzilla.gnome.org/show_bug.cgi?id=658188
2011-09-10 08:26:12 +02:00
Matthias Clasen
011c0b488f Add some tests for mimeapps.list handling
These tests directly look at mimeapps.list to verify that
we make the expected changes to the database.
2011-09-09 23:44:41 -04:00
Matthias Clasen
66a1dfc84f Avoid some compiler warnings 2011-09-09 23:44:41 -04:00
Matthias Clasen
e5653c0050 Keep up with the standards
More choices, always better.
2011-09-09 20:37:09 -04:00
Colin Walters
9bf59d4a14 Add glib__private__() API to share between glib,gio; port GWakeup to it
Historically we've added random symbols to the public API with warnings
that they're private; examples are:

glib_gettext(), glib_pgettext()
g_thread_functions_for_glib_use, g_thread_use_default_impl, etc.

And we almost added "GWakeup" to public API just to share between glib and
gio.

This new glib__private__() API exports a hidden vtable, and adds a macro
GLIB_PRIVATE_CALL() that makes it generally convenient to use.

This adds an extremely tiny cost for the double indirection; but it has
the benefit that we don't need to either:

1) compile the code into both glib and gio (like GWakeup), with the
   inefficiency that implies.
2) Export a "do not use this" symbol; the serious problem with this is
   that someone CAN use it pretty easily.  Particularly if we document
   it.  It's far, far harder to peek into a structure without a public
   header file.

https://bugzilla.gnome.org/show_bug.cgi?id=657992
2011-09-09 14:17:08 -04:00
Ryan Lortie
e48573c402 Deprecated (undocumented) g_thread_gettime
g_thread_gettime() is an undocumented public function pointer that
points to a function that returns the monotonic time in nanoseconds.
g_get_monotonic_time() does the same in microseconds, so it can be used
instead.

GLib had one internal user in GFileMonitor that only cared about
millisecond accuracy; it has been ported to g_get_monotonic_time().
2011-09-09 12:47:39 -04:00
Dan Winship
5a30712dc7 Remove !g_thread_supported() codepaths in gio
In particular, remove the libasyncns import, which was only used by
GUnixResolver, which is only used when threads are not available.
Likewise remove GWin32Resolver, and the hacky broken non-threaded
parts of GIOScheduler.

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:47:39 -04:00
Ryan Lortie
aa586f6354 Revert "GIOSchedulerJob: Improve struct packing"
This reverts commit a2094d5e56.

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:41:56 -04:00
Dan Winship
5bc7729d16 Make threads mandatory
G_THREADS_ENABLED still exists, but is always defined. It is still
possible to use libglib without threads, but gobject (and everything
above it) is now guaranteed to be using threads (as, in fact, it was
before, since it was accidentally impossible to compile with
--disable-threads).

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:41:55 -04:00
Damien Lespiau
c8ef5b7d6c simpleaction: Fix documentation of :enabled
An over-zealous sed, most likely, transformed g_action_.*() into
g_simple_action.*().

https://bugzilla.gnome.org/show_bug.cgi?id=658558
2011-09-08 17:07:56 +01:00
Federico Mena Quintero
571185f0f6 bgo#640212 - Replace "error stating file" with friendlier messages
Non-technical users won't know that "stating" refers to stat(2), so we
just use "error when getting information" now.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-09-08 09:11:56 -05:00
Ryan Lortie
27fbaf3712 GSettingsBackend: emit changes to correct thread
When g_settings_apply() is called on a delayed settings backend and
there is a D-Bus error when communicating with dconf-service, recent
versions of the dconf GSettingsBackend call a function in GLib that
improperly delivered the signal directly instead of using
g_main_context_invoke().

This patch fixes this function to route in the same way as the others so
that the signal is dispatched in the proper GMainContext.
2011-09-06 14:07:16 -04:00
Ryan Lortie
8a7d33024a gio docs: lots more fixes 2011-09-06 00:31:49 -04:00