Commit Graph

8107 Commits

Author SHA1 Message Date
Christian Persch
bdd8fef4c0 Fix VARIANT out args
Use g_value_set_variant(), not the nonexistent g_value_take_variant().
2010-06-18 00:38:46 +02:00
Christian Persch
30df71e382 Add VARIANT to glib-genmarshal docs 2010-06-18 00:10:54 +02:00
David Zeuthen
79d32c2fc1 GDBusMessage: Fix bug when deserializing a message
See https://bugzilla.gnome.org/show_bug.cgi?id=621838 for the whole
story. The problem was that we ended up reading data from arrays of
arrays when we were just supposed to be aligning the buffers.

Also add a host of debug infrastructure that was needed to find the
root cause. For now it can be turned on only via defining
DEBUG_SERIALIZER. In the future we might want to make it work via
G_DBUS_DEBUG. In a nutshell, the added debug info looks like this

Parsing blob (blob_len = 0x0084 bytes)
  0000: 6c 01 00 01  3c 00 00 00  41 00 00 00  37 00 00 00    l...<...A...7...
  0010: 08 01 67 00  08 61 61 79  61 7b 73 76  7d 00 00 00    ..g..aaya{sv}...
  0020: 01 01 6f 00  08 00 00 00  2f 66 6f 6f  2f 62 61 72    ..o...../foo/bar
  0030: 00 00 00 00  00 00 00 00  03 01 73 00  06 00 00 00    ..........s.....
  0040: 4d 65 6d 62  65 72 00 00  00 00 00 00  34 00 00 00    Member......4...
  0050: 03 00 00 00  63 77 64 00  01 73 00 00  23 00 00 00    ....cwd..s..#...
  0060: 2f 68 6f 6d  65 2f 64 61  76 69 64 7a  2f 48 61 63    /home/davidz/Hac
  0070: 6b 69 6e 67  2f 67 6c 69  62 2f 67 69  6f 2f 74 65    king/glib/gio/te
  0080: 73 74 73 00                                           sts.

Parsing headers (blob_len = 0x0084 bytes)
  Reading type a{yv} from offset 0x000c: array spans 0x0037 bytes
    Reading type {yv} from offset 0x0010
      Reading type y from offset 0x0010: 0x08 '
      Reading type v from offset 0x0011
        Reading type g from offset 0x0014: 'aaya{sv}'
    Reading type {yv} from offset 0x001e
      Reading type y from offset 0x0020: 0x01 ''
      Reading type v from offset 0x0021
        Reading type o from offset 0x0024: '/foo/bar'
    Reading type {yv} from offset 0x0031
      Reading type y from offset 0x0038: 0x03 ''
      Reading type v from offset 0x0039
        Reading type s from offset 0x003c: 'Member'
Parsing body (blob_len = 0x0084 bytes)
  Reading type (aaya{sv}) from offset 0x0047
    Reading type aay from offset 0x0048: array spans 0x0000 bytes
    Reading type a{sv} from offset 0x004c: array spans 0x0034 bytes
      Reading type {sv} from offset 0x0050
        Reading type s from offset 0x0050: 'cwd'
        Reading type v from offset 0x0058
          Reading type s from offset 0x005b: '/home/davidz/Hacking/glib/gio/tests'
OK

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-17 18:01:32 -04:00
Christian Persch
86d681ba3e Distcheck fix
Add a missing symbol to gobject.symbols.
2010-06-17 23:50:10 +02:00
Ryan Lortie
0766981a1e Make g_settings_sync() a proper prototype. 2010-06-17 16:56:53 -04:00
Matthias Clasen
408daaa294 Fix the build 2010-06-17 16:36:58 -04:00
Matthias Clasen
df81e3f33e Updates 2010-06-17 16:14:22 -04:00
David Zeuthen
0c506f200a GDBus: Complain via g_warning() if an invalid message is received
While we are already propagating the error to the user via the
GDBusConnection::disconnected signal (because the only safe thing is
to disconnect the other peer), changes are the user is simply not
listening to this signal.

This should never ever happen unless there's a bug in the
serializaer/deserializer so it's fine to complain via g_warning()
here.

Bug 621838, see

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

is related to this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-17 16:12:46 -04:00
David Zeuthen
57dff1e060 GDBusMessage: Properly check error and bail if set
Otherwise we may set a GError on top of it.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-17 16:12:46 -04:00
Matthias Clasen
8a105625b0 Documentation fixups 2010-06-17 16:07:52 -04:00
Matthias Clasen
19a752a5f4 fix a typo 2010-06-17 15:53:08 -04:00
Christian Persch
10e430bcc0 Fix GApplication for the G_TYPE_VARIANT change 2010-06-17 21:41:09 +02:00
Matthias Clasen
daee48a0af Update api docs to current api 2010-06-17 15:30:06 -04:00
David Zeuthen
0a7e6255b3 Catch up with G_TYPE_VARIANT changes
The GType for a GVariant is now a fundamental GType instead of a boxed
one so use the right marshaller.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-17 15:27:18 -04:00
Matthias Clasen
2c5e1d5193 Fix a typo 2010-06-17 15:08:37 -04:00
Ryan Lortie
0010e86572 GSettings: remove "context" from backend too.
Note: this is a GSettingsBackend API/ABI change.
2010-06-17 15:06:33 -04:00
Christian Persch
4708b8ecc3 Add fundamental type and pspec for GVariant
Make G_TYPE_VARIANT a fundamental type instead of boxed, and add
g_variant_{set,get,dup}_variant.

Add GParamSpecVariant.

Bug #610863.
2010-06-17 21:00:54 +02:00
Ryan Lortie
f2ae621777 Revert "GVariant: add g_variant_default_value()"
This reverts commit b205dc77cb.

We decided to go the other route with the GParamSpec.
2010-06-17 14:58:46 -04:00
Ryan Lortie
58e000d301 Only run the schema compiler from the test cases 2010-06-17 14:33:50 -04:00
Ryan Lortie
6c3ae976e6 Bug 621266 - GSettings "context" clarification
Remove the concept of "context" in favour of dealing with
GSettingsBackend directly.
2010-06-17 14:05:40 -04:00
Cosimo Cecchi
b3cc28bc34 Bug 621905 – Assume a ref when doing async work
When asynchronously acquiring the DBus connection, assume a reference to
the proxy object, to avoid destroying it in the middle of the operation.

See https://bugzilla.gnome.org/show_bug.cgi?id=621905
2010-06-17 18:49:55 +02:00
Ryan Lortie
d352ec2bf3 GSettings-related distcheck fixups 2010-06-17 10:50:47 -04:00
Ryan Lortie
fcbddd746b Add 'if' that was absorbed by $(AM_V_GEN)
From commit 1b8ee5196e
2010-06-17 09:38:39 -04:00
Ryan Lortie
e7cd94a481 More GSettings doc fixups 2010-06-17 08:57:19 -04:00
Ryan Lortie
92375a8c8e <alias> takes mandatory target='' arg 2010-06-17 08:08:28 -04:00
Ryan Lortie
d405ad8a09 GSettings: Fix comment formatting, whitespace. 2010-06-17 08:06:52 -04:00
Matthias Clasen
24f1fa12c1 Add new api 2010-06-17 01:51:23 -04:00
Matthias Clasen
61af83c5b6 Add some schema examples 2010-06-17 01:38:14 -04:00
Matthias Clasen
fbf93c371a Typo fix 2010-06-17 00:45:43 -04:00
Matthias Clasen
345a1ee31c Update the dtd to match the schema parser
The aliases element was not mentioned here.
2010-06-17 00:37:49 -04:00
Matthias Clasen
3fbac99402 Updates 2010-06-17 00:37:49 -04:00
Ryan Lortie
fc538894d3 GSettings: enum/choices/aliases/range test cases
Fix a small bug that one of the tests uncovered.
2010-06-17 00:03:44 -04:00
Ryan Lortie
be8f938b63 move GSettings(Backend) to giotypes.h 2010-06-16 18:49:20 -04:00
Ryan Lortie
f0d30e0c0c Bug 621319 - more leaked GVariants in GSettings
Caught by Felix Riemann.
2010-06-16 18:36:24 -04:00
Ryan Lortie
4275c68c30 GVariant serialiser: fix small type error 2010-06-16 18:22:48 -04:00
Ryan Lortie
597290d5c8 GSettings: major refactor. Add enums, range. 2010-06-16 18:17:53 -04:00
Ryan Lortie
b205dc77cb GVariant: add g_variant_default_value()
Returns various kinds of false, zero, empty arrays, etc.
2010-06-16 15:58:53 -04:00
Christian Persch
6a1cb9f697 Typo fix 2010-06-16 18:47:20 +02:00
Christian Persch
b90f11ff97 Typo fix 2010-06-16 17:48:02 +02:00
Colin Walters
102c5f6a7d Rework GApplication API to use GInitable
https://bugzilla.gnome.org/show_bug.cgi?id=620952
2010-06-16 11:13:43 -04:00
Emmanuele Bassi
25ba90ffdd Add gdbus-proxy-well-known-name to the ignore file 2010-06-16 15:09:33 +01:00
Emmanuele Bassi
33aa4b4c66 binding: Use a hash table
Since an object instance might have a lot of bindings, using a list
might become a performance issue when removing them. Using a simple
hash table guarantees constant time lookup, which is the most common
operation.
2010-06-16 15:08:10 +01:00
Emmanuele Bassi
f72f65643f tests: Add a chain binding
Test the case with a chain like A → B, B → C, and what happens when
switching to a direct A → C link.

https://bugzilla.gnome.org/show_bug.cgi?id=621782
2010-06-16 14:56:59 +01:00
Matthias Clasen
48e3b31042 Properly initialize GError
Pointed out by Florian Müllner in bug #621702
2010-06-15 22:06:56 -04:00
Christian Persch
1b8ee5196e Sprinkle some $(AM_V_GEN) around to make the build more silent. 2010-06-15 22:01:02 -04:00
Matthias Clasen
062148ae9a Correct some documentation mistakes in gunixmounts.c
Pointed out by Ross Burton in bug #618904
2010-06-15 21:57:57 -04:00
Emmanuele Bassi
6d1d9cf1b5 gobject: Add GBinding
GBinding is a simple, opaque object that represents a binding between a
property on a GObject instance (source) and property on another GObject
instance (target).

https://bugzilla.gnome.org/show_bug.cgi?id=348080
2010-06-15 16:06:18 +01:00
Damien Lespiau
f3879a4bdc Introduce g_object_notify_by_pspec()
g_object_notify_by_pspec() will emit the "notify" signal on the given
pspec, short-circuiting the hash table lookup needed by
g_object_notify(). The suggested and documented way of using
g_object_notify_by_pspec() is similar to the way of emitting signals
with their ID.

Emission tests (with no handler attached to the notify signal) show a
10-15% speedup over using g_object_notify().

https://bugzilla.gnome.org/show_bug.cgi?id=615425
2010-06-15 10:51:36 +01:00
Matthias Clasen
08f473ffef Prevent division by zero if no tests 2010-06-15 02:01:16 -04:00
Matthias Clasen
53f70ac43b Forgotten file 2010-06-15 01:50:15 -04:00