Commit Graph

11335 Commits

Author SHA1 Message Date
Ryan Lortie
95c3796d6a GApplication: unregister action interface export
We missed a few cases of unexporting the action group interface (in
error cases, and on GApplication teardown).
2011-11-26 20:07:24 -05:00
Matthias Clasen
2cbc6d9ae6 GApplication: Implement query_action 2011-11-26 19:43:46 -05:00
Matthias Clasen
c3a2c280c3 GSimpleActionGroup: Implement query_action 2011-11-26 19:27:30 -05:00
Ryan Lortie
f468e9c309 Add g_action_group_query_action()
This new API allows requesting multiple pieces of information about a
particular action in one go and also simplifies the burden for
GActionGroup implementations -- they need not implement all the separate
APIs now.
2011-11-26 19:25:32 -05:00
Stef Walter
fcc69fd318 GBytes: A new type for an immutable set of bytes.
* Represents an immutable reference counted block of memory.
 * This is basically the internal glib GBuffer structure exposed,
   renamed, and with some additional capabilities.
 * The GBytes name comes from python3's immutable 'bytes' type
 * GBytes can be safely used as keys in hash tables, and have
   functions for doing so: g_bytes_hash, g_bytes_equal
 * GByteArray is a mutable form of GBytes, and vice versa. There
   are functions for converting from one to the other efficiently:
   g_bytes_unref_to_array() and g_byte_array_free_to_bytes()
 * Adds g_byte_array_new_take() to support above functions

https://bugzilla.gnome.org/show_bug.cgi?id=663291
2011-11-24 08:58:38 +01:00
Matthias Clasen
069ec3719c Fix distcheck
Now that we have switched to template-free docs, these
hand-rolled cleanup rules get in the way.
2011-11-23 18:13:44 -05:00
Simon McVittie
0104c62f3f GInitable, GAsyncInitable: not initializing gives undefined behaviour
This is the ISO C sense of undefined behaviour, in which
works-by-coincidence, critical warning, abort, demons-fly-out-of-your-nose
are all valid implementations.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662208
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Zeuthen <davidz@redhat.com>
2011-11-23 12:30:06 +00:00
Simon McVittie
968ef5f5ff GDBusWorker: continue_writing: initialize flush_async_data if closing
This was a regression in commit f41178c6c: flush_async_data wasn't
necessarily NULL in the "don't flush" case.

Also move initialization of these variables up so that it's
unconditional, since that's easier to verify than checking
that each branch gets it right.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=664617
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-11-23 11:20:15 +00:00
Matthias Clasen
1b01109377 Add some more mainloop tests 2011-11-22 23:57:18 -05:00
Matthias Clasen
d0e2865a2e Remove unnecessary includes
These were meant for some other test that ended up not getting
added. This fixes bug 664559.
2011-11-22 19:31:30 -05:00
Matthias Clasen
2da24259ab Fix !debug builds
As pointed out by Chun-wei Fan in bug 664455, parts of the merged
gobjectnotifyqueue.c code ended up inside an #ifdef G_ENABLE_DEBUG
section.
2011-11-22 19:25:03 -05:00
Matthias Clasen
6dde6b7f21 Add back required _XOPEN_SOURCE define
This got lost somewhere between 2.30 and now, but it is needed
for isnan(). See bug 664354, reported by Tim Mooney.
2011-11-22 19:12:48 -05:00
Ryan Lortie
345688c9e9 GApplication: don't fail if can't get session bus
If we can't get on the session bus, just behave like a normal non-unique
application.

This turns out to be remarkably easy to implement and lets us avoid
adding a 'dummy' backend.

Add a test for this case as well.

Idea from Zachary Dovel.

https://bugzilla.gnome.org/show_bug.cgi?id=651997
2011-11-22 17:35:56 -05:00
Matthias Clasen
1f02ef3205 gio: Move gmodule to Requires.private
Users of GIO are not generally expected to use gmodule API,
so don't force them all to link against it.
2011-11-22 13:59:34 -05:00
Simon McVittie
c4a11858cf GDBusConnection: don't pass boolean > 1 to _g_dbus_worker_new
This happens to work at the moment (because GDBusWorker.frozen is a
gboolean and not just a 1-bit bitfield), but isn't right: the gboolean
ends up with values 0 or G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING
(which is more than 1).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=664558
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Zeuthen <davidz@redhat.com>
2011-11-22 16:08:14 +00:00
Dan Winship
95faa44f2d GSocketInputStream/GSocketOutputStream: fix win32 build
based on a patch from Chun-wei Fan

https://bugzilla.gnome.org/show_bug.cgi?id=664455
2011-11-22 08:56:54 -05:00
Rico Tzschichholz
38a00cec67 gio/tests: Fix for -Werror=format-security 2011-11-21 23:06:15 +01:00
Ryan Lortie
b2cb386b78 post-release bump 2011-11-21 15:21:23 -05:00
Ryan Lortie
36c21d4790 release glib 2.31.2 2011-11-21 14:23:17 -05:00
Ryan Lortie
59623973fa dist gio/tests/key8.pem 2011-11-21 14:23:17 -05:00
Simon McVittie
4bb411948c Add test case for #662395
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662395
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-11-21 18:16:51 +00:00
Simon McVittie
96deb40caa GDBus tests: factor out TestIOStream, test_pipe and test_bidi_pipe
These might even make useful public API if they grew a Windows
implementation, but for now they can be Unix-only test API.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662395
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-11-21 18:15:26 +00:00
Simon McVittie
bae9928246 _g_dbus_worker_flush_sync: always flush if we need to
We didn't previously flush in a couple of cases where we should have
done:

* a write is running when flush is called: we should flush after it
  finishes

* writes have been made since the last flush, but none are pending or
  running right now: we should flush the underlying transport straight
  away

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662395
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-11-21 18:12:30 +00:00
Simon McVittie
f41178c6c7 GDBusWorker: move flush async op into continue_writing()
This makes it easier to schedule a flush, by putting it on the same code
path as writing and closing.

Also change message_written to expect the lock to be held, since all
that's left in that function either wants to hold the lock or doesn't
care, and it's silly to release the lock immediately before calling
message_written, which just takes it again.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662395
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-11-21 18:10:11 +00:00
Simon McVittie
301332168b schedule_write_in_worker_thread: require caller to lock; rename accordingly
When we use this function to schedule a flush, it'll be called
with the lock held. Releasing and immediately re-taking the lock would
be pointless.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662395
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-11-21 17:42:58 +00:00
Simon McVittie
56eb16ff50 GDBusWorker: rename some functions
maybe_write_next_message now also closes, and I'm about to make it
consider whether to flush as well, so its name is increasingly
inappropriate. Similarly, write_message_in_idle_cb is a wrapper around
it which could do any of those things.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662395
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-11-21 17:40:51 +00:00
Simon McVittie
18482ab17e GDBusWorker: distinguish between 3 sorts of output that might be pending
If the user calls flush_sync() with no messages in the queue, but an
async write call pending, then we ought to flush after that async write
returns (although we don't currently do that). If it was an async close
or flush that was pending, there's no need to flush (again) afterwards.
So, we need to distinguish.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662395
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
2011-11-21 17:21:35 +00:00
Ryan Lortie
a795e563df Drop last uses of @returns: 2011-11-21 12:02:02 -05:00
Ryan Lortie
0f1fb417bf Missed a couple of @returns 2011-11-21 11:39:52 -05:00
Ryan Lortie
0e0554bd62 GVariant: drop use of @returns 2011-11-21 11:33:21 -05:00
Matthias Clasen
4527e7cbf7 gbitlock: Drop @returns syntax from doc comments 2011-11-21 11:09:42 -05:00
Matthias Clasen
22d3972284 GBuffer: Drop @returns syntax from doc comments 2011-11-21 11:05:43 -05:00
Matthias Clasen
f62ee0a0ca GSocketClient: Drop @returns syntax from doc comments 2011-11-21 11:03:31 -05:00
Matthias Clasen
b9f0cb0f07 GSimplePermission: Drop @returns syntax in doc comments 2011-11-21 11:02:30 -05:00
Matthias Clasen
2011ecd6ac GPermission: Drop @returns syntax from doc comments 2011-11-21 11:01:16 -05:00
Matthias Clasen
ef4ae742ce Improve test coverage 2011-11-21 01:53:29 -05:00
Matthias Clasen
89ad8bda23 Improve mainloop test coverage slightly 2011-11-21 01:40:51 -05:00
Matthias Clasen
b0fa096870 Improve test coverage 2011-11-21 01:02:50 -05:00
Matthias Clasen
0fd14b1a56 Fix a case conversion bug
For titlecase chars without uppercase variant, we were returning
0, contrary to the docs.
2011-11-21 00:28:41 -05:00
Matthias Clasen
5197870665 Improve test coverage 2011-11-21 00:28:41 -05:00
Matthias Clasen
4cbacb91de Add a test for g_unichar_isdefined 2011-11-21 00:28:41 -05:00
Chun-wei Fan
3aeddaa2d4 gio/Makefile.am
Filter out yet another *nix only source file from the Visual C++ project
file completion rules.
2011-11-21 11:53:02 +08:00
Chun-wei Fan
fee6293bc9 Update GLib Visual C++ projects
Also link to WinMM.lib since timeGetTime is used (commit 8d023c27).
2011-11-21 10:45:27 +08:00
Fran Diéguez
928e356cdb Updated Galician translations 2011-11-21 01:59:07 +01:00
Matthias Clasen
0878f5ba43 GFile: Add some introspection annotations
progress_callback in g_file_copy and g_file_copy_async may be NULL.
Annotations should reflect that. Pointed out by Carlo Teubner.

https://bugzilla.gnome.org/show_bug.cgi?id=664415
2011-11-20 15:12:05 -05:00
Josselin Mouette
ff2f4a12ee Document that g_list_sort is a stable sort.
This is a guarantee for the future so that applications can rely on it.

https://bugzilla.gnome.org/show_bug.cgi?id=531973
2011-11-20 16:53:36 +01:00
Jorge González
b6732da5e7 Updated Spanish translation 2011-11-20 10:10:13 +01:00
Matthias Clasen
d920cb6bdb GApplication: unregister bus name
https://bugzilla.gnome.org/show_bug.cgi?id=647987
2011-11-19 16:24:08 -05:00
Matthias Clasen
6c7387f6d1 Trivial doc typo fix 2011-11-19 16:23:33 -05:00
Kjartan Maraas
b55daa7f59 Updated Norwegian bokmål translation 2011-11-19 12:02:08 +01:00