Commit Graph

8450 Commits

Author SHA1 Message Date
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
David Zeuthen
cade3cb1da gdbus-codegen: Fix obvious bug in _g_variant_equal0() implementation
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 13:51:10 -04:00
David Zeuthen
e19734d6c3 gdbus-codegen: Add support for the org.freedesktop.DBus.Deprecated annotation
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 12:56:07 -04:00
Ryan Lortie
0f9b83dd36 GApplication: #include "gsettings.h"
Since we call g_settings_sync() from there now...
2011-04-15 09:30:24 -04:00
Ryan Lortie
631d0c3534 Merge remote-tracking branch 'gvdb/master' 2011-04-15 09:29:47 -04:00
David Zeuthen
98e6d4b0a9 gdbus-codegen: Include a blurb about the license of the generated code
More precisely, include this line

 The license of this code is the same as for the source it was derived from.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 08:48:21 -04:00
David Zeuthen
5f31671da0 gdbus-codegen: Use the right program name in introductory comment (again)
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 08:44:05 -04:00
David Zeuthen
c76a1f9905 gdbus-codegen: Use the right program name in introductory comment
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 08:40:52 -04:00
David Zeuthen
9e9535b45c gdbus-codegen: Add copyright / license headers
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 08:33:30 -04:00
David Zeuthen
febfc45fbe GDBus: Support Ugly_Case and use org.gtk.GDBus.C.Name since it's C-only
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 08:24:40 -04:00
Michael Kuhn
2553511f4e Bug 637561 - Crash when using G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
https://bugzilla.gnome.org/show_bug.cgi?id=637561

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 06:05:24 -04:00
Simon McVittie
c2387ddff1 /gdbus/message-serialize-invalid test: be compatible with D-Bus 1.4.8
Older versions of libdbus would let you construct an invalid
DBusMessage, but that's a bug, which will be fixed in 1.4.8/1.5.0.
Instead, construct a valid message of the same length, then replace
substrings in the serialized blob with their invalid counterparts.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 06:00:16 -04:00
Kean Johnston
8b50e2f547 GLocalFile: Use _fstati64 rather than stat on Win32
We want this to get 64bit timestamps and file lenghts.
2011-04-15 10:15:04 +02:00
Matthias Clasen
a3722d0408 Slight docs rewording
Proposed by Thomas Andersen,
https://bugzilla.gnome.org/show_bug.cgi?id=647700
2011-04-14 20:41:54 -04:00
David Zeuthen
4da1824759 GResolver: Don't return duplicate addresses
... this was causing a GDBus test-case to fail so now that it is
fixed, also reenable the test case.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-14 12:46:54 -04:00
David Zeuthen
33515d4eb4 GInetAddress: add equal() method
This is needed in the fix for

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-14 12:46:46 -04:00
David Zeuthen
e38ef14e8b GDBus: If an authentication method fail, don't give up, just try the next one
This problem was reported in bug 647602.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-13 18:40:47 -04:00
David Zeuthen
3b997d92c1 GDBus: Add test case for the ANONYMOUS authentication method
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-13 18:21:16 -04:00
David Zeuthen
befb60d826 GDBus: Nuke debug spew from the ANONYMOUS authentication method
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-13 18:20:34 -04:00
David Zeuthen
25c57d31c5 GDBus: Allow tcp: and nonce-tcp: addresses without any arguments
This was broken in this commit

 http://git.gnome.org/browse/glib/commit/?id=0729260141bb585943ad1c6efa8ab7ee9058b0aa

The test case for catching this is unfortunately commented out (so it
didn't catch it) due to this bug

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

still being unresolved.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-13 17:49:19 -04:00
David Zeuthen
8826ad046d GDBusInterfaceStub: Clarify ::g-authorize-method docs
As suggested by Simon in https://bugzilla.gnome.org/show_bug.cgi?id=647577#c11

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-13 16:39:50 -04:00
David Zeuthen
6ccca55752 GDBus: Use Skeleton instead of Stub
After some brainstorming with Simon, see

 https://bugzilla.gnome.org/show_bug.cgi?id=647577#c8

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-13 16:33:51 -04:00
Colin Walters
68b16deb1f gdbusconnection: Avoid tripping assertion if we fail to authenticate twice
If g_bus_get_sync() fails in authentication (because e.g. the process
uid, doesn't match the expected in EXTERNAL), a secondary call to
g_bus_get_sync() would notice we aren't initialized, and try
to initialize.

The assertion here is just wrong; we now explicitly and clearly handle
both cases where we already have an error, or we already succeeded.

https://bugzilla.gnome.org/show_bug.cgi?id=635694
2011-04-13 15:01:28 -04:00
David Zeuthen
683943b40e GDBusInterfaceStub: Use G_VARIANT_TYPE_VARDICT when referring to type a{sv}
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-13 11:35:06 -04:00
Matthias Clasen
c1a7599568 Fix a typo in the GSettings docs
Pointed out by Thomas Andersen
https://bugzilla.gnome.org/show_bug.cgi?id=647600
2011-04-13 00:39:01 -04:00
David Zeuthen
6a4ab7c5d3 GDBus: Minor renames and doc fixes
As requested by Simon in https://bugzilla.gnome.org/show_bug.cgi?id=647577

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-12 20:15:48 -04:00
David Zeuthen
34a28f2f06 Add support for org.gtk.GDBus.Since annotation
And use this for a) documentation purposes; and b) to preserve C ABI
when an interface is extended. See

 https://bugzilla.gnome.org/show_bug.cgi?id=647577#c5

for more details. Also add test cases for this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-12 16:17:28 -04:00
Colin Walters
bf087aabbf gsettings-tool fixes: Add missing _apply(), add unset-recursively to man page 2011-04-12 12:56:33 -04:00
Colin Walters
3fd9f2e8f9 gsettings: Implement reset-recursively
Motivation was the ability to:
$ gsettings reset-recursively org.gnome.gnome-panel

https://bugzilla.gnome.org/show_bug.cgi?id=647579
2011-04-12 12:13:43 -04:00
David Zeuthen
76d3653721 gdbus-codegen: Add --c-generate-object-manager option + doc improvements
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-12 11:50:34 -04:00
Matthias Clasen
3f7912f142 GLocalDirectoryMonitor: Improve struct packing 2011-04-12 10:02:31 -04:00
Matthias Clasen
a2094d5e56 GIOSchedulerJob: Improve struct packing 2011-04-12 10:02:12 -04:00
Matthias Clasen
bfe7548fe1 GFilenameCompleter: Improve struct packing 2011-04-12 10:01:37 -04:00
Matthias Clasen
3e4f3673d8 GFileAttributeMatcher: Improve struct packing 2011-04-12 10:01:05 -04:00
Matthias Clasen
8903ec808b GDBusProxy: Improve struct packing 2011-04-12 10:00:37 -04:00
Matthias Clasen
53e3e111fd GDBusWorker: Improve struct packing 2011-04-12 10:00:03 -04:00
David Zeuthen
8276d0e557 Spiff up the "Migrating to GDBus" docs a bit
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-12 09:28:09 -04:00
David Zeuthen
fc59b9d843 Update "Migrating to GDBus" chapter to take gdbus-codegen(1) into account
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 18:32:11 -04:00
David Zeuthen
e5525f1010 GDBus: Add ObjectManager example
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 16:35:14 -04:00
David Zeuthen
24533f2619 Also use interface_ instead of interface in C files
This is because gtk-doc scans the function in the H file but reads the
docs from the C file. Annoying.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 15:34:38 -04:00
David Zeuthen
6cc4dc5b9b GDBusInterfaceStub: Rename stub parameter to interface
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 15:25:37 -04:00
David Zeuthen
4809028736 GDBus: Avoid using the word interface in public C headers
Same deal as with e.g. index since some libraries may do crazy stuff
such as "#define interface xyz".

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 15:24:52 -04:00
David Zeuthen
4dffec8906 Dist test-codegen.xml
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 14:59:19 -04:00
Matthias Clasen
3c94299b0f Don't include unistd.h unconditionally
It doesn't exist on all platforms. Partial fix for bug 647341.
2011-04-11 12:57:19 -04:00
David Zeuthen
9c1941c07f GDBus: Add test-suite for new ObjectManager and gdbus-codegen(1) code
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 10:54:52 -04:00
David Zeuthen
982195b61c GDBus: Use thread-default GMainContext in _g_assert_property_notify + friends
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 10:51:37 -04:00
Ryan Lortie
ff57ed5d6a GApplication: g_settings_sync() on exit
Call g_settings_sync() just before g_applcation_run() returns.  This is
really the correct thing to do in every case that you're using GSettings
and it prevents every single application from having to do it for
themselves.

Closes bug #647419.
2011-04-11 03:41:10 -04:00
Ryan Lortie
68aef33404 GSettings: make _sync() a no-op if uninitialised
If GSettings is uninitialised then g_settings_sync() should very
obviously just return right away (rather than attempting to initialise
GSettings first).
2011-04-11 03:39:27 -04:00
David Zeuthen
6a45180c95 Clarify docs for g_dbus_gvalue_to_gvariant() and g_dbus_gvariant_to_gvalue()
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-10 11:19:45 -04:00
Ryan Lortie
45377252db Add test case for G_APPLICATION_NON_UNIQUE 2011-04-10 07:56:06 -04:00
Ryan Lortie
9d204338f3 GApplication: add G_APPLICATION_NON_UNIQUE
Add a flag to essentially short-circuit g_application_register().  The
application makes no attempt to acquire the bus name or check for
existing instances with that name.  The application is never considered
as being 'remote' and all requests are handled locally.

Closes #646985.
2011-04-10 07:55:33 -04:00
Ryan Lortie
53389d963d GApplication: fix leaked object path
In the case that we fail to become the primary instance we should
unregister *both* object paths that we registered during our attempt.
2011-04-10 07:50:26 -04:00
David Zeuthen
01a5f19e04 Improve g_dbus_gvalue_to_gvariant() docs
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-09 17:51:59 -04:00
Dan Winship
61704dbca5 GSocket: clarify g_socket_receive documentation
g_socket_receive* return 0 if the connection is closed.

https://bugzilla.gnome.org/show_bug.cgi?id=643074
2011-04-09 12:54:15 -04:00
Dan Winship
ea57feff96 gsettings-tool: warn if setting a value fails
eg, if the dconf backend cannot connect to dbus

https://bugzilla.gnome.org/show_bug.cgi?id=641768
2011-04-09 12:45:16 -04:00
David Zeuthen
1d781ba3be GDBus: Document GVariant/GValue conversion routines and move to them to utils
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-09 11:47:34 -04:00
David Zeuthen
88ab35f3cb Add a generic libffi based marshaller to libgobject
This code is from https://bugzilla.gnome.org/show_bug.cgi?id=567087
and was adapted by myself to also support the GVariant fundamental
type.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-08 17:34:44 -04:00
David Zeuthen
0b9229beca Add gdbus-codegen(1) command
It doesn't work yet without the user manually adding ffi bits. That's
the topic of the next commit.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-08 17:11:38 -04:00
Matthias Clasen
1a0424b7ff Fix another faulty GApplicationCommandline example
Several flaws were pointed out by Shaun McCance. We were
leaking handled arguments, and we were mishandling the last
argument, and we were actually skipping arguments too.

https://bugzilla.gnome.org/show_bug.cgi?id=647031
2011-04-08 17:02:01 -04:00
David Zeuthen
ac93a6af88 Add "Since: 2.30" for new D-Bus routines
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-08 16:29:48 -04:00
David Zeuthen
1e2e58705c GDBusProxy: Store GDBusObject in private struct instead of qdata
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-08 16:12:33 -04:00
David Zeuthen
b41cf76350 GDBusProxy: Update description to match GDBusInterface
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-08 16:12:09 -04:00
David Zeuthen
94b9071344 Start merging gdbus-codegen code
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-08 15:48:28 -04:00
David Zeuthen
0729260141 Silence a bunch of -Wunused-but-set-variable warnings
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-08 15:44:25 -04:00
Ryan Lortie
23818d1e61 GSettings: remove more asserts
Same logic as the last commit on this topic, applied to the other
functions too.
2011-04-08 09:15:19 -04:00
Matthias Clasen
edaf99be86 Avoid an interaction between GApplication and GOption
When using GOption to handle commandlines, we need to disable
the builtin help handling, since it calls exit(). Also mention
this particular pitfall in the docs.
2011-04-08 07:19:38 -04:00
Ryan Lortie
3498d58289 glib-compile-schemas: check for undefined refs
For child schemas, verify that the named schema actually exists and
issue a warning if not.  This error in schema files will cause runtime
errors when iterating over the list of child schemas and attempting to
instantiate each one.

This will move from being merely a warning to a hard error in the
future.

Bug #646039.
2011-04-08 01:47:52 -04:00
Ryan Lortie
4ece333afe Don't assert on backend == settings->priv->backend
They could be different if a notification is queued for delivery and
someone calls g_settings_delay().

Bug #646843.
2011-04-07 21:25:01 -04:00
Matthias Clasen
a2e3a4d150 Add a warning to the g_dbus_connection_set_exit_on_close docs
Tell people to not leak their apps out of the session.
2011-04-07 17:15:41 -04:00
Dan Winship
784619bc3a Fix two leaks seen when using TLS connections
g_tls_certificate_list_new_from_file() was leaking the file contents,
and GSource was leaking the GSourcePrivate structure that got
created when using child sources.
2011-04-07 08:32:06 -04:00
Murray Cumming
3ac7e0a7fe Docs: Change DBus to D-Bus 2011-04-04 09:22:06 +02:00
Murray Cumming
32e26cf179 GDBusMethodInvocation: Improve get_parameters() documentation.
Note that the returned GVariant is always a tuple.
See bug #646420.
2011-04-03 09:13:15 +02:00
Ryan Lortie
131b9f98ea gio.symbols updates 2011-03-31 15:55:21 +05:30
Ryan Lortie
7a752e0817 Improve .gitignore 2011-03-31 15:51:01 +05:30
Ryan Lortie
d95b750a1d compile schemas test: open ranges for all types
We need to make sure that every value in the table actually parses with
GVariant.
2011-03-31 15:15:09 +05:30
Ryan Lortie
d2af82e820 gschema-test: invert expectation for min/max omit
It is now completely valid.

Fix up what is now a legitimate range error in the schema used in one of
the tests.
2011-03-31 15:15:09 +05:30
Ryan Lortie
cde83c8ccd glib-compile-schemas: min and max are now optional
Will be taken to be the minimum and maximum value for the type of the
key if they are left out.

Bug #646310.
2011-03-31 15:14:46 +05:30
Ryan Lortie
49fa69e05e Add 'uint' convenience functions for GSettings
Without getting into a debate about the reasons why you may or may not
want to use unsigned integers, it's sufficient to note that people have
been using them and requesting this functionality.

Bug #641755.
2011-03-31 12:47:03 +05:30
Ryan Lortie
e9ce8f2374 Add GTimeZoneMonitor
Monitors /etc/localtime for changes and instructs GTimeZone to drop its
cache.  Also has a signal for interested 3rd parties.
2011-03-31 12:47:03 +05:30
Martin Pitt
04969571bb [gi] Add missing allow-none annotations to Gio 2011-03-30 19:52:31 +02:00
Jonathan Matthew
95e7aa0e07 introspection: add annotations for g_file_load_contents and friends
https://bugzilla.gnome.org/show_bug.cgi?id=645789
2011-03-29 19:40:26 +10:00
David Zeuthen
f516ebc57b GDBusProxy: Also check signature when checking if signal is expected
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-28 13:04:34 -04:00
David Zeuthen
caf993df6f GDBusProxy: Drop unexpected signals
If we have an expected interface and receive a signal not mentioned in
the interface, simply drop it. This way, the application won't have to
check for the signal itself.

This was pointed out in

 https://bugzilla.gnome.org/show_bug.cgi?id=642724#c5

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-28 12:10:25 -04:00
Olivier Crête
aa59fb9dd1 GDBusProxy: Validate properties received from service if possible
If the proxy has an GInterfaceInfo set, validate properties against it
so the application doesn't have to do it.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-28 11:59:47 -04:00
David Zeuthen
b845c62c7f GDBusProxy: Make interface lookups O(1)
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-28 11:39:22 -04:00
David Zeuthen
91f97ebbaa GDBusConnection: Make interface lookups O(1)
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-28 11:39:22 -04:00
David Zeuthen
5bcf54b29c GDBus: Add mechanism to make lookup on interfaces constant-time
This is used both on the service- and client-side and is currently
O(n).

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-28 11:39:22 -04:00
David Zeuthen
1618ca572f Fix test suite breakage caused by Murray's commit
See https://bugzilla.gnome.org/show_bug.cgi?id=645682

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-25 17:56:59 -04:00
Tristan Van Berkom
a8bc1436f1 GDBusServer: move business logic from _new() function to initable_init()
https://bugzilla.gnome.org/show_bug.cgi?id=639478

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-24 10:08:18 -04:00
Murray Cumming
30fdc1a799 Docs: Changed can not to cannot. 2011-03-24 09:33:55 +01:00
Matthias Clasen
098aa5639c Document which files glib-compile-schemas looks at
Otherwise, your vendor override files are silently ignored...
2011-03-15 11:30:38 -04:00
Olivier Crête
c95ff4de04 GDBusProxy: Check if connection is NULL before unreffing
If no connection can be established with the bus, it is possible that
the GDBusPRoxy will be finalized without having a connection object.
2011-03-14 15:49:02 -04:00
Murray Cumming
c1a75ca783 g_file_info_get/set_attribute_string*(): Document the UTF-8ness.
* gio/gfileattribute.c: (_g_file_attribute_value_get_string,
_g_file_attribute_value_set_string): These use
G_FILE_ATTRIBUTE_TYPE_STRING, which is documented as UTF-8, so
document these private functions as using UTF-8.
* gio/gfileinfo.c: (g_file_info_get_attribute_string,
g_file_info_set_attribute_string, and stringv versions):
Document that the strings are UTF-8 because the implementation uses
those private functions, that use UTF-8.

This helps language bindings (such as glibmm) whose API
distinguishes between known and unknown encodings.
2011-03-11 09:59:09 +01:00
Matthias Clasen
fc75b2597d Improve preconditions in action-related GApplication api
https://bugzilla.gnome.org/show_bug.cgi?id=643780
2011-03-06 23:08:46 -05:00
Matthias Clasen
d377367b2c Forgotten file 2011-03-06 22:38:17 -05:00
Murray Cumming
90ad3c9962 g_application_run(): Add (allow-none) introspection annotation. 2011-03-05 14:51:55 +01:00
Matthias Clasen
3aac417fef Some more details about GApplicationFlags 2011-03-04 12:10:06 -05:00
Matthias Clasen
34ac69e688 Add more GApplication docs
Add more details about ::command-line to the g_application_run docs.
2011-03-04 12:03:15 -05:00
Murray Cumming
91614bb5fe GApplication: Check more before warning about a missing signal handler.
* gio/application.c (g_application_real_command_line): Check that the
default signal handler is not the current one before complaining, because
it is not unusual for overloads to call the base class implementation as
a matter of habit.
g_application_real_open() and g_application_real_activate() already do this
extra check.
2011-03-04 15:16:39 +01:00
Matthias Clasen
1485871ed5 GApplication: More documentation tweaks 2011-03-04 01:55:19 -05:00
Matthias Clasen
54e474931e Fix a typo 2011-03-04 01:55:18 -05:00
Matthias Clasen
6dd692d858 Small doc correction
We don't actually pass @argc to local_command_line().
2011-03-04 00:27:23 -05:00
Matthias Clasen
3c7203cf1a GApplication: Clarify docs for @argv
Clearly state that @argv may be NULL.
https://bugzilla.gnome.org/show_bug.cgi?id=643649
2011-03-04 00:12:34 -05:00
Matthias Clasen
1a6455b785 GApplication: Beef up the local_command_line() docs
This adds some details, such as the meaning of @argc, @argv and @status,
even though gtk-doc does not make it easy to document vfunc arguments.
Requested in
https://bugzilla.gnome.org/show_bug.cgi?id=643478
2011-03-04 00:03:13 -05:00
Matthias Clasen
f05bce027e GApplication: Improve documentation
This commit adds some details regarding platform data.
2011-03-03 23:34:49 -05:00
Matthias Clasen
321682871b Try harder to explain GApplicationCommandline
Trying to answer some of the questions in
https://bugzilla.gnome.org/show_bug.cgi?id=643468
2011-03-03 22:40:48 -05:00
Matthias Clasen
e3cff93408 GApplications: Tighten up application-id validity checks
Also add tests for these conditions.
https://bugzilla.gnome.org/show_bug.cgi?id=643197
2011-02-25 11:13:55 -05:00
Matthias Clasen
766d70729b Allow to list keys in all schemas
Make the schema argument to gsettings list-recursively optional.
This allows to search for not exactly known keys by going

gsettings list-recursively | grep 'font'
2011-02-23 00:18:37 -05:00
Cosimo Cecchi
51dd7c5e4a application: fix a typo in the docs annotation 2011-02-22 22:02:05 -05:00
Chun-wei Fan
7b118b0c41 Visual C++ 2010 Project Files: autotools files
These are the updates to the autotools files to
ensure the expansion of the GIO, GLib and GObject
project files (*.vcxproj, *.vcxproj.filters) and to
enable the distribution of the VS2010 project files

The actual VS2010 project files will follow shortly
2011-02-22 19:58:18 +08:00
Vincent Untz
f909469e31 appinfo: Do not override system default handler with less specific one
We were considering explicitly configured defaults for parent types
after we already got results for the specific type we're interested in.

This resulted in the explicit default for text/plain to override all
system defaults for subtypes of text/plain, for example. The explicit
default should not apply to subtypes that have a system default.

https://bugzilla.gnome.org/show_bug.cgi?id=642797
2011-02-20 16:06:40 +01:00
Tor Lillqvist
1158f9c171 Export _glib_get_locale_dir() as it is now used in gio, too 2011-02-20 01:30:51 +02:00
Matthias Clasen
73af5ab4cf Be more forgiving when parsing introspection xml
Accept (and silently ignore) version attributes on <interface>
and <method> elements - these occur in the wild, and ignoring
them does not cost us anything.
2011-02-19 16:27:51 -05:00
Lin Ma
237df47c5f Fixed bugster 7007407. Do not clear stat info until a node is really
deleted.
2011-02-17 15:07:52 +08:00
Colin Walters
a7faf0b16e gdesktopappinfo: Handle g_get_prgname() being NULL
Reported-By: Sebastien Bacher <seb128@ubuntu.com>

https://bugzilla.gnome.org/show_bug.cgi?id=642490
2011-02-16 13:49:20 -05:00
Matthias Clasen
5df049706f Don't report standard interfaces more than once
If they have a custom implementation, don't add the canned
introspection XML, just rely on the generated XML. Fixes
https://bugzilla.gnome.org/show_bug.cgi?id=642042
2011-02-15 19:50:55 -05:00
Matthias Clasen
6f87ecc14e Add a (currently failing) testcase
This testcase check that we don't report the standard interfaces
more than one in the introspection XML, see
https://bugzilla.gnome.org/show_bug.cgi?id=642042
2011-02-15 19:49:24 -05:00
Matthias Clasen
f9ad7baf31 Fix memory leaks in the gdbus introspection parser
We were getting our length zero, yet NULL-terminated arrays in
a twist in some places. Stop passing around ignored length arguments
at the same time.
https://bugzilla.gnome.org/show_bug.cgi?id=635099
2011-02-15 02:29:15 -05:00
Matthias Clasen
b2919e558b Add schema name in error message
Why not be helpful if it doesn't cost anything...
2011-02-14 19:20:44 -05:00
Matthias Clasen
309f5f978b Improve test coverage
Various test additions, mainly in GObject
2011-02-13 23:49:19 -05:00
Matthias Clasen
c3334490c7 Fix some problems with message handling
g_printerr() doesn't append a newline, so we have to consistently
do it everywhere. Also, we cannot call gettext on "", ever.
2011-02-12 12:45:25 -05:00
Matthias Clasen
a536a1f2d7 Complete the translation setup for glib-compile-schemas 2011-02-12 12:45:25 -05:00
Matthias Clasen
7efc12e0d5 Set up message translation for gdbus
This was only halfway done before and not working.
2011-02-12 12:45:25 -05:00
Colin Walters
4196dfbc4a gsettings: Minor typo in previous commit 2011-02-10 23:42:34 -05:00
Ryan Lortie
0f8d1933ad GSettings: add paragraph with performance notes
summary: reads are very fast.  writes are fast for you, but expensive
for the system, so don't do them except in response to explicit user
action.
2011-02-09 11:55:35 -05:00
Matthias Clasen
a6caaebea7 Document new API 2011-02-08 10:05:00 -05:00
Michal Hruby
d43b2d52b4 Add more data about origin application to the "Launched" signal.
This will help applications such as zeitgeist's datahub to collect
more complete information about application launches, as the "actor"
of a launch is important for zeitgeist's magic to work properly.
2011-02-07 23:39:07 -05:00
Colin Walters
d6954c785d gdesktopappinfo: Asynchronously flush after sending notification
If we were the initial connection owner, unref will destroy the
connection immediately, and we may lose messages.  Asynchronously
flush to avoid that.

https://bugzilla.gnome.org/show_bug.cgi?id=641411
2011-02-07 23:37:14 -05:00
Matthias Clasen
626f197ee3 Clarify GInitable docs
Mention explicitly that the object is unrefed on error.
Pointed out by Philip Van Hoof,
https://bugzilla.gnome.org/show_bug.cgi?id=641363
2011-02-07 23:35:21 -05:00
Javier Jardón
a0554a9f76 docs: Document Since properly, 2.26 -> 2.28 2011-02-08 02:27:44 +00:00
Rui Matos
db12eb5ca4 GApplication: document Since properly in header files, 2.26 -> 2.28
https://bugzilla.gnome.org/show_bug.cgi?id=641783
2011-02-08 01:00:04 +00:00
Johan Dahlin
9823ff1d20 Use ; instead of: to not confuse g-ir-scanner 2011-02-02 13:09:22 -02:00
Johan Dahlin
fdaaa22b58 Correct gtk-doc SECTION: syntax
g-ir-scanner does not allow a space between the : and the
section name.
2011-02-01 16:18:02 -02:00
Ryan Lortie
9f8798170d GApplication: add notes about GDBus architecture
Some people are trying to write code that calls g_application_register()
then checks to see if we became the primary name owner before exporting
objects.  This sort of approach worked with libdbus-1 because method
calls to the freshly-acquired name would not be dispatched until the
application returned to the mainloop.  With GDBus, however, dispatches
can occur at any time (including in the brief space between acquiring
the name and actually registering the object).

Add documentation to make it clear that you should not expect this to
work.
2011-01-31 13:19:59 -05:00
Matthias Clasen
a33aaad00c Fix GIO build on Solaris
Major and minor are defined in sys/mkdev.h on Solaris

Patch by Fabian Groffen
https://bugzilla.gnome.org/show_bug.cgi?id=637013
2011-01-28 20:50:43 -05:00
Matthias Clasen
e644b29190 Use g_set_error_literal where appropriate 2011-01-27 22:54:32 -05:00
Matthias Clasen
4f8a4f171e Remove redundant definitions
https://bugzilla.gnome.org/show_bug.cgi?id=640262
2011-01-27 20:31:14 -05:00
Matthias Clasen
4a8d9b68e3 Fail in a clean way if schema name is missing
https://bugzilla.gnome.org/show_bug.cgi?id=640192
2011-01-27 20:29:22 -05:00
Ryan Lortie
d8ca640422 Merge remote branch 'gvdb/master' 2011-01-27 11:45:04 -05:00
Matthias Clasen
51c87f6809 Update help and docs for gsettings cmdline tool
The man page had gotten quite out of sync.
2011-01-21 18:02:05 -05:00
Matthias Clasen
654ab34e3a Don't warn in GApplication if class handlers have been overridden
https://bugzilla.gnome.org/show_bug.cgi?id=640042
2011-01-21 10:52:48 -05:00
Ray Strode
dc8b03027d gsettings: Update documentation on schema naming convention
The existing docs are a bit inconsistent in that they say to follow
the dbus convention, but then give an example that doesn't.

This commit changes things to be how Ryan says they should be.
2011-01-17 17:31:14 -05:00
Christian Persch
8728949e0d Don't leak variants in the null settings backend
Even though the write fails, the variant still needs to be consumed.

Bug #638872.
2011-01-14 20:19:24 +01:00
Daiki Ueno
c0208940c5 Make g_unix_connection_send_fd() work as expected.
https://bugzilla.gnome.org/show_bug.cgi?id=637696
2011-01-12 16:01:32 -05:00
Chun-wei Fan
19c73918ec Added symbols for GIO/Win32
There are now fallback functions in the Win32 portion of
g_app_info that were previously only available under UNIX,
so add them here so that they can be exported as well.

The symbols are as follows:
g_app_info_get_fallback_for_type
g_app_info_get_recommended_for_type
2011-01-12 11:08:54 +08:00
Matthias Clasen
eec2cb1af8 Avoid a segfault in g_application_register()
Patch by Mikkel Kamstrup Erlandsen
https://bugzilla.gnome.org/show_bug.cgi?id=639177
2011-01-10 20:29:29 -05:00
Matthias Clasen
a57c4c9066 GSettings: Fix a copy-paste error
https://bugzilla.gnome.org/show_bug.cgi?id=639084
2011-01-09 16:43:28 -05:00
Christian Persch
b0b37bcb06 Update gschema.dtd
Bug #639064.
2011-01-09 21:45:20 +01:00
Pavel Holejsovsky
f6b52322a2 Fix and update GI annotations for 'Volumes and Drives'
Volumes and Drives GIO category contains: GVolumeMonitor, GVolume,
GMount, GDrive, Unix Mounts.
2011-01-07 15:06:07 +01:00
Pavel Holejsovsky
f85909fb65 Add and update GI annotations in 'Settings'
'Settings' GIO group contains GSettings and GSettingsBackend.
2011-01-07 15:05:55 +01:00
Colin Walters
e738a8dd8c gdesktopappinfo: Don't crash if we don't have a desktop filename
If code creates a GDesktopAppInfo via g_desktop_app_info_new_from_keyfile(),
we'd try to send a NULL pointer down into GVariant.

Since in this case we don't have a filename, just send the empty
string.  In the future we should either:

1) Change panel to use g_desktop_app_info_new_from_filename(), and
   take the hit of parsing the file twice.
2) Add a g_key_file_get_origin_filename()
3) Add g_desktop_app_info_new_from_keyfile_and_name()

https://bugzilla.gnome.org/show_bug.cgi?id=638838
2011-01-06 13:32:56 -05:00
Serkan Kaba
26b65a3abd gio: Recognize reiser4 in g_file_query_filesystem_info()
Signed-off-by: Serkan Kaba <serkan@gentoo.org>
Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2011-01-06 14:08:02 +01:00
Matthias Clasen
31db1f9688 Add new symbol 2011-01-05 19:07:01 -05:00
Matthias Clasen
f4773faa9f Drop annotation that break the documentation build 2011-01-05 17:46:28 -05:00
Pavel Holejsovsky
b497220e48 Fix GI annotation for g_desktop_app_info_launch_uris_as_manager 2011-01-05 20:35:50 +01:00
Christian Persch
8d74c96b76 Make the memory and null settings backends public
Bug #636806.
2011-01-05 20:31:50 +01:00
Colin Walters
0b59cf6566 g_desktop_app_info_launch_uris_as_manager: Fix parameter naming
This makes introspection happier.
2011-01-05 13:49:20 -05:00
Colin Walters
9be6da9448 Add missing indirection from previous commit
This follows the rest of GLib style, and fixes g-i scanning the
headers.
2011-01-05 13:02:28 -05:00
Nicolas Dufresne
a36cb498d9 [GDummyTLS] Add missing properties and namespace
Add missing properties in the GDummyTlsConnection class. Also add
namespaces to property enumerations to avoid conflicts between classes.

Reviewed-by: Dan Winship <danw@gnome.org>
2011-01-05 12:41:51 -05:00
Stef Walter
4e33967a00 Change GTlsClientConnection::accepted-cas to contain DER DNs
This property is now a GList of GByteArray values. Each
GByteArray contains the raw DER DN of the certificate authority.
This is far more useful for looking up a certificate (with the
relevant issuer) than a string encoded DN.

https://bugzilla.gnome.org/show_bug.cgi?id=637262
2011-01-05 09:35:06 -08:00
Colin Walters
e6546debd6 gdesktopappinfo: Add g_desktop_app_info_launch_uris_as_manager()
A new GDesktopAppInfo specific function which provides more control
over launched processes.  Intended basically only for use in GNOME
Shell, where we want:

*) To directly know the GPid for each launched program, without
   having to listen to a DBus signal emitted in our own process
*) Possibly control over the process environment; for example,
   we may want to call setsid() or redirect file descriptors.

And in the future:
*) To avoid recursively calling ourself via DBus, when a later
   patch causes g_app_info_launch() to indirect via the shell.

https://bugzilla.gnome.org/show_bug.cgi?id=606960
2011-01-05 11:58:07 -05:00
Colin Walters
bb6c44b9d3 gdesktopappinfo: Send out a session bus signal when launching .desktop file
This signal contains the full path of the .desktop file, along with
the process id, which allows multiple interested components (like
GNOME Shell) to better know the state of the system (which processes
correspond to which .desktop files).

https://bugzilla.gnome.org/show_bug.cgi?id=606960
2011-01-05 11:58:03 -05:00
Thomas Kristensen
1e5f11875b revents may have been cleared by GMain before dispatch().
See bug #587898.
2011-01-03 15:20:12 +02:00
Pavel Holejsovsky
929e8db9f4 Add GI annotation: skip g_cancellable_source_new().
It is not bindable, because GSource is not boxed and thus cannot be
returned as caller-owned.
2010-12-29 16:21:22 +01:00
Pavel Holejsovsky
53364788e9 Add GI annotations to Gio DNS resolution classes 2010-12-29 16:02:35 +01:00
Pavel Holejsovsky
add8cf9c09 Add GI annotations to Gio highlevel network functionality 2010-12-29 16:02:26 +01:00
Pavel Holejsovsky
975b0d4487 Add GI annotations to Gio lowlevel network support classes 2010-12-29 16:02:23 +01:00
Pavel Holejsovsky
571104bcc3 Add GI annotations to GPollable{Input|Output}Stream 2010-12-29 16:02:12 +01:00
Pavel Holejsovsky
79fd5ff80d Add missing GI annotation to g_content_type_guess_for_tree 2010-12-29 16:02:04 +01:00
Cosimo Cecchi
408a9fcbcc gaction: update property flags to match needs of GSimpleAction
Commit 068d53358b uncovered this mismatch
between properties on the interface and those on the implementation.
Update them so they match.
2010-12-28 12:24:39 +01:00
Cosimo Cecchi
f248ab1b60 tests: unbreak desktop-app-info test for jhbuild
If we have a jhbuilt version of gedit installed, this will fail, as it
will succeed in deleting its desktop file.
2010-12-28 12:18:51 +01:00
Pavel Holejsovsky
ed5790913e Add GI annotations to GMemory{Input|Output}Stream 2010-12-27 16:47:26 +01:00
Pavel Holejsovsky
53fee54b4f Add GI annotations to GConverter 2010-12-27 16:29:20 +01:00
Pavel Holejsovsky
c8fd3e31ca Add GI annotations to GSeekable 2010-12-27 16:24:21 +01:00
Pavel Holejsovsky
5a8d012d29 Add GI annotations to GIcon and related classes and interfaces 2010-12-27 16:08:46 +01:00
Pavel Holejsovsky
7a1fbcd959 Add GI annotations to GFileEnumerator 2010-12-27 15:48:31 +01:00
Pavel Holejsovsky
1f84c5b72f Add GI annotations to GAppInfo and GDesktopAppInfo 2010-12-27 15:40:07 +01:00
Brian Cameron
37ef8cbba5 Fix for bug #637720. void functions should not return a value. 2010-12-22 01:37:21 -06:00
Pavel Holejsovsky
86b250019a Add GI annotations to GBufferedInputStream 2010-12-21 18:21:33 +01:00
Pavel Holejsovsky
5ea4fa75bd Add GI annotations to GData{Input|Output}Stream 2010-12-21 18:21:33 +01:00
Pavel Holejsovsky
e78c27256a Add GI annotations to GSimpleAsyncResult 2010-12-21 18:21:33 +01:00
Nguyễn Thái Ngọc Duy
12cf4af5bb gio: typo fix 2010-12-21 19:53:00 +07:00
Xavier Claessens
30587a3a60 Add io-stream in gitignore 2010-12-20 18:52:44 +01:00
Cosimo Cecchi
6a10591573 appinfo: avoid overriding the system defaults when adding support
We want to be compatible with the following situation:
- there's no explicit default set in mimeapps.list
- we add support for a content type to a specific application, and that
  list is empty
- the default should be picked from the system list, not overridden by
  the user-added application.

So we make the default explicit in this case, by adding it to the
relevant section in mimeapps.list.

https://bugzilla.gnome.org/show_bug.cgi?id=637675
2010-12-20 18:19:13 +01:00
Christian Dywan
1f9e34cab7 Allow null object in g_simple_async_report_gerror_in_idle
Follow-up on bug 636673.
2010-12-20 17:22:19 +01:00
Cosimo Cecchi
678bcad92c appinfo: add g_app_info_set_as_last_used_for_type()
This commit also changes (maintaining compatibility) the way
user-specified default applications are stored (as in, those for which
g_app_info_set_as_default_for_type() has been called.

We now store the default application for a content type in a new group
in the mimeapps.list keyfile, and "Added Associations" tracks only the
applications that have been added by the user, following a
most-recently-used first order.

This is useful in GtkAppChooser-like widgets to pre-select the last used
application when constructing a widget.

https://bugzilla.gnome.org/show_bug.cgi?id=636311
2010-12-20 15:43:58 +01:00
Cosimo Cecchi
01ba7bd8e8 emblemedicon: make GEmblemedIcon subclassable
Hiding the object/class structs in the source file makes this class not
subclassable.

Move them to the public header, and add a property for the icon, so that
subclasses can just use

  g_object_new (DERIVED_TYPE,
                "gicon", icon,
                NULL);

to create an emblemed icon.

https://bugzilla.gnome.org/show_bug.cgi?id=636892
2010-12-20 15:39:00 +01:00
Matthias Clasen
bc4e1fc622 Add a delay-apply property to GSettings
Bug 637147, patch by Matt Barnes.
2010-12-20 09:16:05 -05:00
Christian Dywan
ddc126cf2c g_simple_async_report_error_in_idle with no object
Document and allow passing of NULL for the object consistently to
_take_error and _report_error functions.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=636673
2010-12-17 17:38:04 +01:00
Pavel Holejsovsky
89b558077f [gi] Add annotations for GFile, G[File]{Input|Output|IO}Stream.
Also make parameter names in virtual function declarations consistent
to silent g-ir-scanner.
2010-12-17 16:29:05 +01:00
Matthias Clasen
101dcecb1f Update symbols list for recent changes 2010-12-17 08:37:21 -05:00
Pavel Holejsovsky
f33ccd4b41 [gi] Fix GObject.Object annotations. 2010-12-16 21:06:51 +01:00
John (J5) Palmieri
6f215e477d [gi] add annotations for methods which take a gpointer which are really GObjects
* bindings need to know how to marshal the pointer otherwise they send in
  the raw wrapped pointer causing crashes
2010-12-16 13:48:31 -05:00
Murray Cumming
2b6c801d10 gioenums.h: Remove a trailing comma. 2010-12-16 10:57:39 +01:00
Cosimo Cecchi
274ef35fd4 tests: remove a bogus assumption 2010-12-15 18:03:13 +01:00
Matthias Clasen
683a5632c8 Remove GPeriodic for now
The necessary review and integration work has not happened, and
we don't want to enshrine it in this unproven state.
It will be back when the world is ready for it.
2010-12-15 11:56:44 -05:00
Cosimo Cecchi
9411d0c108 docs: fix a typo 2010-12-15 12:50:59 +01:00
Cosimo Cecchi
bfee021cfb emblemedicon: add docs for _clear_emblems() 2010-12-15 12:49:22 +01:00
Cosimo Cecchi
f53d518a3d emblemedicon: add g_emblemed_icon_clear_emblems()
https://bugzilla.gnome.org/show_bug.cgi?id=637171
2010-12-15 11:45:20 +01:00
Cosimo Cecchi
056a5d753d gapplication: plug a memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=637237
2010-12-15 11:43:14 +01:00
Pavel Holejsovsky
8c742aea72 Add missing annotations to GApplication and GApplicationCommandLine. 2010-12-15 11:26:59 +01:00
Ted Gould
09ce9dc542 Bug 635626 – GDBus message idle can execute while flushes are pending
https://bugzilla.gnome.org/show_bug.cgi?id=635626

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-12-13 13:33:15 -05:00
Peng Huang
735fcf918e Bug 632544 – Cannot send a locked message with PRESERVE_SERIAL flag
https://bugzilla.gnome.org/show_bug.cgi?id=632544

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-12-13 13:09:38 -05:00
Xavier Claessens
e4f25c0fed Add Since 2.28 in g_io_stream_splice doc 2010-12-13 17:42:11 +01:00
Xavier Claessens
0a2d47b626 Add g_io_stream_splice_async/finish()
That function splice the output stream of both GIOStreams to the input stream
of the other GIOStream.
2010-12-13 17:36:12 +01:00
Christian Persch
ce50df7e0e Better error reporting for g_variant_parse()
Add error codes, and use them when setting the GError.

Bug #634583.
2010-12-12 13:25:34 +01:00
Dan Winship
ad56426bc7 Add missing property to GDummyTlsCertificate 2010-12-10 10:01:22 +01:00
Benjamin Otte
ca38bddd6e gio: Add a count to the resolver test for number of enumerators
This adds the nice stress-test feature of having 5 enumerators running
at the same time. Yay!
2010-12-07 19:39:24 +01:00
Benjamin Otte
bd227f5219 gio: Make enumerating a GNetworkAddress work more than once
Previously, the code only initialized the enumerator if the address
hadn't had cached addresses. But creating an enumerator cached the
addresses, so the second one failed to work.
2010-12-07 19:39:24 +01:00
Benjamin Otte
07fd29c323 tls: Make g_tls_{client|server}_connection_new() return a GIOStream
The main use case for these objects is as an IO stream, so it makes
sense to return them that way from the start.
2010-12-07 19:39:24 +01:00
Benjamin Otte
c59ba60fbe tls: Clarify docs for g_tls_client_connection_set_validation_flags()
And fix a typo in there.
2010-12-07 19:39:23 +01:00
Emilio Pozuelo Monfort
85adbc99bf Fix error in GSimpleAsyncResult example 2010-12-07 17:46:21 +01:00
Dan Winship
f5c3e0d3d5 Change the handling of the peer certificate in GTlsConnection
Make the certificate and peer-certificate properties virtual, and add
peer-certificate-errors as well. Change the documentation on
peer-certificate to say that it's not set until after the handshake
succeeds (which means notify::peer-certificate can be used to tell
when a handshake has completed).
2010-12-07 14:58:42 +01:00
Dan Winship
b5a707ec90 Clarify that g_socket_client_connect_to_uri() doesn't know about TLS 2010-12-07 10:41:06 +01:00
Dan Winship
4f6efb681d Change the semantics of GTlsConnection:require-close-notify
We were combining "allow un-notified closes" and "close without
notifying" into a single property, which meant that it was impossible
to "be liberal in what you accept and conservative in what you send".
Change require-close-notify to only be about the peer behavior, and
make our connections always close-notify properly when closing (while
noting that you can just close the base-io-stream directly if you want
to do an unclean close).
2010-12-07 10:41:06 +01:00
Dan Winship
68a3d6b27f add G_TLS_ERROR_UNAVAILABLE 2010-12-07 10:41:06 +01:00
Dan Winship
95cba18349 Remove GTlsConnection::need-certificate
Trying to do this as a signal won't work well with either
GTlsCertificateDB (in which case looking up a certificate in the db is
a blocking/asynchronous act) or session resumption support (in which
case the certificate or lack thereof is part of the session definition
and so needs to be known immediately). Make the caller use
g_tls_connection_set_certificate() ahead of time (or when retrying)
instead.
2010-12-07 10:41:05 +01:00
Dan Winship
d6e94070dd Add GTlsConnection:use-system-certdb
This can be set FALSE if you don't want to validate certificates
against the system database.
2010-12-07 10:41:05 +01:00
Dan Winship
73d6bd8a45 Add g_tls_certificate_verify()
Add a method to verify a certificate against a CA; this can be used
for apps that need to test against non-default CAs.

Also make the GTlsCertificate::issuer property virtual
2010-12-07 10:41:05 +01:00
Matthias Clasen
4b28e6a008 Add missing Since: tag
g_simple_async_result_is_valid was added in 2.20.

Bug 636351
2010-12-03 14:49:07 -05:00
Colin Walters
d11f413345 introspection: Remove spurious trailing :
This isn't valid syntax.
2010-12-03 14:26:28 -05:00
Christian Dywan
426f90e3cf Resolve warnings about istream and ostream in socket test 2010-12-03 16:33:24 +01:00
Benjamin Otte
b9a98a81da gio: Comment out a whole test
... instead of just commenting out the registration and leaving "unused
function" warnings for gcc.
2010-12-02 20:11:28 +01:00
Benjamin Otte
b92e2cd8f8 gio: Remove unused variables from test 2010-12-02 20:11:28 +01:00
Matthew Barnes
9fe7fd9120 Bug 636100 - Can't read GSettings:backend property
The PROP_BACKEND case was missing from the switch statement in
g_settings_get_property().
2010-11-30 18:21:10 -06:00
Dan Winship
50a8b039a4 tiny fix to g_io_modules_scan_all_in_directory() docs 2010-11-29 09:37:41 -05:00
Xan Lopez
78103b2f1f gsettingsschema: plug leak 2010-11-29 15:29:56 +01:00
Aleksander Morgado
98bfc8afda Fixes GB#635187: Always unbox GVariant parameter received via dbus for an action 2010-11-29 08:06:31 -05:00
Matthias Clasen
eed36d38d1 Various doc tweaks 2010-11-28 23:55:43 -05:00
Matt Rajca
577ddbf30b Fixed typo in public string in gsocks (630559) 2010-11-28 18:29:50 -05:00
Aleksander Morgado
51894b7dd0 Fixes GB#530786: GFileMonitor 'changed' signal underdocumented 2010-11-28 18:20:59 -05:00
Christian Persch
b4632e1c98 Fix the wrong-category schema test
It's supposed to test a <default l10n="..."> with a non-existent
category, so make it actually check this!

Bug #635882.
2010-11-28 17:26:30 -05:00
Matthias Clasen
bfbd7169a2 GFileMonitor: Don't accept negative values for rate-limit
Patch by Alksander Morgado,
https://bugzilla.gnome.org/show_bug.cgi?id=635768
2010-11-28 17:14:49 -05:00
Christian Persch
57143e311d Inherit gettext-domain from <schemalist>
When the <schema> doesn't have a 'gettext-domain' attribute, but
the <schemalist> does, use that one.

Bug #635640.
2010-11-28 19:01:21 +01:00
Dan Winship
69129e8065 Make gio/tests/g-icon pass again
It got broken in two different ways by the g_str_hash() change
(354d655b)
2010-11-27 16:56:44 -05:00
Christian Persch
1797970720 Typo fix 2010-11-27 13:10:48 +01:00
Dan Winship
59d62726de Add initial TLS (SSL) support to gio
This adds an extension point for TLS connections to gio, with a
gnutls-based implementation in glib-networking.

Full TLS support is still a work in progress; the current API is
missing some features, and parts of it may still be changed before
2.28.

https://bugzilla.gnome.org/show_bug.cgi?id=588189
2010-11-26 15:57:11 -05:00
Dan Winship
a1690339c7 make GProxyConnection public, as GTcpWrapperConnection
GProxyConnection is a class that was added for proxy support;
g_socket_client_connect() returns a GSocketConnection, but in some
cases (eg, encrypted SOCKS), GProxy might return a GIOStream that is
not a GSocketConnection. In that case, GSocketClient would wrap the
stream up in a GProxyConnection, which is a subclass of
GSocketConnection but uses the input/output streams of the wrapped
connection.

GTlsConnection is not a GSocketConnection, so it has the same problem,
so it will need the same treatment. Rename the class to
GTcpWrapperStream, and make it public, so people can extract the base
stream from it when necessary.

(This is not ideal and GSocketClient will need to be revisited as an
API at some point...)

https://bugzilla.gnome.org/show_bug.cgi?id=588189
2010-11-26 15:08:31 -05:00
Dan Winship
c20c2c0abd Add pollable input/output streams
When interfacing with APIs that expect unix-style async I/O, it is
useful to be able to tell in advance whether a read/write is going to
block. This adds new interfaces GPollableInputStream and
GPollableOutputStream that can be implemented by a GInputStream or
GOutputStream to add _is_readable/_is_writable, _create_source, and
_read_nonblocking/_write_nonblocking methods.

Also, implement for GUnixInput/OutputStream and
GSocketInput/OutputStream

https://bugzilla.gnome.org/show_bug.cgi?id=634241
2010-11-26 15:08:08 -05:00
Dan Winship
6181c7de36 GCancellable: add g_cancellable_create_source()
g_cancellable_create_source() returns a GSource that triggers when its
corresponding GCancellable is cancelled. This can be used with
g_source_add_child_source() to add cancellability to a source.

Port gasynchelper's FDSource to use this rather than doing its own
cancellable handling, and also fix up its callback argument order to
be more normal.

https://bugzilla.gnome.org/show_bug.cgi?id=634239
2010-11-26 15:07:28 -05:00
Dan Winship
73d823ac1e Implement closure-related methods for gio GSource types
Also, fix up the argument ordering on GFDSourceFunc

https://bugzilla.gnome.org/show_bug.cgi?id=634239
2010-11-26 15:07:28 -05:00
Matthias Clasen
e5dd266c33 Add Since: tags for new api
Also, remove <!-- --> from things like #GAppInfo<!-- -->s.
gtk-doc learned to deal with this a while ago.
2010-11-24 15:57:40 -05:00
Javier Jardón
ee94915d0b docs: gappinfo: Fix typo <envvar> -> <envar> 2010-11-24 18:47:09 +01:00
Cosimo Cecchi
5f958e4623 tests: add a test for recommended and fallback GAppInfos 2010-11-23 10:29:10 +01:00
Cosimo Cecchi
b3bf7a6484 appinfo: add win32 fallback implementation 2010-11-23 10:29:09 +01:00
Cosimo Cecchi
30c378032f appinfo: update docs for API addition 2010-11-23 10:29:09 +01:00
Cosimo Cecchi
182fcff2ea appinfo: only rewrite recommended applications when adding non-default
Otherwise you break the fallback + recommended distinction for a content
type, as you end up adding support for a given content type to *all* of
the applications claiming to support the supertype.
2010-11-23 10:29:09 +01:00
Cosimo Cecchi
94c67d8420 appinfo: add API to get fallback and recommended GAppInfos for a ctype
This ways UIs can differentiate between them, and show them in different
section.
- a recommended app is an application that claims to support a content
  type directly, not by a supertype derivation.
- a fallback app is an application that claims to support a supertype of
  a given content type.
2010-11-23 10:29:09 +01:00
Ignacio Casal Quinteiro
ab3a79e2c9 Check for (GIConv)-1 instead of NULL. 2010-11-21 21:21:22 +01:00
Colin Walters
260d005616 introspection: Add annotations for g_file_copy, g_file_move 2010-11-17 20:07:39 -05:00
Tomas Bzatek
2bfcffde9a GIO: Hide mounts having a path element starting with dot
When a mount is mounted to a directory whose path contains an element
starting with dot, let's treat it as hidden, just like the usual Unix
approach.
2010-11-16 14:20:07 +01:00
Ryan Lortie
48ca3add14 G_STATIC_ASSERT: clarify when use is valid
Clarify when the use of G_STATIC_ASSERT is valid and fix up an invalid
use of it in GDBus.
2010-11-11 21:49:21 -05:00
Ryan Lortie
6bc20651ec Partial revert of last commit
Revert incorrect changes to gdbusmessage.c
2010-11-11 21:49:21 -05:00
Cosimo Cecchi
d28bce02dc emblemed-icon: allow passing a NULL emblem to g_emblemed_icon_new()
So that if we already have a list of emblems we know we want to add to
the icon, we can use e.g. a for loop to add them all, without picking
the first and looping from the second.

https://bugzilla.gnome.org/show_bug.cgi?id=634504
2010-11-10 19:08:52 +01:00
Benjamin Otte
fb94859e84 API: Reinstate "gio-desktop-app-info-lookup" extension point
Removing an extension point is an API and ABI break. In particular, it
causes (older) gvfs versions to fail loading with a linkage error from
ld which in turn makes the desktop unusable.
So this reinstate the extension point and API provided by it, but
deprecates and does not use it. So no functionality is changed.

This reverts parts of commit 9b262f1c5f.

Complaints-Also-To: Ryan Lortie <desrt@desrt.ca>
2010-11-09 21:13:04 -05:00
Chun-wei Fan
9f02ee790b gio: Fix C99 style variable declarations (bug #633075)
-gdbusmessage.c and gregistrysettingsbackend.c is updated to fix C99-style declarations
-also fixed typo for displaying registry entry in gregistrysettingsbackend.c (\% -> \\%)
2010-11-09 20:36:53 +08:00
Ryan Lortie
587c9d09e2 GPeriodic: enable subclassing
Move GPeriodic struct and class struct to the header.  Do ->priv.
2010-11-08 18:22:18 -05:00
Ryan Lortie
9fbfac6abb GPeriodic: remove repair functions
Replace it with a single repair signal that either fires or does not.
2010-11-08 18:22:18 -05:00
Dan Winship
78bc8bec4f fix .gitignore 2010-11-07 12:56:44 -05:00
Dan Winship
791d91a957 fix make check 2010-11-07 12:56:08 -05:00
Ryan Lortie
71088701af Add G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE
If specified, the signal subscription is setup client-side but the match
rule is not sent to the server.  This allows the caller to manually
register more detailed match rules.
2010-11-06 17:35:10 -04:00
Matthias Clasen
57b4b7099f Fix markup 2010-11-05 14:50:01 -04:00
Matthias Clasen
38bc42d18e Fix up gapplication example 2010-11-05 14:29:15 -04:00
Matthias Clasen
67c03fee2a Describe enum and flags types a bit 2010-11-05 14:28:44 -04:00
Matthias Clasen
d1b00fe23d Update the gschema dtd to include flags 2010-11-05 13:56:42 -04:00
Matthias Clasen
bc793255bc Report more useful errors from g_settings_set_value 2010-11-05 09:31:36 -04:00
Christian Persch
ba45e36932 Add g_simple_async_report_take_gerror_in_idle
... and use it where appropriate. Saves an extra GError copy.

Bug #633686.
2010-11-03 14:38:08 +01:00
Christian Persch
9e0c07870a Use g_simple_async_result_{new_,}take_error
Bug #633685.
2010-11-03 14:25:35 +01:00
Ryan Lortie
63b87b2c26 Add simple dynamic scheduling to GPeriodic
GPeriodic will now try not to use more than 50% of the CPU for its own
purposes unless there are no other tasks attempting to run.
2010-11-03 00:16:16 -04:00
Matthias Clasen
8c7e284116 Tweak GApplication docs 2010-11-02 23:02:05 -04:00
Ryan Lortie
d22681feb4 glocalfileinfo: remove non-use of GTimeVal 2010-11-02 22:39:09 -04:00
Ryan Lortie
c3a0d32ef1 Switch GTimeSpec users to int64 microseconds
glib is trying to move toward using microseconds-in-gint64 as its
universal time format.

No real API breaks here since GTimeSpec is new this unstable release
series.
2010-11-02 22:39:09 -04:00
Paolo Borelli
361afb3a62 Fix gtk-doc typo 2010-11-01 14:37:23 +01:00
Christian Persch
7434c1725d Fix Since: for new functions
g_simple_async_result_new_from_error/take_error are Since: 2.28.
2010-11-01 11:06:26 +01:00
Matthias Clasen
b4248cb5da Remove nonexisting type from giotypes.h
GDBusActionGroup does not exist yet.
2010-10-31 23:19:04 -04:00
Matthias Clasen
71dcc5ce80 Remove leftover definition from gactiongroup.h
GContextActionGroupInterface is not currently used anywhere.
2010-10-31 23:10:41 -04:00
Matthias Clasen
b49ae16461 Various documentation fixes 2010-10-31 22:41:00 -04:00
Matthias Clasen
85ba8596e2 GSimpleAsyncResult: add error-taking variants
Add g_simple_async_result_new_take_error and
g_simple_async_result_take_error, which take over ownership of the
given error. Based on a patch by Christian Persch.

https://bugzilla.gnome.org/show_bug.cgi?id=629247
2010-10-31 22:38:38 -04:00
Matthias Clasen
7887103193 Add an example of invoking actions 2010-10-31 22:05:20 -04:00
Matthias Clasen
d967b5ed17 Fix g_action_group_activate_action() docs 2010-10-31 21:08:25 -04:00
Matthias Clasen
9574dbd228 Be more careful about overwriting errors
When trying to parse again, we don't want to overwrite the exiting
error.
2010-10-31 20:58:15 -04:00
Matthias Clasen
78407a0098 GApplication: Add an action example 2010-10-31 20:49:53 -04:00
Matthias Clasen
cb8d29a558 Don't leak references in the actions example
These are not initially unowned...
2010-10-31 20:33:02 -04:00
Matthias Clasen
c34bcefa78 Add an example of using GApplication with actions 2010-10-30 22:19:02 -04:00
Matthias Clasen
e24dfacd5b gsettings-tool: Support completion for enum values
https://bugzilla.gnome.org/show_bug.cgi?id=631264
2010-10-30 01:13:42 -04:00
Matthias Clasen
6298e88538 Add a command to list keys and values recursively
This is similar to gconftool-2 -R, which is very handy
for collecting information for bug reports, etc. It is now
possible to say gsettings list-recursively org.foo.bar, and
this will produce a list of schemas, keys and values for
org.foo.bar and all its child and grandchild schemata,
recursively.

https://bugzilla.gnome.org/show_bug.cgi?id=632571
2010-10-30 00:00:06 -04:00
Matthias Clasen
d619216686 Make gsettings-tool translatable again
This regression was caused by the recent rewrite.
2010-10-29 23:12:07 -04:00
Ryan Lortie
cb64773002 Use 'aay' instead of 'as' for environ
It might contain non-utf8 characters.
2010-10-29 16:33:47 -04:00
Ryan Lortie
641f622bfe GApplication: emit a signal when starting up
Send a signal to the bus when registration is successful and we are the
primary instance.
2010-10-28 23:06:53 -04:00
Ryan Lortie
7aa2e50262 GApplication: support environment passing
Add support for passing the full contents of the environment to the
primary instance (by storing it in the platform_data) when
G_APPLICATION_SEND_ENVIRONMENT is in the flags.
2010-10-28 22:50:00 -04:00
Ryan Lortie
bf7ba2fbdc GApplication: use infinite timeout for CommandLine
Use an infinite DBus timeout for sending a CommandLine request to the
primary instance.

This resolves a bit of bug #633339.
2010-10-28 16:47:13 -04:00
Ryan Lortie
fac2a8278e Bug 633356 - (GDBus) Make G_MAXINT mean no timeout
Don't register a timeout function in the case that G_MAXINT is given for
the timeout length.
2010-10-28 16:47:13 -04:00
Dan Winship
cd4f818b30 GNetworkService: fix a small bug
Fix a small bug in the synchronous lookup code introduced in the fix
for bug 629274
2010-10-28 15:17:17 -04:00
Ryan Lortie
4baad1acbf GApplication: exit_status unset in one branch
Closes #633206
2010-10-27 09:26:01 -04:00
Ryan Lortie
f7a918dcb9 GPeriodic: allow unblock time to be passed in 2010-10-27 09:22:13 -04:00
Ryan Lortie
83472b34ef switch GSocket to monotonic time for timeouts 2010-10-27 09:22:13 -04:00
Ryan Lortie
d3fe2efb83 switch GPeriodic to use monotonic time 2010-10-27 09:22:13 -04:00
Ryan Lortie
e0caf4fd5e GApplicationCommandLine: add printf annotations
to g_application_command_line_print{,err}
2010-10-25 14:45:19 -04:00
Ryan Lortie
d8d2513710 Implement (untested) GApplication actions support 2010-10-25 14:32:07 -04:00
Matthias Clasen
11a59404d5 More documentation fixups 2010-10-25 08:42:36 -04:00
Matthias Clasen
d10a04b533 Remove nonexisting API from the headers
I couldn't find any trace of g_application_run_with_arguments.
2010-10-25 08:34:00 -04:00
Matthias Clasen
00366f440d Some more GApplication doc tweaks 2010-10-23 21:01:15 +02:00
Matthias Clasen
013f862a03 Properly register the inactivity-timeout property
It is a uint, not a boolean, so register it as such.
Also, only install the service timeout if we are actually registered
as the primary instance.
2010-10-23 14:05:04 +02:00
Matthias Clasen
7c735b05f7 Move a confusing comment to the right place 2010-10-23 12:01:51 +02:00
Matthias Clasen
b0e45c9799 Add another example for commandline handling
Also, clarify some aspects in the documentation.
2010-10-23 11:59:29 +02:00
Matthias Clasen
499d9ba8b8 Add some examples to the GApplication docs 2010-10-23 02:31:16 +02:00
Matthias Clasen
79790b9278 Brush up the GApplication docs
Also, fix up inclusions, mark properties for translation, etc.
2010-10-23 02:31:16 +02:00
Matthias Clasen
210a77a07e Fix a typo 2010-10-23 02:31:16 +02:00
Dan Winship
e410131021 GNetworkService: fall back when there is no valid SRV record
RFC 2782 says that if there is no SRV record for
_SERVICE._PROTOCOL.DOMAIN, you should fall back to trying just DOMAIN,
with the default port for SERVICE. Do that.

https://bugzilla.gnome.org/show_bug.cgi?id=629274
2010-10-22 14:59:35 -04:00
Dan Winship
19243c247d GNetworkService: fix iteration of multiple addresses
Previously if there were multiple SRV records, only the first would
be iterated by the GSocketConnectable interface
2010-10-22 14:59:35 -04:00
Dan Winship
87d06109ab GSocket: set protocol when using g_socket_new_from_fd()
Otherwise, attempting to create a GSocketConnection from the socket
will likely return the wrong type, since the protocol won't match any
of the registered subtypes.

Also add the start of a GSocket test program (from davidz).

https://bugzilla.gnome.org/show_bug.cgi?id=627171
2010-10-22 14:42:41 -04:00
Ryan Lortie
dd6e15dd24 GApplication: create local commandline properly
Don't pass a gchar** to g_object_new() when a GVariant* is expected.
2010-10-21 14:02:41 +02:00
Ryan Lortie
8690984cea GPeriodic: pass microseconds to the tick functions
...instead of milliticks, which nobody really cares to understand.
2010-10-21 01:37:23 +02:00
Ryan Lortie
5400b0b38c GPeriodic: a periodic event clock
Add a new class, GPeriodic.

We hope to use this as a paint clock that can be shared by GTK and
Clutter.  Many changes are still expected to the API.
2010-10-20 11:47:31 +02:00
Ryan Lortie
e33deea16c GApplication: reduce GVariant abuse
Don't use GVariant* as the representation for the argument array.
2010-10-19 19:38:00 +02:00
Ryan Lortie
a327bc51fc Cleanup and doc GApplicationCommandLine 2010-10-19 18:29:58 +02:00
Ryan Lortie
a2ac9c2515 GDBus: disable test to work around bug #631379
This test consistently prevents 'make distcheck' from passing on Ubuntu.
2010-10-19 13:45:20 +02:00
Ryan Lortie
0ce1462d1a GApplication: merge DBus interface into C source
instead of having it in a separate file that causes problems to the
build system (I want to avoid using EXTRA_DIST here).
2010-10-19 13:44:30 +02:00
Ryan Lortie
8ff9150e44 gio: update symbols 2010-10-19 12:38:40 +02:00
Ryan Lortie
34f31fdfda Don't try to dist old GApplication implementations
One of them was deleted already, even.
2010-10-19 12:38:01 +02:00
Ryan Lortie
a6b8a3113b GApplication: use g_signal_accumulator_first_wins
...instead of our homebrew version.
2010-10-19 01:16:46 +02:00
Ryan Lortie
04b58a3e27 Change 'Since:' to 2.28 for action classes 2010-10-19 01:16:46 +02:00
Ryan Lortie
3fe94ca9e9 GApplication: fill in action group implementation 2010-10-19 01:16:46 +02:00
Ryan Lortie
491641cf01 gio: app info symbol file fixup 2010-10-19 01:16:46 +02:00
Ryan Lortie
52b7fcf409 gio: symbol file updates (actions, command line) 2010-10-19 01:16:46 +02:00
Ryan Lortie
d6ac6c1850 Rename methods on GActionGroup to include 'action'
Makes explicit the fact that you are interacting with the individual
action rather than the group and removes potential namespace conflicts
with classes implementing the interface (like g_application_activate()
vs g_application_activate_action()).
2010-10-19 01:16:46 +02:00
Ryan Lortie
b2f942c142 GApplication: stub-in GActionGroup implementation 2010-10-19 01:16:46 +02:00
Ryan Lortie
582638d7ad GApplication test: test remote commandline
Also, a few small fixes/tweaks to other places in the test.
2010-10-19 01:16:46 +02:00
Ryan Lortie
3e6eee806c GApplication: add remote commandline support 2010-10-19 01:16:46 +02:00
Ryan Lortie
2854c373e1 GApplication test case 2010-10-19 01:16:46 +02:00
Ryan Lortie
72ce1c7eb6 GApplication: fix inactivity-timeout
Create the gobject property for it.

Tweak the logic of having a pending timeout at the time that the
application starts -- run the mainloop with a use count of zero if there
is a timeout active.
2010-10-19 01:16:46 +02:00
Ryan Lortie
a7923a4aa3 new GApplication implementation 2010-10-19 01:16:46 +02:00
Matthias Clasen
9040eac4eb Prevent error pileup 2010-10-16 23:31:30 -04:00
Colin Walters
0c21689ed8 gthemedicon: Fix annotation for g_themed_icon_get_names 2010-10-12 12:54:36 -04:00
Christian Dywan
3035bf40d0 Initialise lengths in GvdbReader to silence warnings 2010-10-08 16:34:51 +02:00
Christian Dywan
ad363d9aac Initialise lengths in GDbusAuth to silence warnings 2010-10-08 16:33:04 +02:00
Bastien Nocera
9b262f1c5f Replace "gio-desktop-app-info-lookup" extension point
With a native version, that looks for desktop items supporting
x-scheme-handler/foo, when looking for a handler for the "foo"
URI scheme handler.

https://bugzilla.gnome.org/show_bug.cgi?id=631410
2010-10-05 17:15:37 +01:00
Ryan Lortie
1612a4d506 volume monitor: don't unref NULL
Fix a couple more cases of blindly calling g_object_unref() on the
result of a function that is documented as sometimes returning NULL.
2010-10-05 02:29:47 -04:00
Ryan Lortie
3c5b50c424 GSettings test: fix error match strings
The name of the internal function that appears in an assertion message
has changed.  Update the tests.
2010-10-04 21:07:50 -04:00
Ryan Lortie
c4037230d4 gsettings-tool: Add 'range' subcommand
Provides access to the g_settings_get_range() functionality, converting
its return value to something that's reasonable for printing at the
console and potentially parseable.  The format may change.

Bug #631264.
2010-10-04 03:42:57 -04:00
Ryan Lortie
59bdba3cbb gsettings-tool: implement range-checking
Prevent assertion messages from spewing forth and also ensure that we
exit with an error status in the event that the value was out of range.

Bug #631264.
2010-10-04 03:42:43 -04:00
Ryan Lortie
e740c5b4cd Update symbols and docs sections 2010-10-04 03:36:09 -04:00
Ryan Lortie
e81d856159 GSettings: add g_settings_range_check() API
Checks if a given value is within the correct range for a key.
2010-10-04 03:33:06 -04:00
Ryan Lortie
d6d76783ae Bug 631263 - GSettings needs range/choice APIs
Add g_settings_get_range() to describe the possible values that may be
provided to g_settings_set_value() without causing an error.

Add a test case.
2010-10-04 02:58:46 -04:00
Ryan Lortie
833e389516 schema compiler: Don't store zero-valued flags
Don't store the "none" value for flags into the compiled schema file.
"none" should never appear as a value -- no flags set is indicated by an
empty array.
2010-10-04 02:57:06 -04:00
Ryan Lortie
8efcc0d8c8 glib-compile-schemas: write strinfo little endian
Ensure that the strinfo is output in little-endian byte order on big
endian machines.

GSettings is now passing all of its tests on PowerPC.

Bug #630968 is closed.
2010-10-03 23:26:18 -04:00
Ryan Lortie
61563d5f55 GSettings strinfo: byteswap integers
strinfo is always strictly little endian, so ensure that we byteswap to
native when comparing and returning.
2010-10-03 23:25:29 -04:00
Ryan Lortie
9211d2b00c GSettings endian: missed a spot
Missed an instance of get_value -> get_raw_value search/replace.
2010-10-03 23:15:27 -04:00
Ryan Lortie
c84441fbb3 GSettings big endian tweaks
GSettings relies on parts of the schema infromation remaining
unbyteswapped (the strinfo database, for example) while requiring other
parts to be in native order (the default value, constraints, etc.).

Lift the byteswapping into a place where we can do it selectively.
2010-10-03 23:04:00 -04:00
Ryan Lortie
73ca8b4754 Merge remote branch 'gvdb/master' 2010-10-03 23:03:12 -04:00
Ryan Lortie
90822327ac GSettings test: fix unsafe GObject properties use
The test case was passing a guint16 to g_object_get() for a guint
property.  That's invalid on all systems, although it works (more or
less) on little endian ones.  On big endian it's a total no-go.
2010-10-03 22:55:53 -04:00
Ryan Lortie
63adeda086 Merge remote branch 'gvdb/master' 2010-10-03 21:11:17 -04:00
Ryan Lortie
0bd50b39eb Bug 623400 - acquire context before dispatching
For GSettings.

Use the functionality introduced in the last commit to simplify our
notify dispatching and increase the safety of doing so (by ensuring that
the context is acquired in the current thread for the duration of the
dispatch).

This closes bugs #623400 and #629849.
2010-10-03 17:34:16 -04:00
Ryan Lortie
2d6f8a8ea4 gsettings-tool: Rewrite
Rewrite the GSettings tool.

Improvements/changes:

 - simplify the code by performing common actions (like creating a
   schema) in only one place instead of one per-command

 - new features (list schemas, list keys, monitor multiple, etc)

 - factor-out bash completion and implement in shellscript

 - input validation: should never abort due to invalid inputs

Still to do:

 - proper error checking for ranges/choices

 - support for querying range/choice information

 - bash completion support for enums

Closes bug #629289, possibly among others.
2010-10-03 02:48:07 -04:00
Ryan Lortie
ed9db23f9a GSettings: implement .property_get('path')
This was unimplemented in g_settings_get_property(), leading to a failed
'g_assert_not_reached()'.
2010-10-03 01:53:09 -04:00
Ryan Lortie
5af11ae4bc Add 'Since:' tags for schema listing APIs 2010-10-02 22:46:53 -04:00
Ryan Lortie
d2c0699440 Clean up g_settings_list_schemas()
In its previous form, g_settings_list_schemas() was not useful as a tool
to prevent aborts due to using g_settings_new() with an invalid schema
name.  This is because g_settings_list_scheams() also listed relocatable
schemas, and calling g_settings_new() for those would abort just the
same as if you called it for a non-existent schema.

Modify g_settings_list_schemas() so that it only returns schemas for
which it is safe to call g_settings_new().  Add another call for sake of
completeness: g_settings_list_relocatable_schemas().
2010-10-02 22:42:02 -04:00
Ryan Lortie
ba0e608478 Improve .gitignore 2010-10-01 11:21:17 -04:00
Ryan Lortie
3e771509b4 Bug 628937 - gracefully handle broken schemas
Implement the second feature requested in the bug: silently ignore
override files that attempt to override schemas that are not currently
installed.

Also, support 'strictness' being optional for other errors when parsing
override files (ie: inability to open the file, unknown key name, parse
errors, out of range).  We don't completely back out the file in this
case — as that is difficult with the current implementation — but just
ignore the override for the single key.
2010-10-01 11:21:13 -04:00
Ryan Lortie
bd290081ff glib-compile-schemas: improve error accuracy
We wrote "<enum> must contain at least one <value>" for empty <flags>.
Fix that.
2010-10-01 11:21:07 -04:00
Ryan Lortie
e40f3932dd Bug 628937 - gracefully handle broken schemas
Implement the first of two features requested in the bug: when
encountering a broken .xml schema file, back out the changes in that
file and continue to parse other files.

This prevents a single broken .xml file from messing up GSettings for
everyone else.

Add a --strict option to get the old behaviour.  Use this from the test
cases.
2010-10-01 11:21:02 -04:00
Matthias Clasen
fe1186a842 message_to_write_data_free: Don't unref data->message if it is NULL
After the recent changes to message filtering, it can happen that
data->message is NULL when we get here.
2010-09-30 14:40:50 -04:00
Colin Walters
755c2dad72 introspection: Fix one annotation syntax 2010-09-29 10:38:59 -04:00
Johan Dahlin
30132c44c1 Add a lot of missing annotations 2010-09-24 18:24:41 -03:00
Johan Dahlin
835f9cb310 [introspection] Move over annotations
Move all the annotations over from gobject-introspection.

They will not be used directly by the introspection scanner for now,
instead they will be extracted by a script and updated manually
until introspection is properly integrated into the glib build
2010-09-24 15:52:38 -03:00
Christian Dywan
0927dda8ad Correct error message when GUnixOutputStream fails to write
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=628876
2010-09-24 13:56:35 +02:00
David Zeuthen
4d9ae95ae0 GDBus: Don't use abstract sockets in test code
It doesn't really work right now because of a dbus-daemon(1) bug - see
the comment added in the TODO section of gdbusconnection.c. So revert
to old behavior. The downside is a lot of files in /tmp but right now
that's better than not being able to run tests in a loop.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 19:16:25 -04:00
David Zeuthen
a35eb70471 GDBus: Use abstract namespace in test cases to avoid littering all over /tmp
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 18:57:35 -04:00
David Zeuthen
7036415cc1 GDBusConnection: Use correct GMainContext when invoking free functions
Without this fix, the ./gdbus-connection test case occasionally fails, see

 https://bugzilla.gnome.org/show_bug.cgi?id=629945#c5

like this

 /gdbus/connection/basic: OK
 /gdbus/connection/life-cycle: **
ERROR:gdbus-connection.c:223:test_connection_life_cycle: assertion failed:
(!quit_mainloop_fired)
 cleaning up bus with pid 21794
 Aborted (core dumped)

because the callback didn't happen on the same thread as where we are
running the loop.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 17:36:07 -04:00
David Zeuthen
643e5526c5 GDBus: fix name test cases
Since we make message buses come and go, we need to ensure that the
singleton connection instance goes away before attempting to call
g_bus_get_sync() or similar.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 16:28:59 -04:00
David Zeuthen
71b1d738e2 GDBus: bump timeout for some tests
When under load, a one second timeout is just not enough. This can be
observed by e.g. restarting a CPU- and IO-intensive application like a
web browser with many tabs while running the test cases. Therefore,
bump the timeouts to 30 seconds.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 16:14:42 -04:00
David Zeuthen
1f6a9f1e2d GDBus: Move "slow" connection test cases into separate test program
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 15:49:04 -04:00
David Zeuthen
f0b04acfd3 GDBusConnection: Avoid callbacks on finalized connection
Turns out that GDBusWorker will issue callbacks (in its own thread)
even after g_dbus_worker_stop() has been called. This would rarely
happen (and unreffing a connection is even rarer) so only saw this bug
occasionally when running the gdbus-connection test case in a loop.

Fix up this issue by maintaining a set of GDBusConnection objects that
are currently "alive" and do nothing in the callbacks if the passed
user_data pointer is not in this set.

Also attempted to fix up a race condition with
_g_object_wait_for_single_ref_do() and its use of GObject toggle
references - for now, just resort to busy waiting, thereby
sidestepping the toggle reference mess altogether.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 15:16:56 -04:00
Nicolas Dufresne
e7df1a4157 Fix memory leak in SOCKSv5 implementation 2010-09-23 12:02:51 -04:00
Ryan Lortie
6145321680 GSocketControlMessage: clean up confusing code
It looks like the deserialisation function in GSocketControlMessage can
potentially leak a reference to the class structure of a
GSocketControlMessage subclass (although the particular code path is
probably never hit).

Clean up the code a bit.

Also, make sure that the GUnixCredentialsMessage type is registered
before attempting deserialisation.

Closes bug #629687.
2010-09-22 06:47:34 -04:00
Claude Paroz
86d3342f85 Add translator comments for command parameter translation 2010-09-22 10:42:55 +02:00
Ryan Lortie
b4ee303ed6 .gitignore some test cases 2010-09-17 13:26:50 -04:00
Dan Winship
bff4ac15d0 g_output_stream_write: fix misleadingly ungrammatical documentation
pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=626866
2010-09-17 10:21:57 -04:00
Christian Persch
1220501ec8 GDBusConnection leaks its GCredentials
==7269== 144 bytes in 6 blocks are definitely lost in loss record 1,282 of 1,325
==7269==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==7269==    by 0x4056B74: g_malloc (gmem.c:164)
==7269==    by 0x406EDB6: g_slice_alloc (gslice.c:842)
==7269==    by 0x406EDFB: g_slice_alloc0 (gslice.c:854)
==7269==    by 0x413C627: g_type_create_instance (gtype.c:1867)
==7269==    by 0x412276A: g_object_constructor (gobject.c:1480)
==7269==    by 0x4121E5D: g_object_newv (gobject.c:1264)
==7269==    by 0x4121BD3: g_object_new (gobject.c:1176)
==7269==    by 0x417CFB9: g_credentials_new (gcredentials.c:156)
==7269==    by 0x41D9DBC: g_unix_credentials_message_deserialize (gunixcredentialsmessage.c:149)
==7269==    by 0x41C422C: g_socket_control_message_deserialize (gsocketcontrolmessage.c:198)
==7269==    by 0x41BFCE3: g_socket_receive_message (gsocket.c:3289)
==7269==    by 0x41D99CE: g_unix_connection_receive_credentials (gunixconnection.c:476)
==7269==    by 0x41FA829: _g_dbus_auth_run_server (gdbusauth.c:987)
==7269==    by 0x4205DDB: initable_init (gdbusconnection.c:2196)

Bug #629689.
2010-09-14 22:22:35 +02:00
Ryan Lortie
f497f3b7ae GSettings: reverse accidental addition to .h file
A couple of extra function prototypes snuck into commit
77e3badcf3.  Take those out.
2010-09-14 11:25:57 -04:00
Ryan Lortie
2e78d07f86 Add g_data_input_stream_read_upto{,async,finish}
These functions are meant to replace the read_until() flavour, with the
following improvements:

  - consistency between the synchronous and asynchronous versions as to
    if the separator character is read (it never is).

  - support for using a nul byte as a separator character by way of
    addition of a length parameter which allows stop_chars to be treated
    as a byte array rather than a nul-terminated string.

The read_until() functions are not yet formally deprecated, but a note
has been added to the documentation warning not to use them as they will
be in the future.

This is bug #584284.
2010-09-13 13:14:25 -04:00
Ryan Lortie
681a72ea99 GSettings: no writability->value change assumption
GSettings internally assumed that a change in key writability implied a
change in value.  That may be true for some backends.  Let those
backends deal with the situation for themselves.
2010-09-12 13:37:04 -04:00
Tor Lillqvist
8a8cdd1d32 Add some more individual own header includes where required 2010-09-12 14:05:49 +03:00
Benjamin Otte
1254104cea docs: Clarify string encoding for GFile constructors
The encoding was deduced from looking at the source code, feel free to
fix if it's wrong (the docs _and_ the source code).
2010-09-11 00:13:36 +02:00
David Zeuthen
0b74058fa3 Add work-around for Bug 627724
The root problem is with GObject - for now, just work around it in
GDBus. Also include a test-case. See

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

for more information.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-10 16:23:14 -04:00
David Zeuthen
12029eeb6a Remove g_dbus_message_filter_result_get_type() from gio.symbols
Pointed out by danw on IRC.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-10 13:27:48 -04:00
Dan Winship
bc29aa9b09 g_socket_client_connect_async: fix when g_socket_connect succeeds immediately
https://bugzilla.gnome.org/show_bug.cgi?id=629251
2010-09-10 13:07:00 -04:00
Dan Winship
59383c8bea Fix IPv6 parsing in _g_uri_parse_authority, add _g_uri_from_authority
Fixes connections to IPv6 address literals.

https://bugzilla.gnome.org/show_bug.cgi?id=629259
2010-09-10 13:07:00 -04:00
Ryan Lortie
f8cb2a60b9 Add 3 new restrictions to the schema compiler
- can not extend schemas that already have paths
 - can not form list of schemas that already have paths
 - the path of a list schema, if given, must end with ':/'
2010-09-09 16:43:03 -04:00
Ryan Lortie
7777dd2c39 Rename gschema-compile.c -> glib-compile-schemas.c 2010-09-09 16:42:55 -04:00
Ryan Lortie
77e3badcf3 split GSettings.list_items => list_{children,keys}
This is an incompatible public API/ABI change.
2010-09-09 16:42:55 -04:00
Ryan Lortie
7b4cbbb7b2 Create GSettingsListenerVTable
...instead of passing a whole whack of function pointers around

This is an internal API.
2010-09-09 16:42:55 -04:00
David Zeuthen
7c66068544 GDBusMessage: Don't reset serial number when copying
Ryan pointed out that it's safe to do this because we have the
G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag and that it simplifies
how filter functions work.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 15:15:13 -04:00
David Zeuthen
a51df8cefb GUnixConnection: Remove comment about Linux
Since the previous commit, the g_unix_connection_send_credentials() /
g_unix_connection_receive_credentials() functions now also works on
FreeBSD since GUnixCredentialsMessage now works there.

The main idea is that the g_unix_connection_send_credentials() /
g_unix_connection_receive_credentials() functions are the "main" API
for getting credentials (one way or the other). So it's better to
avoid advertising where it is currently implemented.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 14:17:52 -04:00
Joe Marcus Clarke
964eb62343 Bug 628904 – Add credential support for FreeBSD and fix a socket issue
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 14:10:01 -04:00
David Zeuthen
ee945d8f62 GDBusServer: Make ::new-connection return whether the connection was claimed
Otherwise things probably won't work in a garbage-collected world
(consider the trivial GC that never collects garbage).

This commit breaks GDBusServer ABI. No known released software is
using this code.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 14:02:31 -04:00
David Zeuthen
c3371efcaa Bug 624546 – Modification of GDBusMessage in filter function
Rework filter functions as per

 https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8

This commit breaks ABI. However, this ABI break affects only
applications using filter functions. The only known user of is dconf.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 13:21:35 -04:00
David Zeuthen
67a00658ea GDBusMessage: Make it possible to lock and copy messages
Don't actually use this yet as that will require a couple of
modifications to the filter function signature. This is part of the
bug-fix for

 https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 12:00:32 -04:00
Emmanuele Bassi
19972a1b57 build: Quench the compiler's thirst for warnings 2010-09-04 18:24:50 +01:00
Matthias Clasen
4e5532ec51 Sort extensions properly
Just taking the difference of the priorities has overflow issues,
as pointed out in bug 623069.
2010-09-03 19:03:34 -04:00
Christian Persch
db4fb1b115 Plug a mem leak in the gdbus-proxy test
==23341== 65 bytes in 3 blocks are definitely lost in loss record 927 of 1,020
==23341==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==23341==    by 0x4057094: g_malloc (gmem.c:134)
==23341==    by 0x40573DB: g_malloc_n (gmem.c:281)
==23341==    by 0x40717FC: g_strdup (gstrfuncs.c:101)
==23341==    by 0x4147F56: value_lcopy_string (gvaluetypes.c:313)
==23341==    by 0x4123F0B: g_object_get_valist (gobject.c:1643)
==23341==    by 0x41240FF: g_object_get (gobject.c:1731)
==23341==    by 0x804C39E: test_basic (gdbus-proxy.c:522)

Bug #628331.
2010-09-03 16:05:28 -04:00
Christian Persch
5de1bf4a91 Plug a mem leak in the gdbus-proxy test
==23341== 85 (24 direct, 61 indirect) bytes in 1 blocks are definitely lost in loss record 900 of 971
==23341==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==23341==    by 0x4057094: g_malloc (gmem.c:134)
==23341==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==23341==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==23341==    by 0x403A751: g_error_new_valist (gerror.c:54)
==23341==    by 0x403AAD4: g_set_error (gerror.c:240)
==23341==    by 0x420B807: decode_method_reply (gdbusconnection.c:4774)
==23341==    by 0x420C2BA: g_dbus_connection_call_sync (gdbusconnection.c:5188)
==23341==    by 0x421B7C9: g_dbus_proxy_call_sync (gdbusproxy.c:2477)
==23341==    by 0x804BD89: test_bogus_method_return (gdbus-proxy.c:430)

Bug #628331.
2010-09-03 16:04:29 -04:00
Christian Persch
be33ef85d0 Plug some mem leaks in gdbus-peer test
==29535== 56 (24 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 1,112 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804D63A: test_nonce_tcp (gdbus-peer.c:1229)

==29535== 107 (24 direct, 83 indirect) bytes in 1 blocks are definitely lost in loss record 1,188 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804D8E8: test_nonce_tcp (gdbus-peer.c:1259)

==29535== 112 (24 direct, 88 indirect) bytes in 1 blocks are definitely lost in loss record 1,193 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804D79A: test_nonce_tcp (gdbus-peer.c:1248)

==29535== 73 (24 direct, 49 indirect) bytes in 1 blocks are definitely lost in loss record 1,152 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804C6CE: test_peer (gdbus-peer.c:803)

Bug #628331.
2010-09-03 16:03:48 -04:00
Christian Persch
3df5866139 Plug a mem leak in the gdbus-peer test
==6793== 32 (24 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 779 of 1,423
==6793==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==6793==    by 0x4057094: g_malloc (gmem.c:134)
==6793==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==6793==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==6793==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==6793==    by 0x412372A: g_object_constructor (gobject.c:1482)
==6793==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==6793==    by 0x4122B93: g_object_new (gobject.c:1178)
==6793==    by 0x41DB4F9: g_unix_fd_list_new (gunixfdlist.c:159)
==6793==    by 0x804AADD: test_interface_method_call (gdbus-peer.c:172)

Bug #628331.
2010-09-03 16:02:11 -04:00
Christian Persch
bd2faedefd Plug a mem leak in network-address test
==4616== 46 (32 direct, 14 indirect) bytes in 1 blocks are definitely lost in loss record 193 of 305
==4616==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==4616==    by 0x4057094: g_malloc (gmem.c:134)
==4616==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==4616==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==4616==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==4616==    by 0x412372A: g_object_constructor (gobject.c:1482)
==4616==    by 0x4123147: g_object_newv (gobject.c:1347)
==4616==    by 0x41236BB: g_object_new_valist (gobject.c:1463)
==4616==    by 0x4122BB4: g_object_new (gobject.c:1181)
==4616==    by 0x41B2D0F: g_network_address_new (gnetworkaddress.c:262)
==4616==    by 0x8048A70: test_basic (network-address.c:10)

Bug #628331.
2010-09-03 16:01:10 -04:00
Christian Persch
fa6937603c Plug a mem leak in contexts test
==14059== 96 bytes in 2 blocks are definitely lost in loss record 520 of 543
==14059==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==14059==    by 0x4057094: g_malloc (gmem.c:134)
==14059==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==14059==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==14059==    by 0x41385BB: g_type_create_instance (gtype.c:1867)
==14059==    by 0x411E72A: g_object_constructor (gobject.c:1482)
==14059==    by 0x411DE1D: g_object_newv (gobject.c:1266)
==14059==    by 0x411DB93: g_object_new (gobject.c:1178)
==14059==    by 0x42296AF: _g_local_file_input_stream_new (glocalfileinputstream.c:152)
==14059==    by 0x422281F: g_local_file_read (glocalfile.c:1322)
==14059==    by 0x418A8A9: open_read_async_thread (gfile.c:5050)
==14059==    by 0x41B71BB: run_in_thread (gsimpleasyncresult.c:853)
==14059==    by 0x41A5FBC: io_job_thread (gioscheduler.c:181)
==14059==    by 0x407DCDE: g_thread_pool_thread_proxy (gthreadpool.c:314)
==14059==    by 0x407C6B0: g_thread_create_proxy (gthread.c:1897)
==14059==    by 0x57D918: start_thread (pthread_create.c:301)
==14059==    by 0x4C6CBD: clone (clone.S:133)

Bug #628331.
2010-09-03 16:00:15 -04:00
Christian Persch
60349ecc4d Plug mem leaks in contexts test
==2464== 80 (16 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 515 of 547
==2464==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2464==    by 0x4057094: g_malloc (gmem.c:134)
==2464==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2464==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2464==    by 0x41385BB: g_type_create_instance (gtype.c:1867)
==2464==    by 0x411E72A: g_object_constructor (gobject.c:1482)
==2464==    by 0x411DE1D: g_object_newv (gobject.c:1266)
==2464==    by 0x411DB93: g_object_new (gobject.c:1178)
==2464==    by 0x4220D74: _g_local_file_new (glocalfile.c:310)
==2464==    by 0x422C897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2464==    by 0x41CA91C: g_vfs_get_file_for_path (gvfs.c:94)
==2464==    by 0x418C1B6: g_file_new_for_path (gfile.c:5898)
==2464==    by 0x8049509: test1_thread (contexts.c:110)

==2464== 80 (16 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 516 of 547
==2464==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2464==    by 0x4057094: g_malloc (gmem.c:134)
==2464==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2464==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2464==    by 0x41385BB: g_type_create_instance (gtype.c:1867)
==2464==    by 0x411E72A: g_object_constructor (gobject.c:1482)
==2464==    by 0x411DE1D: g_object_newv (gobject.c:1266)
==2464==    by 0x411DB93: g_object_new (gobject.c:1178)
==2464==    by 0x4220D74: _g_local_file_new (glocalfile.c:310)
==2464==    by 0x422C897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2464==    by 0x41CA91C: g_vfs_get_file_for_path (gvfs.c:94)
==2464==    by 0x418C1B6: g_file_new_for_path (gfile.c:5898)
==2464==    by 0x804964D: test_context_independence (contexts.c:144)

Bug #628331.
2010-09-03 15:58:51 -04:00
Christian Persch
e4a6b1dcdc Plug a mem leak in buffered-input-stream test
==2429== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 276 of 355
==2429==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2429==    by 0x4057094: g_malloc (gmem.c:134)
==2429==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2429==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2429==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2429==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2429==    by 0x4175525: g_buffered_input_stream_read_byte (gbufferedinputstream.c:880)
==2429==    by 0x804A21A: test_read_byte (buffered-input-stream.c:153)

Bug #628331.
2010-09-03 15:57:26 -04:00
Christian Persch
01a19dee68 Plug a mem leak in g-icon test
==2428== 256 bytes in 1 blocks are definitely lost in loss record 591 of 604
==2428==    at 0x4005CD2: realloc (vg_replace_malloc.c:476)
==2428==    by 0x40571A5: g_realloc (gmem.c:181)
==2428==    by 0x4075287: g_string_maybe_expand (gstring.c:395)
==2428==    by 0x40760D8: g_string_insert_c (gstring.c:1049)
==2428==    by 0x4074D41: g_string_append_c_inline (gstring.h:153)
==2428==    by 0x4075B3C: g_string_append_uri_escaped (gstring.c:822)
==2428==    by 0x41A46AC: g_icon_to_string_tokenized (gicon.c:164)
==2428==    by 0x41A498F: g_icon_to_string (gicon.c:252)
==2428==    by 0x8049E1A: test_g_icon_serialize (g-icon.c:222)

Bug #628331.
2010-09-03 15:56:23 -04:00
Christian Persch
e8bdd2cb7a Plug a huge mem leak in data-output-stream test
==12763== 16,777,215 bytes in 1 blocks are possibly lost in loss record 357 of 357
==12763==    at 0x4004F1B: calloc (vg_replace_malloc.c:418)
==12763==    by 0x405711D: g_malloc0 (gmem.c:157)
==12763==    by 0x8048ED6: test_basic (data-output-stream.c:40)

Bug #628331.
2010-09-03 15:55:10 -04:00
Christian Persch
05d6fcf88c Plug a mem leak in data-output-stream test
==2426== 45,034 bytes in 4,094 blocks are definitely lost in loss record 358 of 361
==2426==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2426==    by 0x4057094: g_malloc (gmem.c:134)
==2426==    by 0x40573DB: g_malloc_n (gmem.c:281)
==2426==    by 0x4071ABD: g_strconcat (gstrfuncs.c:315)
==2426==    by 0x804916A: test_read_lines (data-output-stream.c:83)

Bug #628331.
2010-09-03 15:53:56 -04:00
Christian Persch
45331a4640 Plug a mem leak in data-input-stream test
==12351== 45,045 bytes in 4,095 blocks are definitely lost in loss record 377 of 380
==12351==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==12351==    by 0x4057094: g_malloc (gmem.c:134)
==12351==    by 0x40573DB: g_malloc_n (gmem.c:281)
==12351==    by 0x4071ABD: g_strconcat (gstrfuncs.c:315)
==12351==    by 0x8049811: test_read_lines (data-input-stream.c:99)

Bug #628331.
2010-09-03 15:53:05 -04:00
Christian Persch
36c7d95c9c Plug a mem leak in data-input-stream test
==2415== 45,045 bytes in 4,095 blocks are definitely lost in loss record 393 of 399
==2415==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2415==    by 0x4057094: g_malloc (gmem.c:134)
==2415==    by 0x417FC29: g_data_input_stream_read_line (gdatainputstream.c:797)
==2415==    by 0x8049874: test_read_lines (data-input-stream.c:111)

==12088== 360 bytes in 40 blocks are definitely lost in loss record 368 of 381
==12088==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==12088==    by 0x4057094: g_malloc (gmem.c:134)
==12088==    by 0x417FF4C: g_data_input_stream_read_until (gdatainputstream.c:914)
==12088==    by 0x8049B6F: test_read_until (data-input-stream.c:182)

Bug #628331.
2010-09-03 15:47:38 -04:00
Christian Persch
91e3803596 Plug a mem leak in data-input-stream test
==2415== 165 (72 direct, 93 indirect) bytes in 3 blocks are definitely lost in loss record 373 of 399
==2415==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2415==    by 0x4057094: g_malloc (gmem.c:134)
==2415==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2415==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2415==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2415==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2415==    by 0x417ED29: read_data (gdatainputstream.c:309)
==2415==    by 0x417EE9D: g_data_input_stream_read_byte (gdatainputstream.c:344)
==2415==    by 0x8049DEC: test_data_array (data-input-stream.c:263)

Bug #628331.
2010-09-03 15:45:48 -04:00
Christian Persch
31b15451cf Plug a mem leak in readwrite test
==10395== 80 (24 direct, 56 indirect) bytes in 1 blocks are definitely lost in loss record 529 of 561
==10395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==10395==    by 0x4057094: g_malloc (gmem.c:134)
==10395==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==10395==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==10395==    by 0x403A751: g_error_new_valist (gerror.c:54)
==10395==    by 0x403AAD4: g_set_error (gerror.c:240)
==10395==    by 0x4230328: _g_local_file_output_stream_create (glocalfileoutputstream.c:628)
==10395==    by 0x4227A04: g_local_file_create_readwrite (glocalfile.c:1388)
==10395==    by 0x418974C: g_file_create_readwrite (gfile.c:1784)
==10395==    by 0x8049FCD: test_g_file_create_readwrite (readwrite.c:187)

Bug #628331.
2010-09-03 15:44:28 -04:00
Christian Persch
94102a40f7 Plug some huge mem leaks in converter-stream test
==8564== 24,000,000 bytes in 6 blocks are possibly lost in loss record 592 of 594
==8564==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==8564==    by 0x4057094: g_malloc (gmem.c:134)
==8564==    by 0x804AA37: test_corruption (converter-stream.c:589)
==8564==    by 0x804B05B: test_roundtrip (converter-stream.c:652)

==9459== 25,165,824 bytes in 6 blocks are possibly lost in loss record 593 of 594
==9459==    at 0x4005CD2: realloc (vg_replace_malloc.c:476)
==9459==    by 0x40571A5: g_realloc (gmem.c:181)
==9459==    by 0x41B08A3: array_resize (gmemoryoutputstream.c:501)
==9459==    by 0x41B0A5D: g_memory_output_stream_write (gmemoryoutputstream.c:578)
==9459==    by 0x41B57EF: g_output_stream_write (goutputstream.c:216)
==9459==    by 0x41B591B: g_output_stream_write_all (goutputstream.c:268)
==9459==    by 0x417D617: flush_buffer (gconverteroutputstream.c:359)
==9459==    by 0x417D958: g_converter_output_stream_write (gconverteroutputstream.c:502)
==9459==    by 0x41B5D7F: g_output_stream_real_splice (goutputstream.c:428)
==9459==    by 0x41B5C6C: g_output_stream_splice (goutputstream.c:380)
==9459==    by 0x804AB10: test_corruption (converter-stream.c:600)

==9785== 25,165,824 bytes in 6 blocks are possibly lost in loss record 592 of 592
==9785==    at 0x4005CD2: realloc (vg_replace_malloc.c:476)
==9785==    by 0x40571A5: g_realloc (gmem.c:181)
==9785==    by 0x41B08A3: array_resize (gmemoryoutputstream.c:501)
==9785==    by 0x41B0A5D: g_memory_output_stream_write (gmemoryoutputstream.c:578)
==9785==    by 0x41B5D7F: g_output_stream_real_splice (goutputstream.c:428)
==9785==    by 0x41B5C6C: g_output_stream_splice (goutputstream.c:380)
==9785==    by 0x804ADF1: test_corruption (converter-stream.c:622)
==9785==    by 0x804B06C: test_roundtrip (converter-stream.c:652)

Bug #628331.
2010-09-03 15:43:03 -04:00
Christian Persch
24bee1a130 Plug a mem leak in convert-stream test
==7540== 487 (64 direct, 423 indirect) bytes in 2 blocks are definitely lost in loss record 597 of 615
==7540==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==7540==    by 0x4057094: g_malloc (gmem.c:134)
==7540==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==7540==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==7540==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==7540==    by 0x412372A: g_object_constructor (gobject.c:1482)
==7540==    by 0x4123147: g_object_newv (gobject.c:1347)
==7540==    by 0x41236BB: g_object_new_valist (gobject.c:1463)
==7540==    by 0x41A756E: g_initable_new_valist (ginitable.c:214)
==7540==    by 0x41A743E: g_initable_new (ginitable.c:138)
==7540==    by 0x417B67A: g_charset_converter_new (gcharsetconverter.c:215)
==7540==    by 0x804B043: test_charset (converter-stream.c:675)

Bug #628331.
2010-09-03 15:40:55 -04:00
Christian Persch
ac8600a14b Plug a mem leak in converter-stream test
==2396== 168 (92 direct, 76 indirect) bytes in 1 blocks are definitely lost in loss record 598 of 625
==2396==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2396==    by 0x4057094: g_malloc (gmem.c:134)
==2396==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2396==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2396==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2396==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2396==    by 0x4123147: g_object_newv (gobject.c:1347)
==2396==    by 0x41236BB: g_object_new_valist (gobject.c:1463)
==2396==    by 0x4122BB4: g_object_new (gobject.c:1181)
==2396==    by 0x417C54D: g_converter_input_stream_new (gconverterinputstream.c:204)
==2396==    by 0x804A53E: test_compressor (converter-stream.c:484)

Bug #628331.
2010-09-03 15:39:58 -04:00
Christian Persch
85179745ac Plug a mem leak in converter-stream test
==2396== 66 (24 direct, 42 indirect) bytes in 1 blocks are definitely lost in loss record 565 of 625
==2396==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2396==    by 0x4057094: g_malloc (gmem.c:134)
==2396==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2396==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2396==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2396==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2396==    by 0x417BA38: g_charset_converter_convert (gcharsetconverter.c:344)
==2396==    by 0x417BF67: g_converter_convert (gconverter.c:174)
==2396==    by 0x417C9EB: g_converter_input_stream_read (gconverterinputstream.c:403)
==2396==    by 0x41A7A17: g_input_stream_read (ginputstream.c:204)
==2396==    by 0x41A7B43: g_input_stream_read_all (ginputstream.c:256)
==2396==    by 0x804B0E4: test_charset (converter-stream.c:682)

Bug #628331.
2010-09-03 15:39:07 -04:00
Christian Persch
7ec414229b Plug a mem leak in converter-stream test
==2396== 39 (24 direct, 15 indirect) bytes in 1 blocks are definitely lost in loss record 398 of 625
==2396==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2396==    by 0x4057094: g_malloc (gmem.c:134)
==2396==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2396==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2396==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2396==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2396==    by 0x80498F7: g_compressor_converter_convert (converter-stream.c:244)
==2396==    by 0x417BF67: g_converter_convert (gconverter.c:174)
==2396==    by 0x417CBDE: g_converter_input_stream_read (gconverterinputstream.c:460)
==2396==    by 0x41A7A17: g_input_stream_read (ginputstream.c:204)
==2396==    by 0x804A832: test_compressor (converter-stream.c:545)

Bug #628331.
2010-09-03 15:37:56 -04:00
Christian Persch
d5d277dccf Plug a mem leak in g-file-info test
==2395== 64 bytes in 1 blocks are definitely lost in loss record 381 of 407
==2395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2395==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
==2395==    by 0x40571A5: g_realloc (gmem.c:181)
==2395==    by 0x401D670: g_ptr_array_maybe_expand (garray.c:968)
==2395==    by 0x401DD0B: g_ptr_array_add (garray.c:1225)
==2395==    by 0x4199AA9: g_file_info_list_attributes (gfileinfo.c:646)
==2395==    by 0x80491CE: test_g_file_info (g-file-info.c:76)

==2395== 132 (64 direct, 68 indirect) bytes in 1 blocks are definitely lost in loss record 396 of 407
==2395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2395==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
==2395==    by 0x40571A5: g_realloc (gmem.c:181)
==2395==    by 0x401D670: g_ptr_array_maybe_expand (garray.c:968)
==2395==    by 0x401DD0B: g_ptr_array_add (garray.c:1225)
==2395==    by 0x4199A82: g_file_info_list_attributes (gfileinfo.c:642)
==2395==    by 0x80492B7: test_g_file_info (g-file-info.c:86)

Bug #628331.
2010-09-03 15:37:08 -04:00
Christian Persch
35e101fa0a Plug a mem leak in the readwrite test
And use g_assert_[no_]error().

==2392== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 451 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2392==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2392==    by 0x41B7619: g_output_stream_set_pending (goutputstream.c:1198)
==2392==    by 0x41B5799: g_output_stream_write (goutputstream.c:210)
==2392==    by 0x41B590B: g_output_stream_write_all (goutputstream.c:268)
==2392==    by 0x8049B54: verify_iostream (readwrite.c:110)

Bug #628331.
2010-09-03 15:35:44 -04:00
Christian Persch
93d85ade57 Plug a mem leak in the readwrite test
==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely lost in loss record 369 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2392==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2392==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2392==    by 0x4122B93: g_object_new (gobject.c:1178)
==2392==    by 0x4225D74: _g_local_file_new (glocalfile.c:310)
==2392==    by 0x4231897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2392==    by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94)
==2392==    by 0x41911B6: g_file_new_for_path (gfile.c:5898)
==2392==    by 0x804A2B9: test_g_file_replace_readwrite (readwrite.c:235)

Bug #628331.
2010-09-03 15:34:12 -04:00
Christian Persch
9fba7a43be Plug a mem leak in the readwrite test
==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely lost in loss record 368 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2392==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2392==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2392==    by 0x4122B93: g_object_new (gobject.c:1178)
==2392==    by 0x4225D74: _g_local_file_new (glocalfile.c:310)
==2392==    by 0x4231897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2392==    by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94)
==2392==    by 0x41911B6: g_file_new_for_path (gfile.c:5898)
==2392==    by 0x8049F23: test_g_file_create_readwrite (readwrite.c:183)

Bug #628331.
2010-09-03 15:33:28 -04:00
Christian Persch
e481bf8bf6 Plug a mem leak in the readwrite test
==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely lost in loss record 367 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2392==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2392==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2392==    by 0x4122B93: g_object_new (gobject.c:1178)
==2392==    by 0x4225D74: _g_local_file_new (glocalfile.c:310)
==2392==    by 0x4231897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2392==    by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94)
==2392==    by 0x41911B6: g_file_new_for_path (gfile.c:5898)
==2392==    by 0x8049E30: test_g_file_open_readwrite (readwrite.c:153)

Bug #628331.
2010-09-03 15:32:32 -04:00
Christian Persch
689b054b6e Plug a mem leak in the memory-input-stream test
==2389== 84 (44 direct, 40 indirect) bytes in 1 blocks are definitely lost in loss record 299 of 315
==2389==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2389==    by 0x4057094: g_malloc (gmem.c:134)
==2389==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2389==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2389==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2389==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2389==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2389==    by 0x4122B93: g_object_new (gobject.c:1178)
==2389==    by 0x41AF54C: g_memory_input_stream_new (gmemoryinputstream.c:199)
==2389==    by 0x8048BD1: test_read_chunks (memory-input-stream.c:40)

Bug #628331.
2010-09-03 15:31:37 -04:00
Christian Persch
53ae72b926 Plug a mem leak in the memory-input-stream test
==2389== 59 (24 direct, 35 indirect) bytes in 1 blocks are definitely lost in loss record 290 of 315
==2389==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2389==    by 0x4057094: g_malloc (gmem.c:134)
==2389==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2389==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2389==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2389==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2389==    by 0x41AFD15: g_memory_input_stream_truncate (gmemoryinputstream.c:517)
==2389==    by 0x41BAC0F: g_seekable_truncate (gseekable.c:174)
==2389==    by 0x8049595: test_truncate (memory-input-stream.c:123)

Bug #628331.
2010-09-03 15:30:47 -04:00
Christian Persch
6320b04fe9 Plug a mem leak in gsettings test
==2530== 13 bytes in 1 blocks are definitely lost in loss record 373 of 681
==2530==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2530==    by 0x4057094: g_malloc (gmem.c:134)
==2530==    by 0x40573DB: g_malloc_n (gmem.c:281)
==2530==    by 0x40717FC: g_strdup (gstrfuncs.c:101)
==2530==    by 0x4147F56: value_lcopy_string (gvaluetypes.c:313)
==2530==    by 0x4123F0B: g_object_get_valist (gobject.c:1643)
==2530==    by 0x41240FF: g_object_get (gobject.c:1731)
==2530==    by 0x804A4BA: test_basic (gsettings.c:28)

Bug #628331.
2010-09-03 15:29:51 -04:00
Christian Persch
e8fc3ba3d0 Plug a mem leak
Don't leak the ptr arrays in the map_sender_unique_name_to_signal_data_array
hash table.

==23440== 84 (20 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 920 of 993
==23440==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==23440==    by 0x4057094: g_malloc (gmem.c:134)
==23440==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==23440==    by 0x401D2D0: g_ptr_array_sized_new (garray.c:799)
==23440==    by 0x401D2AC: g_ptr_array_new (garray.c:783)
==23440==    by 0x420834A: g_dbus_connection_signal_subscribe (gdbusconnection.c:3084)

Bug #628436.
2010-09-03 15:19:22 -04:00
Christian Persch
8795f52aae Plug a mem leak
==31063== 98 (24 direct, 74 indirect) bytes in 1 blocks are definitely lost in loss record 946 of 1,136
==31063==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==31063==    by 0x4057094: g_malloc (gmem.c:134)
==31063==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==31063==    by 0x4092383: g_variant_get_child_value (gvariant-core.c:847)
==31063==    by 0x408BE9E: g_variant_get_variant (gvariant.c:709)
==31063==    by 0x40903F5: g_variant_valist_get_nnp (gvariant.c:3767)
==31063==    by 0x40907A9: g_variant_valist_get_leaf (gvariant.c:3884)
==31063==    by 0x4090D10: g_variant_valist_get (gvariant.c:4065)
==31063==    by 0x4090E59: g_variant_valist_get (gvariant.c:4100)
==31063==    by 0x40911B6: g_variant_get_va (gvariant.c:4296)
==31063==    by 0x40910BC: g_variant_get (gvariant.c:4248)
==31063==    by 0x4208DAF: invoke_set_property_in_idle_cb (gdbusconnection.c:3676)

Bug #628346.
2010-09-03 15:16:47 -04:00
Christian Persch
1f49f3fa34 Plug a mem leak
... and use g_error_matches().

==29535== 1,360 (408 direct, 952 indirect) bytes in 17 blocks are definitely lost in loss record 1,252 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==29535==    by 0x403A751: g_error_new_valist (gerror.c:54)
==29535==    by 0x403AAD4: g_set_error (gerror.c:240)
==29535==    by 0x41C06C8: g_socket_send_message (gsocket.c:2967)
==29535==    by 0x421CB64: write_message_continue_writing (gdbusprivate.c:958)
==29535==    by 0x421CE2A: write_message_async (gdbusprivate.c:1049)
==29535==    by 0x421D4DD: maybe_write_next_message (gdbusprivate.c:1291)
==29535==    by 0x421D26B: message_written (gdbusprivate.c:1187)
==29535==    by 0x421D322: write_message_cb (gdbusprivate.c:1216)

Bug #628345.
2010-09-03 15:03:24 -04:00
Tor Lillqvist
6ddef375c8 Recuce DLL hijack risk on Windows
Don't call LoadLibrary() on shell32.dll or kernel32.dll. kernel32.dll
is always loaded. Shell32.dll is also already loaded as glib links to
functions in it. So just call GetModuleHandle() on them.

For mlang.dll in win_iconv.c and winhttp.dll in gwinhttpvfs.c, always
try loading them from a complete path, from the Windows system
directory.

Use the "tool help" API to enumerate modules in gmodule-win32.c. It is
present in all Windows versions since Windows 2000, which is all we
support anyway. Thus no need to look that API up dynamically. Just
link to it normally. We can bin the fallback code that attempts to use
the psapi API.
2010-09-02 22:36:47 +03:00
Christian Persch
db0eaa299c Fix building with zlib < 1.2.4 on win32
The gzip header processing functions were only exported
since 1.2.4 on win32, so #ifdef this code accordingly.

Bug #628505.
2010-09-01 15:09:51 +02:00
Ryan Lortie
ed72dcdd45 Fix small bug in registry backend
'n' and 'q' types had their signed/unsigned meaning inverted.
2010-09-01 15:05:42 +02:00
Sam Thursfield
3209024c3b Add GSettings Windows Registry backend 2010-09-01 15:05:42 +02:00
Matthias Clasen
31a72dd719 Update symbol list 2010-08-30 19:31:45 -04:00
David Zeuthen
f4f45e980b GDBusProxy: remove superfluous -gdbus-proxy-method-name qdata
Looks like we're not using this anymore.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-30 13:58:41 -04:00
David Zeuthen
52348e1587 Bug 628324 – Invalid reads in gdbus-export test
Looks like we forgot to ref the returned GVariant in
g_dbus_proxy_call_finish().

It's a good question why code using g_dbus_proxy_call() and
g_dbus_proxy_call_finish() worked in the first place - probably the
answer is that no-one really used these APIs.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-30 13:51:43 -04:00
Ryan Lortie
846b0b3466 GAction is now an interface
the new class GSimpleAction is the implementation half
2010-08-30 19:26:37 +02:00
Ryan Lortie
6cd62920bb GActionGroup is now an interface
- make GAction.get_state() return a reference
 - fix some leaks/warnings in the tests
 - fix signal propagation in GSimpleActionGroup
2010-08-30 19:26:37 +02:00
Christian Persch
9493925854 Make g_emblemed_icon_add_emblem() keep the list sorted
Fixes bug #628317.
2010-08-30 18:34:14 +02:00
Christian Persch
7a6f8bd3c3 Don't leak the FD list
==6793== 32 (24 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 780 of 1,423
==6793==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==6793==    by 0x4057094: g_malloc (gmem.c:134)
==6793==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==6793==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==6793==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==6793==    by 0x412372A: g_object_constructor (gobject.c:1482)
==6793==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==6793==    by 0x4122B93: g_object_new (gobject.c:1178)
==6793==    by 0x41DB582: g_unix_fd_list_new_from_array (gunixfdlist.c:191)
==6793==    by 0x421BFD6: _g_dbus_worker_do_read_cb (gdbusprivate.c:590)

Bug #628329.
2010-08-30 18:33:47 +02:00
Christian Persch
fa671dc5e2 Fix invalid reads
Don't use a guint16* when getting a guint property via g_object_get()!

Bug #628323.
2010-08-30 10:21:43 -04:00
Christian Persch
08924ad147 Plug a mem leak in GConverterOutputStream
==8221== 1,047 (672 direct, 375 indirect) bytes in 28 blocks are definitely lost in loss record 589 of 603
==8221==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==8221==    by 0x4057094: g_malloc (gmem.c:134)
==8221==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==8221==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==8221==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==8221==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==8221==    by 0x80499DC: g_compressor_converter_convert (converter-stream.c:267)
==8221==    by 0x417BF67: g_converter_convert (gconverter.c:174)
==8221==    by 0x417D7F0: g_converter_output_stream_write (gconverteroutputstream.c:428)
==8221==    by 0x41B57DF: g_output_stream_write (goutputstream.c:216)
==8221==    by 0x804A367: test_compressor (converter-stream.c:456)

Bug #628309.
2010-08-30 10:18:30 -04:00
Christian Persch
802c25832c Plug a mem leak
==6793== 19 (8 direct, 11 indirect) bytes in 1 blocks are definitely lost in loss record 640 of 1,423
==6793==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==6793==    by 0x4057094: g_malloc (gmem.c:134)
==6793==    by 0x40573DB: g_malloc_n (gmem.c:281)
==6793==    by 0x4073D1B: g_strsplit (gstrfuncs.c:2436)
==6793==    by 0x4224A89: initable_init (gdbusserver.c:1040)
==6793==    by 0x41A73F9: g_initable_init (ginitable.c:105)
==6793==    by 0x41A759B: g_initable_new_valist (ginitable.c:218)
==6793==    by 0x41A743E: g_initable_new (ginitable.c:138)
==6793==    by 0x42238F5: g_dbus_server_new_sync (gdbusserver.c:484)

Bug #628328.
2010-08-30 10:16:31 -04:00
Christian Persch
6879256f36 Plug a mem leak
==6793== 16 bytes in 1 blocks are definitely lost in loss record 632 of 1,423
==6793==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==6793==    by 0x4057094: g_malloc (gmem.c:134)
==6793==    by 0x417FC29: g_data_input_stream_read_line (gdatainputstream.c:797)
==6793==    by 0x41F99C1: _my_g_data_input_stream_read_line (gdbusauth.c:279)
==6793==    by 0x41FA728: _g_dbus_auth_run_client (gdbusauth.c:759)

Bug #628327.
2010-08-30 10:14:39 -04:00
Matthias Clasen
bb221b68df Add an annotation 2010-08-30 10:02:32 -04:00
Dan Winship
a3cc274fc6 GSocketClient: fix a crash on cancellation
some code rearrangement when adding proxy support resulted in trying to
use a GSocket that wasn't there.

https://bugzilla.gnome.org/show_bug.cgi?id=628296
2010-08-30 09:31:47 -04:00
Matthias Clasen
b8ff287167 Disable the 'extra data' test for now 2010-08-30 08:58:31 -04:00
Matthias Clasen
b4a61235da Introspection: make 'direction' default to 'in' for methods 2010-08-30 08:50:09 -04:00
Matthias Clasen
c3135d1d39 Add some more gdbus introspection tests (currently failing) 2010-08-30 08:49:41 -04:00
Philip Withnall
1399913f31 Change "type-string" to "type string" in translatable strings
Helps: bgo#628193
2010-08-29 00:38:18 +01:00
Philip Withnall
ea9f5f0251 Change "lock-file" to "lock file" in translatable strings
Helps: bgo#628193
2010-08-29 00:38:06 +01:00
David Zeuthen
1e7243ad7b Bug 628084 – gdbus-peer fails with assertion
Make it work on systems where /etc/hosts is bigger than 1024 bytes.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-27 10:50:03 -04:00
David Zeuthen
0d0a9bb448 GDBusConnection: Document memory management semantics for get_property()
Turns out we are leaking non-floating GVariant instances returned by
get_property() functions.

Also avoid imprecise language such as "newly-allocated GVariant" as
this doesn't specify whether the variant can be floating or not.

Also see https://bugzilla.gnome.org/show_bug.cgi?id=627974 as it is
very related to this change.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-25 14:49:05 -04:00
Tor Lillqvist
6c24062880 Include gproxyaddress.h explicitly 2010-08-23 14:31:20 +03:00
Matthias Clasen
8f40c0e45a Improve GDBus introspection test coverage 2010-08-23 00:38:19 -04:00
David Zeuthen
847e4dfe7d GDBusMethodInvocation: nuke constructor
... that is, make it private. This makes sense because users are never
expected to create such objects themselves - only the GDBus core will
need this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-22 22:58:29 -04:00
David Zeuthen
3ff9894826 Bug 624546 – Modification of GDBusMessage in filter function
Allow modifying a GDBusMessage in a filter function and also add tests
for this. This breaks API but leaves ABI (almost) intact - at least
dconf's GSettings backend (the only big user I know of) will keep
working.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-05 20:37:27 -04:00
Matthias Clasen
040bffed38 Fix build on !unix
There was one code block still referring to fd_list outside of
the ifdef G_OS_UNIX. Pointed out by Sam Thursfield in bug 627392.
2010-08-21 22:14:28 -04:00
Matthias Clasen
41ce91d057 Better fix for the build problem
Use gnetworkingprivate.h instead, patch by Emilio Pozuelo Monfort,
bug 627407.
2010-08-21 22:09:32 -04:00
Matthias Clasen
3d01283f69 Make gdbus-peer build on !linux
Based on a patch by Koop Mast, bug 627088.
2010-08-21 22:06:56 -04:00
Matthias Clasen
61de05e774 Fix a duplicate word
Pointed out in bug 627604.
2010-08-21 21:58:51 -04:00
Matthias Clasen
a54e2c4fb3 Add some more annotations 2010-08-21 19:27:11 -04:00
Matthias Clasen
892f9b6458 Improve test coverage for actions and action groups 2010-08-21 19:18:40 -04:00
Matthias Clasen
33b775308b Document behaviour wrt. to floating variants 2010-08-21 19:18:17 -04:00
Matthias Clasen
9581b33ca5 Document behaviour wrt to floating variants 2010-08-21 19:11:03 -04:00
Matthias Clasen
e8ffb1ae83 Add some annotations 2010-08-21 18:12:18 -04:00
Ryan Lortie
5b38bc5ad5 Simplify/fix state logic in GAction, test it. 2010-08-21 17:35:32 -04:00
Matthias Clasen
b876e47e3b Fix documentation issues
Gtk-doc is unhappy if the parameter names don't match between header
and source.
2010-08-21 15:34:40 -04:00
Matthias Clasen
4831a102e5 Fix GActionGroup docs 2010-08-21 15:34:18 -04:00
Dan Winship
8f5ec0dad3 Fix misc compiler warnings in (mostly) test programs 2010-08-19 18:24:53 -04:00
Dan Winship
22b3f0d4b2 gio.symbols: add missing g_simple_action_group stuff 2010-08-19 17:51:24 -04:00
Dan Winship
ab778737aa gproxyaddressenumerator.h: add missing G_END_DECLS 2010-08-19 17:51:01 -04:00
Nicolas Dufresne
de1598a34d gio/proxy: Fixed compilation warnings
* Wrong return type (NULL instead of FALSE)
* Unused static function declaration
2010-08-19 17:31:42 -04:00
Nicolas Dufresne
0958e66317 Add support for g_socket_client_add_application_proxy()
This allow application to take control over certain proxy protocol
handling. When a proxy protocol must be used and is found in the
application proxies, GSocketClient will simply TCP connect to the proxy
server and return the connection.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:38 -04:00
Nicolas Dufresne
ced1d0e2e7 Implemented SOCKSv4 and SOCKSv4a 2010-08-19 16:32:38 -04:00
Nicolas Dufresne
e2a90bcb5f Implemented proxy sample code that connect to proxy 2010-08-19 16:32:38 -04:00
Nicolas Dufresne
0ebb79a748 Implemented g_socket_client_connect_to_uri() method
Using this rather than g_socket_client_connect() or
g_socket_client_connect_to_host() allows #GSocketClient to
determine when to use application-specific proxy protocols.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
a6c3820f46 Hooked proxy enumeration into GSocketClient
This functionnallity can be disabled using property enable-proxy. It
enumerates addresses using GSocketConnectable::proxy_enumerate() instead of
enumerate(). When the returned address is of type GProxyAddress (a type
based on GInetSocketAddress), it gets the proxy protocol handler using
g_proxy_get_default_for_protocol() and call connect() on it.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
ee3dbf747e Implement GProxyConnection a GIOStream+GTcpConn wrapper
This class inherit from GTcpConnection by refing the socket of
an existing GTcpConnection and wraps a custom GIOStream into itself. This
is to allow implementing proxies that alters data stream, like when using
GSSAPI privacy inside SOCKS5.
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
6fa1136600 Implemented SOCKSv5 proxy support 2010-08-19 16:32:37 -04:00
Dan Winship
c32ef1d85e GSocket: store the remote_address when connecting
This way, if g_socket_connect() is called with a GProxyAddress,
g_socket_get_remote_address() will later return that same address.

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
b304a23af7 Extend IO_ERROR enum for Proxy support 2010-08-19 16:32:37 -04:00
Nicolas Dufresne
1094c84238 Implemented proxy sample for all Connectables 2010-08-19 16:32:37 -04:00
Nicolas Dufresne
fc03ecce83 Implemented proxy_enumerate() for all Connectables
This patch implements method proxy_enumerate from GSocketConnectable for
all connectables (GNetworkAddress, GNetworkService, GInetSocketAddress
and GUnixSocketAddress).

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
f82f484b8f Added proxy_enumerate method to GSocketConnectable
Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
6749ffce59 Added GProxyAddressEnumerator to proxy sample code 2010-08-19 16:32:37 -04:00
Nicolas Dufresne
a7e0e8fc08 Adding GProxyAddressEnumerator class
An implementation of GSocketAddressEnumerator that handles proxy
enumeration. This class is mainly usefull for Connectables implementation
such as NetworkService, NetworkAddress and SocketAddress to handle proxies.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
d76de5e359 Added GProxy interface for proxy extension point
Implement an extension point for proxy protocol implementation. This
is mainly useful for socket-based proxy where it is possible to use the
proxied socket the same way it would for other stream based socket.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
63105d1074 Added method g_network_address_parse_uri()
This method allow creating a network address from a URI. If no port is
found in the URI, the default_port parameter will be used. Note that new
property scheme is there for future TLS implementation.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
466111c960 Implement GProxyAddress
A GSocketInetAddress representing the proxy server address with additional
properties proxy type, destination address and port, username and password.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
6b1d851cc5 Implemented proxy sample code
Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:36 -04:00
Nicolas Dufresne
f3debedfd2 Implemented proxy-resolver extension point
This extension point allow extending GLib with library like LibProxy that
interprets system proxy settings and finds the appropriate configuration
based on the type of connection being made.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:36 -04:00
David Zeuthen
7d6a6ca57b Bug 627188 – gdbus-non-socket test occasionally fails
Fix logical bug in test case to avoid race condition between the
client and the server.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-18 13:09:04 -04:00
Matthias Clasen
6c340c0b03 Make gunixcredentialsmessage.h standalone includable 2010-08-18 12:07:38 -04:00
Emmanuele Bassi
81b91a8852 action: Minor fixes
• Argument validation.

• Since: annotations.

• Remove (allow-none) annotations from return values.

• Coding style fixes.
2010-08-18 16:55:40 +01:00
Emmanuele Bassi
504117e284 action-group: Check aginst the correct GType macro
G_TYPE_ACTION_GROUP is not a G_TYPE_ACTION.
2010-08-18 16:55:40 +01:00
David Zeuthen
5bb94348f4 GDBusProxy: Call into well-known name if no name owner currently exists
This is really what (API) users expect from GDBusProxy - in
particular, mclasen and I ran into this problem while debugging a
upower issue, see

 https://bugzilla.redhat.com/show_bug.cgi?id=624125

In a nutshell, the problem is that polkitd crashes while upower holds
a PolkitAuthority object (which in turns contains a GDBusProxy for the
well-known name org.freedesktop.PolicyKit1). This means that
subsequent calls on the PolkitAuthority (which is translated into
calls into the GDBusProxy) fails since :g-name-owner is NULL.

With this fix, we'll be requesting the bus daemon to launch polkitd
since we will start calling into org.freedesktop.PolicyKit1 as soon as
we notice that there is no owner for this name.

Unfortunately our test suite doesn't cover service activation so there
is no way to reliably test this. I will file a bug about this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-18 11:35:25 -04:00
David Zeuthen
c2945808ac GDBusProxy: Use %, not #, for referencing enum constants in gtk-doc comments
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-18 10:52:28 -04:00
Ryan Lortie
5db9e5ad58 add GSimpleActionGroup
and a simple test
2010-08-18 02:18:54 -04:00
Ryan Lortie
e1ded9f900 add gaction.h to gio.h 2010-08-18 01:56:34 -04:00
Ryan Lortie
8014e9c6e6 add testcase for GAction
fix some small bugs it found
2010-08-18 01:55:48 -04:00
Ryan Lortie
8475d6d7d0 add GAction base class 2010-08-18 01:45:15 -04:00
Ryan Lortie
a3f4ff52ca gio.symbols: Fix missed symbol name tweak 2010-08-18 01:07:07 -04:00
Ryan Lortie
6e04125e35 pad the GActionGroup vtable 2010-08-18 00:37:50 -04:00
Ryan Lortie
6fe74a4c6a Add gactiongroup.h to gio.h 2010-08-18 00:33:17 -04:00
Ryan Lortie
e71dbb9732 add GActionGroup base class 2010-08-18 00:31:33 -04:00
Dan Winship
ddad707b85 update gio/tests/.gitignore 2010-08-17 18:38:34 -04:00
Christian Persch
c56379264d Plug a mem leak in GDBusWorker
Free the read buffer.

==26538== 4,096 bytes in 1 blocks are definitely lost in loss record 781 of 781
==26538==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==26538==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
==26538==    by 0x405244D: g_realloc (gmem.c:181)
==26538==    by 0x420E066: _g_dbus_worker_do_read_unlocked (gdbusprivate.c:780)
==26538==    by 0x420E1D1: _g_dbus_worker_do_read (gdbusprivate.c:812)
==26538==    by 0x420F14A: _g_dbus_worker_thread_begin_func (gdbusprivate.c:1318)
==26538==    by 0x420D2ED: invoke_caller (gdbusprivate.c:266)
==26538==    by 0x404DA7C: g_idle_dispatch (gmain.c:4224)
==26538==    by 0x4049FCD: g_main_dispatch (gmain.c:2119)
==26538==    by 0x404B2C1: g_main_context_dispatch (gmain.c:2672)
==26538==    by 0x404B716: g_main_context_iterate (gmain.c:2750)
==26538==    by 0x404BE7F: g_main_loop_run (gmain.c:2958)
==26538==    by 0x420D2B5: shared_thread_func (gdbusprivate.c:248)
==26538==    by 0x4077958: g_thread_create_proxy (gthread.c:1897)
==26538==    by 0x57D918: start_thread (pthread_create.c:301)
==26538==    by 0x4C6CBD: clone (clone.S:133)

Bug #627187.
2010-08-18 00:13:41 +02:00
Christian Persch
a91a4a420e Plug a mem leak in gdbus-connection test
==26538== 145 (24 direct, 121 indirect) bytes in 1 blocks are definitely lost in loss record 765 of 790
==26538==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==26538==    by 0x405233C: g_malloc (gmem.c:134)
==26538==    by 0x406A57E: g_slice_alloc (gslice.c:836)
==26538==    by 0x406A60C: g_slice_copy (gslice.c:858)
==26538==    by 0x4035C5A: g_error_copy (gerror.c:160)
==26538==    by 0x41B6387: g_simple_async_result_set_from_error (gsimpleasyncresult.c:638)
==26538==    by 0x41FCDEB: g_dbus_connection_call_done (gdbusconnection.c:4808)
==26538==    by 0x41B682E: g_simple_async_result_complete (gsimpleasyncresult.c:762)
==26538==    by 0x41B686A: complete_in_idle_cb (gsimpleasyncresult.c:772)
==26538==    by 0x404DA7C: g_idle_dispatch (gmain.c:4224)
==26538==    by 0x4049FCD: g_main_dispatch (gmain.c:2119)
==26538==    by 0x404B2C1: g_main_context_dispatch (gmain.c:2672)
==26538==    by 0x404B716: g_main_context_iterate (gmain.c:2750)
==26538==    by 0x404BE7F: g_main_loop_run (gmain.c:2958)
==26538==    by 0x804B5CC: test_connection_send (gdbus-connection.c:407)
==26538==    by 0x4073D04: test_case_run (gtestutils.c:1174)

Bug #627187.
2010-08-18 00:13:41 +02:00
Christian Persch
75563e81c2 Plug a mem leak in gdbus-connection test
==25403== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 603 of 787
==25403==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==25403==    by 0x405233C: g_malloc (gmem.c:134)
==25403==    by 0x406A57E: g_slice_alloc (gslice.c:836)
==25403==    by 0x406A5C3: g_slice_alloc0 (gslice.c:848)
==25403==    by 0x4035B4E: g_error_new_literal (gerror.c:117)
==25403==    by 0x4035ED9: g_set_error_literal (gerror.c:314)
==25403==    by 0x41F6434: g_dbus_connection_close_sync (gdbusconnection.c:1284)
==25403==    by 0x804A861: test_connection_life_cycle (gdbus-connection.c:158)
==25403==    by 0x4073D04: test_case_run (gtestutils.c:1174)
==25403==    by 0x4073FC2: g_test_run_suite_internal (gtestutils.c:1223)
==25403==    by 0x4074077: g_test_run_suite_internal (gtestutils.c:1233)
==25403==    by 0x4074077: g_test_run_suite_internal (gtestutils.c:1233)
==25403==    by 0x40741FB: g_test_run_suite (gtestutils.c:1274)
==25403==    by 0x40733E5: g_test_run (gtestutils.c:877)
==25403==    by 0x804DC92: main (gdbus-connection.c:1024)

Bug #627187.
2010-08-18 00:13:41 +02:00
Christian Persch
a62a2fd8ed Plug a mem leak in the gdbus-connection test
Bug #627182.
2010-08-18 00:13:41 +02:00
Christian Persch
7191fc3f17 Use g_memory_output_stream_steal_data here
... instead of one extra g_memdup().

Bug #627181.
2010-08-18 00:13:27 +02:00
Christian Persch
71e73ffdfb Use G_DEFINE_[BOXED|POINTER]_TYPE instead of handwritten code
Now that we have convenience macros to implement boxed and pointer
types, use them.
2010-08-18 00:12:28 +02:00
Christian Persch
cae86073ea Add GZIP header processing to GZlibCompressor/GZlibDecompressor
Add GZlibCompressor:file-info property. If it contains a non-NULL
GFileInfo, and the compressor is in GZIP mode, the filename and
modification time from the file info are written to the GZIP header
in the output data.

Add GZlibDeompressor:file-info property. If the decompressor is in GZIP
mode, and the GZIP data contains a GZIP header, the filename and
modification time are read from it, stored in a GFileInfo, and the
file-info property is notified.

Bug #617691.
2010-08-17 17:37:32 +02:00
Christian Persch
b196cd7447 Add g_memory_output_stream_steal_data
Bug #622184.
2010-08-17 17:33:01 +02:00
David Zeuthen
b8e7ef6e90 Bug 627071 – g_output_stream_write() clarification
This patch guarantees that g_output_stream_write() can never fail with
G_IO_ERROR_WOULD_BLOCK. Without such a guarantee, we would need some
kind of GIOPollable interface or some way to get an event when the
stream is writable again. Which is mostly useless considering that
this method is asynchronous anyway.

Note: this patch just codifies existing behavior - GUnixOutputStream,
GSocketOutputStream and other implementations already work this way.

See also bug 626748 comment 5 for how the GDBus code relies on this
guarantee.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-16 15:38:02 -04:00
David Zeuthen
8a3a4596e2 Bug 626748 – Use async methods for writing and handle EAGAIN
If sending a lot of data and/or the other peer is not reading it, then
socket buffers can overflow. This is communicated from the kernel by
returning EAGAIN. In GIO, it is modelled by g_output_stream_write()
and g_socket_send_message() returning G_IO_ERROR_WOULD_BLOCK.

It is also problematic that that we're using synchronous IO in the
shared GDBus IO thread. It means that one GDBusConnection can lock up
others.

It turns out that by porting from g_output_stream_write() to
g_output_stream_write_async() we fix the EAGAIN issue. For GSocket, we
still need to handle things manually (by creating a GSource) as
g_socket_send_message() is used.

We check the new behavior in Michael's producer/consumer test case (at
/gdbus/overflow in gdbus-peer.c) added in the last commit.

Also add a test case that sends and receives a 20 MiB message.

Also add a new `transport' G_DBUS_DEBUG option so it is easy to
inspect partial writes:

 $ G_DBUS_DEBUG=transport ./gdbus-connection -p /gdbus/connection/large_message
 [...]
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 128000 bytes of message with serial 4 and
        size 20971669 from offset 0 on a GSocketOutputStream
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 128000 bytes of message with serial 4 and
        size 20971669 from offset 128000 on a GSocketOutputStream
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 128000 bytes of message with serial 4 and
        size 20971669 from offset 256000 on a GSocketOutputStream
 [...]
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 43669 bytes of message with serial 4 and
        size 20971669 from offset 20928000 on a GSocketOutputStream
 [...]
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 16 bytes of message with serial 3 and
        size 20971620 to offset 0 from a GSocketInputStream
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 15984 bytes of message with serial 3 and
        size 20971620 to offset 16 from a GSocketInputStream
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 16000 bytes of message with serial 3 and
        size 20971620 to offset 16000 from a GSocketInputStream
 [...]
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 144000 bytes of message with serial 3 and
        size 20971620 to offset 20720000 from a GSocketInputStream
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 107620 bytes of message with serial 3 and
        size 20971620 to offset 20864000 from a GSocketInputStream
 OK

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-16 13:54:13 -04:00
David Zeuthen
a6264a3a19 GSocket: Properly initialize msg.msg_control
This patch fixes this problem

   Syscall param socketcall.sendmsg(msg.msg_control) points to uninitialised byte(s)
      at 0x3D5B00EA60: __sendmsg_nocancel (syscall-template.S:82)
      by 0x53F9790: g_socket_send_message (gsocket.c:2918)
      by 0x540FDD0: g_unix_connection_send_credentials (gunixconnection.c:351)
      by 0x542B93F: _g_dbus_auth_run_client (gdbusauth.c:618)
      by 0x5438001: initable_init (gdbusconnection.c:2191)
      by 0x53E09CC: g_initable_init (ginitable.c:105)
      by 0x543F6E9: g_bus_get_sync (gdbusconnection.c:6091)
      by 0x402C7E: test_connection_life_cycle (gdbus-connection.c:126)
      by 0x4C7CABB: test_case_run (gtestutils.c:1174)
      by 0x4C7CD84: g_test_run_suite_internal (gtestutils.c:1223)
      by 0x4C7CE49: g_test_run_suite_internal (gtestutils.c:1233)
      by 0x4C7CE49: g_test_run_suite_internal (gtestutils.c:1233)
    Address 0x7fefff9fc is on thread 1's stack

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-16 12:30:25 -04:00
Matthias Clasen
4bc4590c7b Declare stream base classes as abstract 2010-08-16 10:21:38 -04:00
Dan Winship
547311bfd8 Always do async vs sync correctly in GSocketConnection streams
Previously if a GSocketConnection had a blocking GSocket, it would
sometimes block during asynchonous I/O, and if it had a non-blocking
socket, it would sometimes return G_IO_ERROR_WOULD_BLOCK from
synchronous I/O. This fixes the connection to not depend on the socket
state.

https://bugzilla.gnome.org/show_bug.cgi?id=616458
2010-08-15 15:34:29 -04:00
Dan Winship
17fea2f749 Belatedly add g_socket_client_get/set_timeout to docs and symbols 2010-08-15 13:11:49 -04:00
Dan Winship
b76b24f1b3 GSocketClient: plug two leaks
g_socket_client_connect_async() was always leaking its GCancellable,
and would also leak any GSocket that eventually failed to connect
after returning G_IO_ERROR_PENDING.
2010-08-14 16:15:39 -04:00
Dan Winship
16bafb4799 GSocketClient: add a timeout property
GSocket has a timeout flag now, but when using GSocketClient there was
no way to set the timeout until after connecting (or failing). Fix
that by adding a timeout property to GSocketClient.
2010-08-14 15:26:16 -04:00
Will Thompson
28a4fff7ec Add examples for GAsyncInitiable and GSimpleAsyncResult
Bug 602417
2010-08-13 23:34:44 -04:00
Will Thompson
7a32e34f7c Document that _complete() et al. ref the GSimpleAsyncResult 2010-08-13 23:20:06 -04:00
Will Thompson
ec31612ea0 _simple_async_result_is_valid: allow tag to be NULL
Because g_simple_async_report_[g]error_in_idle() don't take a source tag
parameter, code that uses them can't currently use
g_simple_async_result_is_valid() (at least, not for the error case).

Bug 602417
2010-08-13 23:15:27 -04:00
Matthias Clasen
e02571e93b Add bug references to some tests 2010-08-13 21:23:23 -04:00
Matthias Clasen
ea8a963936 Document vendor override files
Features without documentation, tsk tsk.
2010-08-13 21:23:22 -04:00
Matthias Clasen
4160c5c74a Add tests for async file replace and load 2010-08-13 19:40:48 -04:00
Matthias Clasen
c003468296 Correct a comment 2010-08-13 17:23:44 -04:00
Matthias Clasen
93bd5298c7 Add an async file create/write/read/delete test 2010-08-13 17:23:44 -04:00
Matthias Clasen
7ed4762190 Fix a typo, and some doc reformatting 2010-08-13 17:23:44 -04:00
Matthias Clasen
effdb785fd Add some long descriptions for filter streams 2010-08-13 17:23:44 -04:00
Matthias Clasen
13e55b84eb Run volumemonitor test with local vfs
This is an attempt to stop the test from hanging on some build bots
in build.gnome.org.
2010-08-13 17:23:44 -04:00
David Zeuthen
d344ff9d67 Bug 626841 – Add test-case for non-socket GIOStream
Also fix a couple of bugs so it actually works.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-13 14:01:36 -04:00
Michael Meeks
9be94e8899 Add test for EAGAIN overflow in gdbusconnection based on David's test. 2010-08-13 17:56:19 +01:00
Matthias Clasen
5d9d3f0318 Add some async file tests 2010-08-13 12:04:21 -04:00
Tor Lillqvist
398f9841ed Fix gio/win32 build after -I flag changes 2010-08-10 16:01:39 +03:00
Matthias Clasen
14e0ad7c53 Don't compile some unused functions in gio/xdgmime/ 2010-08-08 21:32:04 -04:00
Matthias Clasen
584787f580 Improve the async result test coverage 2010-08-08 21:32:03 -04:00
Matthias Clasen
7c129c9011 Improve dbus address test coverage 2010-08-08 21:32:03 -04:00
Matthias Clasen
51ad83f711 Make g_dbus_error_unregister_error work 2010-08-07 18:56:12 -04:00
Matthias Clasen
8e236f7ec1 Add some more test about gdbus_error apis 2010-08-07 18:55:21 -04:00
Matthias Clasen
7de6658f74 Make g_simple_async_result_is_valid work without source
The problem was pointed out by Xavier Claessens in bug 626208.
2010-08-07 17:10:17 -04:00
Matthias Clasen
402ad1958c Make the closure variants of name owning and watching actually work
The GClosure API is a bit funky (and badly documented), and requires
you to set a marshaller on the closure, and the marshaller has an
implicit 'this' argument, and the caller is reponsible for unsetting
the values after invoking the closure.

I've added some calls of the _with_closures variants to the
gdbus-names test now.
2010-08-07 17:10:17 -04:00
Ryan Lortie
b91f9274d9 Fix volumemonitor test case
Don't blindly g_object_unref() that which may be NULL.
2010-08-06 13:12:20 -04:00
Ryan Lortie
889a7f81dd gio.symbols: add g_dbus_message_[gs]et_byte_order 2010-08-06 13:11:38 -04:00
Ryan Lortie
b3b7ea8e22 Replace -I with $(glib_INCLUDES) and friends
Stop using ad hoc -I in all of our Makefile.am.  Use the new variables
instead.
2010-08-06 13:10:34 -04:00
Ryan Lortie
ba0208b3a8 Clean up improper #includes
We have a lot of broken #including going on around the tree.  This has
gone unnoticed due to our sloppy use of -I.
2010-08-06 13:05:18 -04:00
paul
9f6faaffb6 Add $(top_builddir)/glib to includes
This is required to find glibconfig.h during srcdir != builddir builds
2010-08-05 09:08:34 -04:00
David Zeuthen
d52e1c33f7 GDBus: Add `return' debug option
This prints all GDBusMethodInvocation API usage and is normally used
with the `incoming' option. Example:

 # G_DBUS_DEBUG=incoming,return ./polkitd --replace
 Entering main event loop
 Connected to the system bus
 Registering null backend at priority -10
 [...]
 Acquired the name org.freedesktop.PolicyKit1
 [...]

 ========================================================================
 GDBus-debug:Incoming:
  <<<< METHOD INVOCATION org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent()
       on object /org/freedesktop/PolicyKit1/Authority
       invoked by name :1.26
       serial 299
 ========================================================================
 GDBus-debug:Return:
  >>>> METHOD ERROR org.freedesktop.PolicyKit1.Error.Failed
       message `Cannot determine session the caller is in'
       in response to org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent()
       on object /org/freedesktop/PolicyKit1/Authority
       to name :1.26
       reply-serial 299

 [...]

 ========================================================================
 GDBus-debug:Incoming:
  <<<< METHOD INVOCATION org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent()
       on object /org/freedesktop/PolicyKit1/Authority
       invoked by name :1.2402
       serial 25
 ========================================================================
 GDBus-debug:Return:
  >>>> METHOD RETURN
       in response to org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent()
       on object /org/freedesktop/PolicyKit1/Authority
       to name :1.2402
       reply-serial 25

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 16:59:26 -04:00
David Zeuthen
89a1b571ad GDBusMessage: Validate header fields when serializing/deserializing
The D-Bus spec mentions exactly what header fields are required for
various message types. Add tests for this as well.

Also disallow empty interfaces for signals since the D-Bus spec says
this is Verboten already.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 14:38:51 -04:00
David Zeuthen
6f070be65b GDBusMessage: Add a way to get/set byte order of a message
Also use this in the test cases to check that serialization to and
from both big and little endian works.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 13:34:14 -04:00
David Zeuthen
6e723e8b3e GDBusMessage: Assert various things when serializing to a blob
We use g_assert() instead of setting the GError because it is a
programming error if the GVariant contains invalid data - see commit
5e6f762d61 for where the last hole in
GVariant was closed.

So if we can trust GVariant to only contain valid data (ignoring the
case where unsafe API such as g_variant_new_from_data() is used), why
g_assert() at all with costly g_utf8_validate() checks? Because a) it
is relatively inexpensive; and b) it helps find bugs such as the one
fixed in commit 5e6f762d61.

If performance is a concern we can play games like introducing
environment variables or other machinery to avoid such "costly"
checks. I doubt it will ever be an issue.

Also replace two "Hmm" TODO item with a static assert - the code that
serializes a gdouble into the D-Bus wire format by treating it as a
guint64 is indeed correct - endianess needs to be taken into account
(see the D-Bus reference implementation for similar code). But we want
to make sure that we're indeed using an architecture/compiler where a
gdouble takes up 8 bytes - hence the assertion.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 12:24:22 -04:00
David Zeuthen
5bd34a820e GDBusMessage: Validate UTF-8 strings when serializing from blob
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 11:26:48 -04:00
Dan Winship
e62bc8e8f6 remove a junk line 2010-08-04 07:36:34 -04:00
David Zeuthen
f5cd8ddeaa GDBusConnection: Debug messages when receiving signals and method invocations
Spell out "RECEIVED SIGNAL" instead of "SIGNAL" to emphasize this is
about receiving a signal, not emitting one (which is "SIGNAL
EMISSION"). Also make the "arrows" point in the "right" direction
("<<<<" vs ">>>>") - like this:

 ========================================================================
 GDBus-debug:Signal:
  <<<< RECEIVED SIGNAL org.freedesktop.DBus.NameOwnerChanged
       on object /org/freedesktop/DBus
       sent by name org.freedesktop.DBus

and

 ========================================================================
 GDBus-debug:Incoming:
  <<<< METHOD INVOCATION org.freedesktop.PolicyKit1.Authority.EnumerateTemporaryAuthorizations()
       on object /org/freedesktop/PolicyKit1/Authority
       invoked by name :1.2176

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03 15:36:16 -04:00
David Zeuthen
69341e2ba9 glib-compile-schemas: Pass a C string, not a GString wrapper
Commit 5e6f762d61 (introducing UTF-8
validity checks for GVariant instances containing strsings) actually
uncovered a bug in glib-compile-schemas - a GString was passed when a
C string was expected.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03 14:32:29 -04:00
David Zeuthen
86d947f01f Fix gdbus-exit-on-close test case
Forgot to update the test case after last commit.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03 12:47:07 -04:00
David Zeuthen
6a492a4519 GDBus: If exiting b/c remote peer disconnected and error is set, print it
This should make things easier to debug:

  g_dbus_connection_real_closed: Remote peer vanished with error:
  Underlying GIOStream returned 0 bytes on an async read
  (g-io-error-quark, 0). Exiting.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03 12:24:48 -04:00
David Zeuthen
3940cc9a11 GDBusProxy: Don't leak a GSimpleAsyncResult when doing async calls
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03 11:14:21 -04:00
Matthias Clasen
b2715bbc5e Fix a possible deadlock
the FdSource was calling g_cancellable_disconnect while holding the
main context lock, which is bad news if the ::cancelled handler is
trying to get that lock to wake up the mainloop...

Bug 586432
2010-08-03 10:41:21 -04:00
Emmanuele Bassi
b3de028a43 Update the Git ignore files 2010-08-03 14:21:02 +01:00
Ryan Lortie
ca3b7b75bf GSettings: add G_SETTINGS_BIND_INVERT_BOOLEAN flag
When binding a boolean setting to a boolean property, invert the values.
This avoids the requirement for writing a pair of mapping functions for
this extremely common case.

Add a test.

https://bugzilla.gnome.org/show_bug.cgi?id=625833
2010-08-03 02:09:10 -04:00
Fridrich Štrba
dd2bbc9533 On windows, export also symbols defined in gio/gwin32appinfo.c 2010-08-02 10:16:29 +02:00
Carlos Garcia Campos
892012b951 GDBusConnection: fix message flags in g_dbus_connection_call_sync()
GDBusCallFlags were used instead of GDBusSendMessageFlags for
g_dbus_connection_send_message_with_reply_sync(). Fixes bug #625753.
2010-08-01 17:27:58 +02:00
Milan Crha
d01a437490 Silence valgrind
Initialize all fields of struct msghdr. Bug 625472.
2010-07-31 23:51:45 -04:00
Matthias Clasen
8246bf4bde Improve gdbus test coverage 2010-07-31 00:13:02 -04:00
Matthias Clasen
116b945c94 Fix a typo
Its credentials, not crendentials
2010-07-30 23:44:30 -04:00
Matthias Clasen
eb3e926b09 Fix an off-by-one error 2010-07-30 19:53:29 -04:00
Matthias Clasen
5033be80d1 Add a test for g_dbus_proxy_get_cached_property_names 2010-07-30 19:51:22 -04:00
Matthias Clasen
aa196c60df Improve coverage of buffered output stream tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
ffa938fc65 Improve coverage of credentials tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
670528c187 Improve coverage of converter stream tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
9794a648a9 Improve coverage of memory stream tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
620582e59c Remove redundant include 2010-07-30 19:51:20 -04:00
Matthias Clasen
17d4898d75 Improve coverage of icon tests 2010-07-30 19:51:20 -04:00
Matthias Clasen
7710c50fb2 Improve coverage of application tests 2010-07-30 19:51:20 -04:00
Matthias Clasen
758c3216cd Improve coverage of stream tests 2010-07-30 19:51:20 -04:00
Matthias Clasen
c6b0507167 Reenable unix-streams test 2010-07-30 19:51:20 -04:00
Matthias Clasen
04c7abba11 Work around deadlock in unix-streams test 2010-07-30 19:51:20 -04:00
Matthias Clasen
b463b2ea25 Add tests about file associations 2010-07-30 19:51:20 -04:00
Matthias Clasen
13ac9f94fd Add some more GFile tests 2010-07-30 19:51:19 -04:00
Matthias Clasen
8263d691cb Improve compressor test coverage a bit 2010-07-30 19:51:19 -04:00
Matthias Clasen
b77a19f238 Test g_settings_list_schemas 2010-07-30 19:51:19 -04:00
Matthias Clasen
caa9453b72 Fix a warning 2010-07-30 19:51:18 -04:00
Matthias Clasen
d0750c9d6e Don't leak in converter test 2010-07-30 19:51:18 -04:00
Matthias Clasen
63bdeb0dab Fix an icon test 2010-07-30 19:51:17 -04:00
Matthias Clasen
a8f83ea834 Add tests for GNetworkAddress 2010-07-30 19:51:17 -04:00
Matthias Clasen
e103b93694 Drop an unneeded if 2010-07-30 19:51:17 -04:00
Matthias Clasen
9fc3c980cc Add some volume monitor tests
Although not much of this is easily testable.
2010-07-30 19:51:17 -04:00
David Zeuthen
dbf230991b Bug 625628 – GDBusProxy: wrong property name sorting
https://bugzilla.gnome.org/show_bug.cgi?id=625628

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-30 16:34:13 -04:00
David Zeuthen
aefc6df6bb Fix gschema-compile test
This was broken by commit 1b5b87bfa0

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-30 16:30:34 -04:00
David Zeuthen
d2d97a214d Bug 625584 – Crashes application on unref with signal subscription
Don't do too much work in the finalizer - in particular, there's no
need to send RemoveMatch() messages to the bus daemon since we're
going to sever the connection and the bus will garbage collect
anyway. In this case it crashed the process.

Also add a test case that checks that the appropriate GDestroyNotify
callbacks are called when unreffing a connection with either 1)
exported objects; 2) signal subscriptions or 3) filter functions
.. yes, ideally apps would unregister such callbacks before giving up
their ref but that's not how things work :-)

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-30 16:06:18 -04:00
Ryan Lortie
1b5b87bfa0 GSettings: Mark some strings for cat translation
<vuntz> *miaou*
2010-07-30 21:13:05 +02:00
David Zeuthen
14f17c1388 GDBusConnection: Fix up debug output when completing calls
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-30 11:40:00 -04:00
David Zeuthen
173977a701 GCredentials: use effective uid/gid
Otherwise e.g. setuid root processes can't connect to the system
bus. This was discovered when porting PolicyKit's pkexec(1) command to
a PolicyKit library using GDBus.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-30 11:26:43 -04:00
Eduardo Lima Mitev
8673f0b06c GIO: Add G-I annotations for several methods
Specifically:
 - g_io_stream_get_input/output_stream()
 - g_socket_client_get_local_address()
 - g_socket_connection_get_socket()
 - g_socket_listener_add_address()
 - g_socket_listener_accept_socket()
 - g_socket_listener_accept()
 - g_io_extension_point_get_extensions()
2010-07-29 14:06:00 +02:00
Owen Taylor
015df7e369 [gschema-compile] fix segfault
If files are passed on the command line and we don't set override_files
at all, don't try to read from the array.
2010-07-28 15:15:57 -04:00
David Zeuthen
19ef26c9c5 Use correct type for GDBusServer:active property
It's a boolean, not a string.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-28 12:58:04 -04:00
David Zeuthen
133e87ca87 GDBusConnection: Pass the GObject to g_simple_async_result_new()
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-28 12:51:09 -04:00
Ryan Lortie
a6f1bb4e17 Add support for vendor override files
You can drop a key-file in the schema directory that looks like:

[org.gtk.Example]
key='value'

to override the default value of 'key' in schema 'org.gtk.Example'.
2010-07-28 13:47:34 +02:00
Murray Cumming
633d9efc62 [gio]: gioenums.h: Remove trailing comma again. 2010-07-23 13:25:18 +02:00
Ryan Lortie
d5bd531d96 Cleanup the GSettingsBackend API
This is a substantial ABI break.  Rebuild dconf.
2010-07-22 18:39:50 -04:00
Ryan Lortie
aed440815e GSettings: add g_settings_reset()
Resets a key to its default value.
2010-07-22 17:50:05 -04:00
Benjamin Otte
dd1d1b3510 tests: Use GPOINTER_TO_SIZE() instead of just casting to guint
a) gcc doesn't like this ("Cast to pointer of different size)
b) It compares only half of the pointer
2010-07-22 21:56:20 +02:00
Benjamin Otte
284ea16b9d inotify: Constify function argument
gcc complained...
2010-07-22 21:56:20 +02:00
Ryan Lortie
dc7348b305 Fix very small leak in the GSettings test 2010-07-22 11:49:30 -04:00
Ryan Lortie
23a904fc15 Bug 624991 - GSettings mapping for G_TYPE_STRV
Added default mapping for G_TYPE_STRV based on a patch from Garrett
Regier.

Add a test case.
2010-07-22 11:34:57 -04:00
David Zeuthen
9b0a08449f GDBusAuthObserver: Fix docs
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-20 16:34:28 -04:00
David Zeuthen
7eba41346e Bug 617483 – Credentials passing
- Make GCredentials instance and class structures private so it can't
   be subclassed and we don't have to worry about ABI compat
   issues. This also allows us to get rid of the GCredentialsPrivate
   struct.

 - Add a GCredentialsType enumeration that is used whenever exchanging
   pointers with the user. This allows us to support OSes with
   multiple native credential types. In particular, it allows
   supporting OSes where the native credential evolves or even changes
   over time.

 - Add g_socket_get_credentials() method.

 - Add tests for g_socket_get_credentials(). Right now this is in the
   GDBus peer-to-peer test case but we can change that later.

 - Move GTcpConnection into a separate gtk-doc page as was already
   half-done with GUnixConnection. Also finish the GUnixConnection
   move and ensure send_credentials() and receive_credentials()
   methods are in the docs. Also nuke comment about GTcpConnection
   being empty compared to its superclass.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-20 16:34:18 -04:00
David Zeuthen
b3cf5cbd0b GDBusServer: Avoid handling incoming connections after stop() has been called
Without this fix, we'd sometimes run code after stop() and finalize()
to handle incoming requests. This was observed in the gdbus-peer test
case occasionally crashing:

 $ ./gdbus-peer
 /gdbus/peer-to-peer: OK
 /gdbus/delayed-message-processing: OK
 /gdbus/nonce-tcp:
 GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `GDBusServer'
 aborting...

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-20 12:14:30 -04:00
David Zeuthen
2be167f57c GDBus: Add support for D-Bus type 'h' (ie. G_VARIANT_TYPE_HANDLE)
This allows sending and receiving D-Bus messages with instances of the
'h' D-Bus type. Unlike libdbus-1's dbus_message_iter_get_basic()
method, g_variant_get_handle() does not return a duplicated unix file
descriptor (that must be closed with close(2)) - instead, it returns
an index that can be used to get/dup the file descriptor from a
GUnixFDList object that can be obtained from the GDBusMessage object.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-20 11:38:23 -04:00
Ryan Lortie
66388120d2 Move #include <sys/wait.h> down
Until after we include the glib stuff, so that we have G_OS_UNIX
defined.

For some reason <stdlib.h> pulls in <sys/wait.h> on Fedora so this
wasn't a problem, but many others have reported the issue.
2010-07-20 10:49:30 -04:00
David Zeuthen
493d8cb292 GDBus: Introduce G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL
This is preferable to the current magical solution whereby the serial
is only rewritten if non-zero. In particular, it makes it easier to
send the same message on multiple connections without having to reset
the serial number.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 17:05:28 -04:00
David Zeuthen
9d7b00638f GDBus: Forgot to add g_dbus_send_message_flags_get_type() to gio.symbols
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 16:11:20 -04:00
David Zeuthen
0b2b4deac5 GDBus: Add GDBusSendMessageFlags
This is currently unused but might be useful in the future. For
example, it might be nice with a way to bypass the current queue of
outgoing messages - having a flag enumeration allows us to add a
G_DBUS_SEND_MESSAGE_FLAGS_BYPASS_QUEUE etc. etc.

This commit breaks ABI and API. Users of the (rarely used) API to send
messages will have to port to this new API.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 16:07:57 -04:00
David Zeuthen
7190af4394 GDBus: Remove constness from introspection data structures
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 15:45:27 -04:00
David Zeuthen
4a1c5a1b98 GDBus: Add GDBusSignalFlags and use it in g_dbus_connection_signal_subscribe()
This is currently unused but will probably be useful in the
future. For example, we could have a _ARG0_IS_PATH to specify that
arg0 should be used for arg0path.

This commit breaks API and ABI. Users of
g_dbus_connection_signal_subscribe() will need to port to this new
version.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 15:05:10 -04:00
Ryan Lortie
1a06bd8d3f Update the GDBus subtree example for the new API 2010-07-19 15:03:54 -04:00
David Hoyt
c7c573afb6 Bug 624754 – gdbusaddress.c missing sys/wait.h
https://bugzilla.gnome.org/show_bug.cgi?id=624754

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 13:53:17 -04:00
David Zeuthen
f30aef9a10 GDBus: Add nonce-tcp: test case
Also fix a couple of TODO items in gdbusaddress.c

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-16 13:22:45 -04:00
Ryan Lortie
fe6338f446 g_warning on inconsistent subtree behaviour
If the subtree introspection function indicates that an interface exists
but then the dispatch function returns a NULL vtable for that interface,
issue a g_warning pointing programmers in the right direction.
2010-07-15 19:38:45 -04:00
Julien Cristau
732ff1b27c gio: don't assume that SOCK_CLOEXEC is supported whenever it's defined
Just because SOCK_CLOEXEC was defined at build time doesn't mean the
kernel we're running on supports it.  So if socket() fails with EINVAL,
try again without the flag.

https://bugzilla.gnome.org/show_bug.cgi?id=624463
2010-07-15 18:06:05 -04:00
Ryan Lortie
8a2d157d49 Bug 624484: GDBusSubtreeDispatchFunc clarification
Pass NULL rather than "/" for the toplevel of a subtree.

Add clarification to the docs about how trees are flat.
2010-07-15 17:32:04 -04:00
Ryan Lortie
ca14ab7ac0 Bug 624483: GDBusSubtreeEnumerateFunc clarification
Clarify a couple of things in the docs:

  1) you must return flat names (no slashes)

  2) g_strfreev() will be called on the result

  3) a benefit of using the DISPATCH_TO_UNENUMERATED flag
2010-07-15 17:32:04 -04:00
Ryan Lortie
e6b5546cf5 Bug 624473: GDBusSubtreeIntrospectFunc return type
Return a NULL terminated C array instead of a GPtrArray

Also, document that %NULL is a permitted return value and clarify its
meaning.

Finally, avoid calling the enumeration function during dispatch when the
G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag was given.
2010-07-15 17:31:59 -04:00
David Zeuthen
48b1fe948c Bug 623810 – Message serialization bug
https://bugzilla.gnome.org/show_bug.cgi?id=623810

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-15 12:20:30 -04:00
Tomeu Vizoso
58f1977151 Add annotations to g_dbus_proxy_new_sync 2010-07-15 15:33:16 +02:00
David Zeuthen
baf383d1b1 GDBusConnection: copy object and subtree virtual tables
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-14 14:46:12 -04:00
David Zeuthen
914b046226 GDBusConnection: Fix up g_dbus_connection_close()
... so it is async, cancelable and returns an error. Also provide a
synchronous version.

This is an API/ABI break but it is expected that only very few
applications use this API.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-14 12:37:32 -04:00
David Zeuthen
14e37ef796 GDBusMessage: Make endianness for D-Bus messages match host byte order
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-14 11:41:09 -04:00
David Zeuthen
497edd8b40 Bug 623815 – Don't check sender for GDBusProxy objects where name is not set
Based on a patch from Peng Huang <shawn.p.huang@gmail.com>, thanks!

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-14 11:19:24 -04:00
Colin Walters
8a2e7d371f Make default-quit not apply if register=FALSE
Callers who are using g_application_unregistered_try_new are
likely wanting to continue doing something else if _register()
fails.  Change the semantics so that passing register=FALSE
unsets default-quit as well.  This means that a later _register()
call will send Activate but continue the process.

https://bugzilla.gnome.org/show_bug.cgi?id=622005
2010-07-14 09:39:47 -04:00
Ryan Lortie
5344c22810 gio/ docs fixup 2010-07-12 18:30:14 -04:00
Ryan Lortie
83d67bf2e7 move glibconfig.h to glib/ 2010-07-12 15:33:05 -04:00
Colin Walters
d2fe46b476 Annotate all custom GIO GSource using g_source_set_name
Naming the sources allows easier debugging with e.g. SystemTap
probes.

https://bugzilla.gnome.org/show_bug.cgi?id=620536
2010-07-10 20:09:34 -04:00
Matthias Clasen
3dca4ce434 One more dubious return 2010-07-10 20:02:47 -04:00
Matthias Clasen
29babb9fc8 Minor cleanup 2010-07-10 18:04:22 -04:00
Matthias Clasen
f8e22856c6 Add a GAppInfoCreate flag for startup-notification
Using this flag, it will be possible to launch apps without a
desktop file, in the same way that gdk_spawn_... lets you do.

Requested in bug 599223.
2010-07-10 17:57:45 -04:00
Matthias Clasen
5f1490e94a Fix sparse warnings
These were listed in bug 623955
2010-07-10 17:21:32 -04:00
Matthias Clasen
41f4aba2d2 Chain up in g_settings_finalize
Requested in bug 623954
2010-07-10 17:12:31 -04:00
Matthias Clasen
551461b23a Fix some leaks in the inotify code
Also avoid creating some unused objects. Patch by Carlos Garnacho,
bug 613057
2010-07-09 08:33:27 -04:00
Matthias Clasen
c24a29e13b Adapt to recent MLS changes
g_file_query_info returns non-NULL more often now.
2010-07-09 07:24:08 -04:00
Matthias Clasen
448ac22e80 Fix an oversight in the previous commit 2010-07-08 16:24:44 -04:00
Matthias Clasen
33f7f6a748 Use glib infrastructure to parse debug flags
Proposed in bug 623319
2010-07-08 16:22:16 -04:00
Matthias Clasen
29850d03e8 Be a bit more picky when deciding if mounts are internal
Complained about in bug 623780.
2010-07-08 15:18:05 -04:00
Matthias Clasen
349aab2bd4 A little more correctness in formatting pids
Requested in bug 623772
2010-07-08 15:11:24 -04:00
Matthias Clasen
fcddf9c2a1 Escape arguments when putting together a cmdline
See bug 623770
2010-07-08 14:58:33 -04:00
Matthias Clasen
607fec50e6 xinclude the dtd
Keeping two copies in sync manually gets tiresome.
2010-07-08 14:38:55 -04:00
Matthias Clasen
c7816005f9 Update the dtd to match the implementation
See bug 623720
2010-07-08 14:29:17 -04:00
Matthias Clasen
71e7b5800a Handle MLS selinux policy better
Following the behaviour of ls here, we should return at least the
file name, if we can't get any other information about a file. To
do this, handle EACCESS on stat() calls.

Patch by Tomas Bzatek, see bug 623692
2010-07-08 14:19:08 -04:00
Matthias Clasen
5adf506d5b Use proper variables
And also make sure we don't read garbage.
2010-07-08 11:33:21 -04:00
Ryan Lortie
5b946e0504 gio/: fully remove gioalias hacks 2010-07-07 19:53:22 -04:00
Ryan Lortie
c243905c95 .gitignore updates 2010-07-07 16:52:41 -04:00
David Zeuthen
abc65b233c GDBus: Hide instance structures for classes we don't want to be subclassed
This also allows us to nuke the priv-> pointers and save a couple of
indirections.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-07 16:36:51 -04:00
Ryan Lortie
d9e90c3894 GVariant: improve bytestring support
- add G_VARIANT_TYPE_BYTESTRING, _BYTESTRING_ARRAY, _STRING_ARRAY

 - remove g_variant_{new,get}_byte_array functions

 - add g_variant_{new,get,dup}_bytestring{,_array} functions

 - remove undocumented support for deserialising arrays of objectpaths
   or signature strngs using g_variant_get_strv()

 - add and document new format strings '^ay', '^&ay', '^aay' and '^a&ay'

 - update GApplication to use the new API

 - update GSettings binding code to use the new API

 - add tests
2010-07-07 16:25:48 -04:00
David Zeuthen
2d2a321a4b GDBus: Hide class structures for classes we don't want to be subclassed
E.g. move these C structures out of public header files and into their
respective C files. Also nuke padding since this is no longer needed.

This leaves only GDBusProxy as an extendable type.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-07 15:57:37 -04:00
David Zeuthen
62a1ccf526 Bug 618882 – No way to ensure that a message is sent
Add g_dbus_connection_flush{_finish,sync}().

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-07 15:03:03 -04:00
David Zeuthen
acc9bb2403 GDBus: Only rewrite serial number if g_dbus_message_get_serial() returns 0
While this a dangerous thing to allow (collissions, reply_serial not
matching up etc.), the added flexibility makes this a good trade-off -
for example, with this feature, it's now a lot easier to build message
routers.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-07 11:06:23 -04:00
Ryan Lortie
746721293b GSettings: warn if use the 'memory' backend
but only if it was not explicitly selected.
2010-07-07 10:56:57 -04:00
Ryan Lortie
6ae4d31e75 trivial GSettings docs fix 2010-07-07 10:46:13 -04:00
David Zeuthen
a38fed1b43 Bug 623538 – GDBusProxy::g-properties-changed emission for corner cases
Also emit GDBusProxy::g-properties-changed when dropping (when the
name owner vanishes) or populating (when loading properties) the
property cache.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-07 09:50:44 -04:00
David Zeuthen
ea0607438b Bug 623537 – GDBusProxy has weird checking on NameOwnerChanged
Remove misleading (and always true) check on the name that the
NameOwnerChanged signal is for.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-07 09:07:23 -04:00
Matthias Clasen
99670eaccc Fix some errors in translated strings
gettext can't handle macros, so we have to use literal format
specifiers, unfortunately.
2010-07-07 07:37:42 -04:00
Matthias Clasen
bad9a3718e Clear the buffer initially 2010-07-07 01:00:58 -04:00
Danielle Madeley
be247379f0 Include sys/wait.h for WEXITSTATUS() 2010-07-07 12:47:54 +10:00
David Zeuthen
aab6d9ed1c GDBus: Handle autolaunching on UNIX/Freedesktop OSes
Also add a 'address' G_DBUS_DEBUG option that will print out useful
debug information such as

  GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus type `session'
  GDBus-debug:Address: env var DBUS_SESSION_BUS_ADDRESS is not set
  GDBus-debug:Address: env var DBUS_SYSTEM_BUS_ADDRESS is not set
  GDBus-debug:Address: env var DBUS_STARTER_BUS_TYPE is not set
  GDBus-debug:Address: Running `dbus-launch --autolaunch=05e508961149264c9b750a4c494aa6f7 --binary-syntax --close-stderr' to get bus address (possibly autolaunching)
  GDBus-debug:Address: dbus-launch output:
    0000: 75 6e 69 78  3a 61 62 73  74 72 61 63  74 3d 2f 74    unix:abstract=/t
    0010: 6d 70 2f 64  62 75 73 2d  77 42 41 6f  4b 59 49 52    mp/dbus-wBAoKYIR
    0020: 7a 75 2c 67  75 69 64 3d  30 34 30 64  31 33 66 33    zu,guid=040d13f3
    0030: 30 61 30 62  35 32 63 32  30 66 36 32  63 34 31 63    0a0b52c20f62c41c
    0040: 30 30 30 30  35 30 38 64  00 d2 38 00  00 01 00 40    0000508d..8....@
    0050: 05 00 00 00  00                                       .....
  GDBus-debug:Address: dbus-launch stderr output:
  14542: Autolaunch enabled (using X11).
  14542: --exit-with-session automatically enabled
  14542: Connected to X11 display ':0.0'
  14542: === Parent dbus-launch continues
  14542: Waiting for babysitter's intermediate parent
  14542: Reading address from bus
  14542: Reading PID from daemon
  14542: Saving x11 address
  14542: Created window 88080385
  14542: session file: /root/.dbus/session-bus/05e508961149264c9b750a4c494aa6f7-0
  14542: dbus-launch exiting
  GDBus-debug:Address: Returning address `unix:abstract=/tmp/dbus-wBAoKYIRzu,guid=040d13f30a0b52c20f62c41c0000508d' for bus type `session'

and

  GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus type `session'
  GDBus-debug:Address: env var DBUS_SESSION_BUS_ADDRESS is not set
  GDBus-debug:Address: env var DBUS_SYSTEM_BUS_ADDRESS is not set
  GDBus-debug:Address: env var DBUS_STARTER_BUS_TYPE is not set
  GDBus-debug:Address: Running `dbus-launch --autolaunch=05e508961149264c9b750a4c494aa6f7 --binary-syntax --close-stderr' to get bus address (possibly autolaunching)
  GDBus-debug:Address: dbus-launch output:
    0000: 75 6e 69 78  3a 61 62 73  74 72 61 63  74 3d 2f 74    unix:abstract=/t
    0010: 6d 70 2f 64  62 75 73 2d  77 42 41 6f  4b 59 49 52    mp/dbus-wBAoKYIR
    0020: 7a 75 2c 67  75 69 64 3d  30 34 30 64  31 33 66 33    zu,guid=040d13f3
    0030: 30 61 30 62  35 32 63 32  30 66 36 32  63 34 31 63    0a0b52c20f62c41c
    0040: 30 30 30 30  35 30 38 64  00 d2 38 00  00 01 00 40    0000508d..8....@
    0050: 05 00 00 00  00                                       .....
  GDBus-debug:Address: dbus-launch stderr output:
  14549: Autolaunch enabled (using X11).
  14549: --exit-with-session automatically enabled
  14549: Connected to X11 display ':0.0'
  14549: dbus-daemon is already running. Returning existing parameters.
  14549: dbus-launch exiting
  GDBus-debug:Address: Returning address `unix:abstract=/tmp/dbus-wBAoKYIRzu,guid=040d13f30a0b52c20f62c41c0000508d' for bus type `session'

Note that things work exactly like libdbus, e.g. from the
dbus-launch(1) man page:

  Whenever an autolaunch occurs, the application that had to start a
  new bus will be in its own little world; it can effectively end up
  starting a whole new session if it tries to use a lot of bus
  services. This can be suboptimal or even totally broken, depending
  on the app and what it tries to do.

  [...]

  You can always avoid autolaunch by manually setting
  DBUS_SESSION_BUS_ADDRESS. Autolaunch happens because the default
  address if none is set is "autolaunch:", so if any other address is
  set there will be no autolaunch. You can however include autolaunch
  in an explicit session bus address as a fallback, for example
  DBUS_SESSION_BUS_ADDRESS="something:,autolaunch:" - in that case if
  the first address doesn't work, processes will autolaunch. (The bus
  address variable contains a comma-separated list of addresses to
  try.)

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-06 17:03:36 -04:00
David Zeuthen
ef29644063 GDBus: Properly handle empty address strings
Changes this error

 DBUS_SESSION_BUS_ADDRESS= \
 gdbus introspect --session \
                  --dest org.freedesktop.DBus \
                  --object-path /org/freedesktop/DBus
 **
 GLib-GIO:ERROR:gdbusaddress.c:913:g_dbus_address_get_stream_sync: assertion failed: (last_error != NULL)
 Aborted (core dumped)

to

 DBUS_SESSION_BUS_ADDRESS= \
 gdbus introspect --session \
                  --dest org.freedesktop.DBus \
                  --object-path /org/freedesktop/DBus
 Error connecting: The given address is empty

which is much more preferable.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-06 17:03:36 -04:00
Matthias Clasen
af299df44e Remove cases of ;; 2010-07-05 23:13:17 -04:00
Matthias Clasen
fb02422404 Test charset conversion with fallbacks 2010-07-05 23:13:17 -04:00
Matthias Clasen
05a865344b Fix the get_property implementation for GSettings::schema 2010-07-05 23:13:17 -04:00
Matthias Clasen
20dca5935c Add several more settings tests 2010-07-05 23:13:17 -04:00
Matthias Clasen
958f15013c Small documentation addition 2010-07-05 23:13:17 -04:00
Matthias Clasen
c6e8d0ada8 Fix icons test to compile 2010-07-05 23:13:17 -04:00
Matthias Clasen
81a0a26813 Test enum mapping 2010-07-05 23:13:17 -04:00
Matthias Clasen
2764b75d53 More stream tests 2010-07-05 23:13:17 -04:00
Matthias Clasen
10b2606af5 Add more checks 2010-07-05 23:13:16 -04:00
Matthias Clasen
aec652677b Add some buffered output tests 2010-07-05 23:13:16 -04:00
Matthias Clasen
4ab9b708c0 Add some more tests for the buffered read code 2010-07-05 23:13:16 -04:00
Matthias Clasen
1ba87d1a0e Trivial cleanups 2010-07-05 23:13:16 -04:00
Matthias Clasen
dea042b855 Misc test additions 2010-07-05 03:09:36 -04:00
Matthias Clasen
211210c1ce Fix a typo 2010-07-05 02:36:48 -04:00
Matthias Clasen
c53c701e53 Cleanups 2010-07-05 00:56:12 -04:00
Matthias Clasen
f90eb144d4 Add some more tests 2010-07-04 23:42:07 -04:00
Matthias Clasen
74fbd3296d Add some GAppLaunchContext tests 2010-07-04 23:41:40 -04:00
Matthias Clasen
c915c68b6b Add the new tests to the correct variable 2010-07-04 23:40:42 -04:00
Matthias Clasen
14db75381e Add some contenttype tests 2010-07-04 22:27:01 -04:00
Matthias Clasen
fb120b5d87 Add a test for skipping 2010-07-04 20:51:06 -04:00
Matthias Clasen
9788c4c7e6 Add some CharsetConverter tests 2010-07-04 20:51:06 -04:00
Matthias Clasen
401fa10445 Add some more appinfo tests 2010-07-04 20:51:06 -04:00
Matthias Clasen
9fd1339460 Move GZlibConverter tests 2010-07-03 03:31:24 -04:00
Matthias Clasen
aaba9276f7 Add tests for GIcon 2010-07-03 03:31:07 -04:00
David Zeuthen
37c4fcb36a GDBus: Rename "Introspection XML" section to "D-Bus Introspection Data"
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-02 17:09:55 -04:00
Ryan Lortie
a16128655f Bug 623407 - g_keyfile_settings_backend_new crash
The keyfile backend forms paths like this:

  prefix + group_name + '/' + keyname

If the prefix is '/apps/yelp/' and the group name is '/' then this means
that we end up with a key name of (for example):

  '/apps/yelp/' + '/' + '/' + 'font-adjustment'

= '/apps/yelp///font-adjustment'

which is obviously not a valid key name.

This patch rejects group names starting or ending with '/' or containing
'//' and also rejects keys containing '/'.  This should make it
impossible for invalid keys to be formed.
2010-07-02 11:35:43 -04:00
Ryan Lortie
a941660873 Bug 623402 - schema compiler reports wrong line
Don't reuse the GMarkupParseContext in order to avoid inaccurate line
number reports.  Fix a memory leak, too.
2010-07-02 11:14:28 -04:00
Ryan Lortie
7a44a2d223 Bug 623401 - schema compiler: process enums first
Process *.enum.xml before any *.gschema.xml files to ensure that all
enums have been defined.
2010-07-02 11:11:45 -04:00
David Zeuthen
1ca6a4687a GDBus: Hold lock when printing debug messages
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-02 09:40:59 -04:00
David Zeuthen
c29ad23928 GDBus: make G_DBUS_DEBUG=authentication work again
This was inadvertently removed in this commit

http://git.gnome.org/browse/glib/commit/?id=1d22b64843c83631bcd0e5255930f3a4e990961e

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-02 09:35:13 -04:00
Ryan Lortie
5383c7110f Bug 622124 - implement flags for GSettings
Add a <flags> tag to the schema file format and a flags='' attribute to
go along with.  Add some extra test cases for those.

Add new g_settings_{get,set}_flags() calls and support binding to
GParamSpecFlags properties.  Add test cases.
2010-07-01 19:06:02 -04:00
David Zeuthen
bd8d837f57 Bug 620913 – More control with G_DBUS_DEBUG
This commit adds the following G_DBUS_DEBUG flags

 - emission
 - incoming
 - call
 - signal
 - payload

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-01 14:37:16 -04:00
David Zeuthen
51ed44e7ad GDBus: Fix bug in child enumeration
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-01 13:07:58 -04:00
Ryan Lortie
93bf09a9e7 Use "unix:" instead of tcp in test for now...
Temporarily avoids the issue reported in bug #623306.
2010-07-01 12:55:04 -04:00
David Zeuthen
21d7ce97c3 GDBus: plug some memory leaks
These fixes makes udisks-daemon from udisks' gdbus-port branch, see

 http://cgit.freedesktop.org/udisks/log/?h=gdbus-port

handle 200 add/remove uevents generated by e.g.

 #!/bin/bash
 DEV=mmcblk0p1
 for n in `seq 200` ; do
     udevadm trigger --sysname-match=$DEV --action=remove
     udevadm trigger --sysname-match=$DEV --action=add
     echo foo $n
 done

without any substantial leaks.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-30 16:39:32 -04:00
Ryan Lortie
40d5da99d6 GSettings: accept <flags> as an alias for <enum>
until we have proper support for flags...
2010-06-30 13:27:38 -04:00
David Zeuthen
87fa3a6e75 GDBus: Take a reference to the GDBusInterfaceInfo object
Things will still work fine if the GDBusInterfaceInfo is allocated
statically because if so the ref_count will be -1.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-30 12:19:28 -04:00
David Zeuthen
5ac2722975 GDBus: Rename introspection_data' parameter to interface_info'
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-30 12:18:49 -04:00
David Zeuthen
038d03cd08 Bug 623142 – Ensure ::new-connection runs before processing D-Bus messages
Without this guarantee, peer-to-peer connections are not very
useful. However, with this guarantee it's possible to export objects
in a handler for the GDBusServer::new-connection signal.

There are two caveats with this patch

 - it won't work on message bus connections
 - we don't queue up messages to be written

that can be addresses later if needed.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-30 11:51:40 -04:00
Ryan Lortie
137ae2413c g_settings_list_keys() -> _list_items()
This function returns children as well.
2010-06-30 10:02:45 -04:00
Ryan Lortie
3628b0b499 GSettings: add <override>, tests, modify output
Add <override> tag, more tests, and actually output the results of these
new tags to the gschemas.compiled file.
2010-06-29 20:24:39 -04:00
Ryan Lortie
900a756e8f GSettings: new <schema> tags 'extends', 'list-of'
Add support for extends='' and list-of='' tags to the <schema> element.
The attributes are parsed and some sanity-checking is done but currently
nothing happens as a result.

Add some tests.
2010-06-29 15:58:35 -04:00
Ryan Lortie
101bfec676 glib-compile-schemas: fix small leak 2010-06-29 15:58:35 -04:00
David Zeuthen
6d4ade4cf0 Bug 623143 – Never require non-closed connections
There's a couple of places in GDBus where it's a programming error
(e.g. we'll assert or spew via e.g. g_warning()) to use the API on a
closed connection.  This approach can never work since a
GDBusConnection can be closed at any point in time outside of
programmer control.

Just change the code to return a run-time error (e.g. return
G_IO_ERROR_CLOSED when sending messages, invoking methods) or silently
accept the request (e.g.  exporting objects, registering for signals)
without doing anything.

Note that a GDBusConnection object is always useless after being
closed - e.g.  there's no way to "reopen" a connection - the user will
have to create a new object and use that instead.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-29 15:21:11 -04:00
Ryan Lortie
8a7d990698 Bug 622565 - compile-schemas fails when no schemas
Neutralise and deprecate the --uninstall option in the schema compiler
and remove it from gsettings.m4.

Make the new default behaviour a compromise between the old default
behaviour and the previous --uninstall option:

  - never return a failure code if no schema files are found

  - issue a warning instead

  - remove the gschemas.compiled file if it exists
2010-06-28 14:06:32 -04:00
Ryan Lortie
ab1111b8bb GSettings: peek instead of ref/unref enum class
We only ever do the enum mapping for the property binding in the case
that a GParamSpecEnum exists and in that case the class is already
referenced by the GParamSpec.  Use peek instead of ref/unref and add a
clarifying note.
2010-06-28 13:58:25 -04:00
Ryan Lortie
168cfc5922 Bug 622127 - GSettings extended key validation
First shot at attempting to implement this in a reasonable way.  See
the bug for more information about why this is needed.
2010-06-28 10:20:50 -04:00
Matthias Clasen
d20969e07b Filter out child schema entries when listing keys 2010-06-27 16:31:53 -04:00
Matthias Clasen
025435329a Implement bash completion for gsettings 2010-06-27 16:00:20 -04:00
Ryan Lortie
795d2bf8cf GSettings: Don't free value before using its type
Fix a bug where the type from g_variant_get_type() was used after
freeing the variant.  This works for base types (since they are cached
and live forever) but not for arrays (where the bug was first seen).
2010-06-27 10:12:59 -04:00
Ryan Lortie
7cdc592ae4 Bug 622128 - retry with default for failed mapping
Hold the GSettingsKeyInfo as part of the binding structure to save work
on each get/set.  Use our copy of this structure to call the internal
get/set APIs.  Give more descriptive error messages in the case of
invalid data on sets and retry using the translated default then schema
default value in case of failure to map on reads.
2010-06-25 10:56:41 -04:00
Ryan Lortie
de0464cf89 Tweak GSettings key/schema listing APIs 2010-06-24 12:25:48 -04:00
Ryan Lortie
e3d0d07b04 Clarify GSettings documentation wrt errors
Make it clear about exactly what "@key is valid" means.
2010-06-24 02:28:01 -04:00
Ryan Lortie
887d9d83aa g_keyfile_settings_backend_new doc improvement 2010-06-24 02:21:58 -04:00
Ryan Lortie
123699465d GSettings: add g_settings_list_keys()
Second half of bug #622554.
2010-06-24 02:17:34 -04:00
Ryan Lortie
6218d8047a Add g_settings_schema_exists
Solves half of #622554.
2010-06-24 02:17:28 -04:00
Ryan Lortie
726e4dd6e7 KeyfileSettingsBackend: fix symbol visibility leak 2010-06-24 02:17:22 -04:00
Ryan Lortie
65fc931fb9 Rework the GSettings keyfile backend 2010-06-24 01:39:12 -04:00
Ryan Lortie
6d828dae38 GSettingsBackend: some debug code 2010-06-24 00:55:30 -04:00
Ryan Lortie
519edcc2b3 fix leaks in the GSettings test case 2010-06-24 00:39:38 -04:00
Ryan Lortie
f76c4d0629 GSettings "delayed": don't leak unapplied keys
GDelayedSettingsBackend was leaking the GTree holding the list of
unapplied keys on finalize.
2010-06-24 00:39:38 -04:00
Ryan Lortie
d3af9c0ec5 neutralise pltcheck.sh 2010-06-23 10:12:14 -04:00
Matthias Clasen
13ac216ca3 GIO doc cleanups 2010-06-23 09:25:30 -04:00
David Zeuthen
6920e503e6 GDBusProxy: Don't warn when calling methods on other interfaces
If we know the expected interface (e.g. :g-interface-info is set),
then we always warned when calling a method on a different
interface. Don't do that, there's no way the expected interface can
know anything about this method.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-22 17:48:35 -04:00
Dan Winship
d68f8012b2 gio/tests/testapps: Fix source refcounting
Either child_watch_source or timeout_source will already have been
destroyed after we finish the loop, and it's not safe to call
g_source_destroy() on it a second time unless we're still holding a
ref on it.
2010-06-22 15:37:42 -04:00
Dan Winship
a0e1b226a2 GSocketConnection: don't close the socket if it's still reffed
When disposing a GSocketConnection, don't explicitly close the
underlying GSocket. The GSocket will close itself if it gets
destroyed, and if it doesn't get destroyed, that presumably means the
app still wants to use it. Eg, this lets you use GSocketClient to
create a GSocketConnection, and then take the GSocket and destroy the
GSocketConnection.

https://bugzilla.gnome.org/show_bug.cgi?id=616855
2010-06-22 15:25:28 -04:00
Dan Winship
e0ff84e688 GSocketInput/OutputStream: fix non-blocking on Windows
The GSocket docs point out that g_socket_send/g_socket_receive may
return G_IO_ERROR_WOULD_BLOCK even if g_socket_condition_check claimed
that they wouldn't. Fix the socket streams to check for that.

https://bugzilla.gnome.org/show_bug.cgi?id=603309
2010-06-22 15:20:29 -04:00
David Zeuthen
2be38f6926 GDBus: update padding
Add lots of padding for public class structures. Notably, we seemed to
lack any padding whatsoever in the GDBusMessageClass struct (spotted
by Dan Winship). Also switch to using

 gpointer padding[N];

instead of

 void (*_g_reserved1) (void);
 ...
 void (*_g_reservedN) (void);

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-22 12:14:31 -04:00
Matthias Clasen
d19380c809 Improve g_application_new documentation
Patch by Saleem Abdulrasool, bug 622154.
2010-06-22 08:24:30 -04:00
Tor Lillqvist
efb1a054b0 Fix build with the Microsoft compiler
Correct a few gccisms and C99isms. Ensure the Windows-specific gio
source files are listed in the generated gio VS project file.
2010-06-22 12:22:46 +03:00
Tor Lillqvist
2e84249082 Bypass a few functions not used on Windows when compiling for Windows 2010-06-22 12:16:14 +03:00
David Zeuthen
45411ccbe3 Bug 621945 – Filter outgoing messages in GDBusConnection
This patch breaks some rarely-used public API (only known user is
dconf).

This patch is based on work from Peng Huang <shawn.p.huang@gmail.com>.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-21 16:12:23 -04:00
Ryan Lortie
c9553af68f Use -Bsymbolic-functions, drop g*alias PLT hackery
This is a minimal patch-out of the galias functionality.  We will do a
release like this so that we can easily back it out if there are
reported problems.

A more substantial cleanup (mostly removing #includes from every file)
will follow if there are no issues.
2010-06-21 13:55:28 -04:00
Ryan Lortie
e549bbf664 distcheck fix 2010-06-21 13:25:51 -04:00
Ryan Lortie
7556f660b5 Remove gsettings-schema-convert tool
Having this tool in GLib is a bad idea for a number of reasons:

  - experience has shown that the simple file format was a bad idea

  - the tool is currently implemented with a hack that would require a
    dependency inversion to solve (the tool needs to depend on Python
    GVariant bindings)

  - the tool itself is unmaintained

It will be moved to the GConf git repository so people can continue to
use it for the purpose of converting GConf schemas.
2010-06-21 13:24:40 -04:00
Christian Persch
fc5f3a96be Docs fix 2010-06-20 13:35:41 +02:00
Ryan Lortie
ea6470e31a GSettings: complete support for enum binding 2010-06-19 16:14:23 -04:00
Milan Bouchet-Valat
a558e460a2 Fix gsettings tool crash, part 2
Same as previous commit, but for two other functions it missed.
2010-06-19 19:00:13 +02:00
Milan Bouchet-Valat
62939f5e45 Fix gsettings tool crash
When no path is provided for the schema, we have call
g_settings_new() instead of g_settings_new_with_path()
passing a NULL path.

This was crashing the tool on start since an assertion was
recently added to g_settings_new_with_path() to refuse NULL.
2010-06-19 18:33:26 +02:00
Ryan Lortie
a768953760 Fix bug in strinfo
We can't search for a larger needle inside of a smaller haystack, and
unsigned integer subtraction tends to result in very large numbers
rather than small ones.

Add a check for this case and abort out immediately.

Also add a test case (lifted directly from the docs) that demonstrates
the problem.

Issue discovered and tracked down by Milan Bouchet-Valat
2010-06-19 11:41:30 -04:00
Jürg Billeter
1ed105b19b GDBus: Sink closures in _with_closures functions
See https://bugzilla.gnome.org/show_bug.cgi?id=621092#c12

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-18 19:28:31 -04:00
Colin Walters
8f5bde679e [GApplication] Add working directory to platform data
https://bugzilla.gnome.org/show_bug.cgi?id=621838
2010-06-18 16:05:00 -04:00
Tor Lillqvist
6ff13071ae Fix build on non-Unix 2010-06-18 10:57:00 +03:00
Matthias Clasen
9b59059d9e Fix distcheck 2010-06-17 19:08:52 -04: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
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
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
Christian Persch
10e430bcc0 Fix GApplication for the G_TYPE_VARIANT change 2010-06-17 21:41:09 +02: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
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
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
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
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
597290d5c8 GSettings: major refactor. Add enums, range. 2010-06-16 18:17:53 -04: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
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
Hib Eris
b079d6a546 Use native glib-compile-schemas when cross compiling 2010-06-15 00:38:35 -04:00
Colin Walters
85210bcf9b Switch to using variants for timestamps, split out signals
Like how we're handling activation, use GVariant for timestamps.  To
avoid polluting the GtkApplication API with GVariants, we rename the
GApplication signals to "quit-with-data" and "action-with-data".
GtkApplication will then wrap those as just "quit" and "action".

https://bugzilla.gnome.org/show_bug.cgi?id=621002
2010-06-14 16:36:23 -04:00
Christian Persch
8c4e1fa0af Add --xml to gdbus-tool to print raw introspected XML
Bug #621442.
2010-06-14 00:02:57 +02:00
Matthias Clasen
fdb15058a4 Avoid a race in application registration
We need to register the object before taking the name.
Remove the workarounds for this race from the test suite.
2010-06-13 01:03:10 -04:00
Matthias Clasen
19012ada57 Accept no-reply errors
This can happen if the app quits before the dbus reply can be
sent out.
2010-06-12 01:55:25 -04:00
Matthias Clasen
330cdfbdf1 Make the tests not fall over every other time 2010-06-11 23:21:49 -04:00
David Zeuthen
32f2e9a85b Bug 621213 – GDBusProxy and well-known names
Allow constructing a GDBusProxy for well-known names as discussed here
http://mail.gnome.org/archives/gtk-devel-list/2009-October/msg00075.html
including test cases.

Make it possible to create a GDBusProxy for a GBusType instead of a
GDBusConnection. This requires G_BUS_TYPE_NONE so add that too.

Nuke g_bus_watch_proxy() since one can now more or less use GDBusProxy
for this.

Port gdbus-example-watch-proxy to this new API and include this
example in the GDBusProxy doc page.

Also nuke the GType parameter from the GDBusProxy constructors as
requested here: https://bugzilla.gnome.org/show_bug.cgi?id=621229

Also update the porting guide and other API docs for this change.

Also fix a bug in the signal dispatching code so each subscriber only
get notified once, not N times, for the same signal. Also add a test
case for this.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-11 18:21:27 -04:00
Ryan Lortie
e0f8d30dea gitignore GApplication test-cases 2010-06-11 14:52:34 -04:00
Felix Riemann
0fc60514fc Close memory leak in GSettings
Fixes bug #621252.
2010-06-11 20:38:48 +02:00
Alexander Larsson
aeb41b56e1 converter streams: make code more readable
The name buffer_availabile was kinda confusing, so its been renamed
to buffer_data_size() to match buffer_data().

Also I added a comment to buffer_ensure_space because its behaviour
wasn't obvious.
2010-06-11 09:59:56 +02:00
Jürg Billeter
6858ab2033 Use correct offset for buffer data in GConverterOutputStream
Otherwise we overwrite already converted data in the case that more
than one call to g_converter_convert is necessary in write() or
flush().

https://bugzilla.gnome.org/show_bug.cgi?id=619945
2010-06-11 09:55:31 +02:00
Jürg Billeter
86592d675f Ensure we always have some target space in GConverterOutputStream
When the converter fills the whole buffer without reading all input,
we need to enlarge the buffer. Otherwise we get an assertion failure
for `outbuf_size > 0' in g_converter_convert.

https://bugzilla.gnome.org/show_bug.cgi?id=619945
2010-06-11 09:55:23 +02:00
Christian Dywan
85ea72c0c5 Add a regression test for GConverterOutputStream corruption
See bug #619945 for background
2010-06-11 09:46:47 +02:00
Ryan Lortie
ceee4c21a3 GSettings test case fixes
- call g_settings_sync()
 - fix bug #618715 by not forking if a backend is specified via
   environment variable
2010-06-10 22:35:31 -04:00
Ryan Lortie
a8b5353b14 Add g_settings_sync() and use it 2010-06-10 22:30:44 -04:00
Colin Walters
7c36619d26 [Gio] Merge in introspection annotations from gobject-introspection gio-2.0.c
This is not an exhaustive set, but covers everything we have so far.
2010-06-10 14:03:02 -04:00
Ryan Lortie
3a062d2e33 GSettings: store (default, options) in gvdb
gvdb just dropped the ability to have a separate "options" field.  We
now store the options into a GVariant along with the default value.

For now, we use a small shim in GSettingsSchema in order not to touch
too much code.  A more complete rewrite will follow.

This represents a change to the schema file format with another likely
to follow.  glib-compile-schemas needs to be re-run after installing
this change.
2010-06-10 13:49:57 -04:00
Ryan Lortie
7300702179 Merge remote branch 'gvdb/master' 2010-06-10 13:35:25 -04:00
Tomeu Vizoso
45e604d029 Add _with_closures alternative functions for those in GDBus that
accept more than one callback.

g_bus_own_name_with_closures
g_bus_own_name_on_connection_with_closures
g_bus_watch_name_with_closures
g_bus_watch_name_on_connection_with_closures
g_bus_watch_proxy_with_closures
g_bus_watch_proxy_on_connection_with_closures

https://bugzilla.gnome.org/show_bug.cgi?id=621092
2010-06-10 18:29:23 +02:00
Colin Walters
8cab5e4693 [GApplication] Tweak docs a bit 2010-06-10 13:14:29 -04:00
Colin Walters
cc19922183 Rewrite apps test to ensure children are killed
Create a function run_with_application that both ensures the
app is running exactly while the test is running, which most
of the tests use.  We start it beforehand, and kill it after.
This avoids having any interdependence between the tests (and
there definitely was before, because we didn't wait for
the process to actually terminate after a kill() call).

Also, open a pipe between the two, and have the child app
monitor that pipe.  If it gets closed (e.g. because the parent
died), the child exits.  This is the most reliable way to
avoid stale children; before, if we failed an assertion, the
parent would abort, and not run kill().

https://bugzilla.gnome.org/show_bug.cgi?id=621034
2010-06-10 13:14:29 -04:00
Matthias Clasen
6720596544 Fix GApplication tests to run without a session bus
We reuse code from the GDBus tests here to launch a session bus.
2010-06-09 23:44:13 -04:00
David Zeuthen
db0c55608f GDBusConnection: Do not dispatch calls to unregistered objects or subtrees
There was a slight race where we ended up calling into user code if
the user managed to unregister an object (or subtree) in the window
between

 - processing the remote call on the worker thread; and
 - continuing handling it on the user code thread (via an idle handler)

This patch fixes the problem.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-09 17:57:04 -04:00
David Zeuthen
ed7f59770e GDBusProxy: Fix error handling in synchronous initialization codepath
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-09 17:09:10 -04:00
David Zeuthen
1951c39c44 Bug 621119 – GDBusProxy and objects with no properties
Fix proxy construction for objects with no properties in the case
where G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES isn't set.

The unfortunate side-effect here is that GDBusProxy can no longer be
used to test for "object existence", e.g. creating a GDBusProxy for
any path and interface will not fail. But that's not really a big
deal, if apps rely on that they are doing something very wrong.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-09 10:59:02 -04:00
Juan A. Suarez Romero
67193f55c3 Fix warning
Disable functions defined but not used.
2010-06-09 10:32:36 +02:00
Juan A. Suarez Romero
992e07c8b2 Fix warnings
Do explicit casts to avoid warnings.
2010-06-09 10:32:12 +02:00
Christian Persch
d8dca11733 Fix thinko
When replacing strcmp() with g_variant_is_of_type(), remove the "== 0"
part! Found by Colin Walters.
2010-06-08 19:43:30 +02:00
Colin Walters
0ed183b572 [GDBusConnection] Use Gio's default async implementation again
The fix was committed in git.

https://bugzilla.gnome.org/show_bug.cgi?id=620990
2010-06-08 13:44:19 -04:00
Christian Persch
06e74ca969 g_dbus_method_invocation_return_value consumes the floating variant
Bug #620953.
2010-06-08 17:41:47 +02:00
Christian Persch
2ab9a07ec7 Simplify variant builder
Build the full return value with one builder, and don't unref the
unowned return value!

Bug #620954.
2010-06-08 17:41:47 +02:00
Christian Persch
d3b091f63a Use g_variant_is_of_type()
... instead of strcmp()'ing the type strings.

Bug #620954.
2010-06-08 17:41:46 +02:00
Christian Persch
b75e7eb95d Plug a mem leak
Bug #620954.
2010-06-08 17:41:46 +02:00
Javier Jardón
471c4e413c [docs] Fix typos in some g_file_* functions
Reported by Alexander Saprykin in bug
https://bugzilla.gnome.org/show_bug.cgi?id=620947
2010-06-08 16:27:45 +02:00
Matthias Clasen
795ddeb421 Add missing marshaler 2010-06-07 23:41:06 -04:00
Matthias Clasen
e300c7e622 Fix a missing parameter in a doc comment
Pointed out by David Zeuthen.
2010-06-07 23:28:30 -04:00
Matthias Clasen
a89b10c1dc Fix a signal signature
GApplication::action was erroneously declaring the timestamp parameter
as int instead of uint.
2010-06-07 23:27:21 -04:00
Matthias Clasen
063470ea0d Fix a misspelt doc comment 2010-06-07 22:34:07 -04:00
Matthias Clasen
32b7fbb890 Rename GApplication::appid to GApplication::application-id 2010-06-07 22:21:47 -04:00
Matthias Clasen
c59cc94318 Fix !srcdir checks 2010-06-07 22:10:27 -04:00
Matthias Clasen
fdc99873ee Document signals 2010-06-07 21:23:42 -04:00
Javier Jardón
d68100afcc [docs] GApplication is available since Gio 2.26 2010-06-08 00:00:39 +02:00
Matthias Clasen
c2a539eff0 Use g types for consistency 2010-06-07 17:48:09 -04:00
Matthias Clasen
6427e93757 Merge the wip/gapplication branch
This adds a GApplication object to GIO, which is the core of
an application support class, supporting
- uniqueness
- exporting actions (simple scripting)
- standard actions (quit, activate)

The implementation for Linux uses D-Bus, takes a name on the
session bus, and exports a org.gtk.Application interface.

Implementations for Win32 and OS X are still missing.
2010-06-07 13:48:42 -04:00
Matthias Clasen
486c46b945 Include the right header 2010-06-07 06:24:28 -04:00
Ryan Lortie
71c5e3f899 Bug 620496 - schema compiler: reject invalid paths
The GSettings schema compiler was accepting any string as a path.  It is
probably quite a common mistake to suspect that '/apps/foo' is a valid
path name when this will cause all sorts of trouble later.  Check for
this case and report the error.
2010-06-07 10:18:43 +02:00
Christian Persch
87ee5f3641 Don't do an extra strlen when g_variant_get_string() returns it already 2010-06-06 16:32:04 -04:00
Matthias Clasen
2aca3b506a Add single-include guards to new headers
As pointed out by Christian Persch in bug 620173, all the new
gdbus and gsettings headers were missing these.
2010-06-06 16:20:21 -04:00
Matthias Clasen
9371ca0cc2 Sort gio.h includes alphabetically 2010-06-06 16:15:44 -04:00
Michael Natterer
3944a63fed gio: fix the build 2010-06-06 21:15:42 +02:00
Matthias Clasen
92fab48387 Some cleanups
Always include config.h, make property strings for translation,
add since tags.
2010-06-06 14:24:14 -04:00
Ryan Lortie
61f3f45cb9 add get_permission API to GSettingsBackend
implement it in the various in-tree backends

also, lots of whitespace changes to realign the vtable members
2010-06-05 00:10:05 +02:00
Ryan Lortie
95c564cabe gsettingsbackend.h: pretend to be gio.h
Since #include <gsettingsbackend.h> is a perfectly valid thing for
applications to do, and since we want to include gio headers from
gsettingsbackend.h, we need to effectively disable the #error we would
get from those headers (because we're not coming via gio.h).

We don't want to #include <gio/gio.h> here because this would cause
needless rebuilding of GSettingsBackend, GSettings,
GDelayedSettingsBackend, etc... every time someone changed anything in
any public header.
2010-06-04 23:02:44 +02:00
Ryan Lortie
4733488178 Bug 620582 - a simple GPermission implementation
add GSimplePermission, a trivial const implementation of GPermission

can-request and can-release are always false for this implementation and
the value of 'allowed' is decided at construction.
2010-06-04 22:35:14 +02:00
Ryan Lortie
7a4860d69a Bug 620519 - GPermission
Add an abstract interface representing the permission to perform an
action.
2010-06-04 19:03:38 +02:00
Murray Cumming
07b5cee2a8 Gio: gioenums.h: Remove trailing commas to avoid C++ warnings. 2010-06-04 17:07:05 +02:00
Javier Jardón
af3f4cbe77 gdbusaddress: Fix typo 2010-06-04 01:35:23 +02:00
Matthias Clasen
e608b1f067 Don't spew a g_warning if inotify setup fails
We use is_supported when we are trying to find a local file monitor
implementation that works, and having the g_warning in there trips
the test suite.
2010-06-03 11:42:59 -04:00
Milan Bouchet-Valat
3682666140 Annotate GVariant and GSettings _strv() functions
Add GObject introspection annotations so that the length parameter is
correctly detected for g_variant_new_strv(), g_variant_get_strv() and
g_variant_dup_strv(). Also specify that it can be a NULL pointer in
g_variant_get_strv() and g_variant_dup_strv().

For g_settings_set_strv(), detect that a NULL value is allowed, meaning
empty array.

Closes bug #620384.

Signed-off-by: Ryan Lortie <desrt@desrt.ca>
2010-06-02 19:37:30 +02:00
Ryan Lortie
b5c8496b4c Support NULL value for g_settings_set_strv()
Allow easy setting of the empty array that we lost with the last patch.
2010-06-02 04:00:58 +02:00
Milan Bouchet-Valat
bf9edb5cd5 Remove length parameter for g_settings_[gs]et_strv
Length of the array is redundant since it's NULL-terminated. This is not
consistent with many GLib and GTK+ functions, and adds complexity with
no real gain, while these convenience functions should be kept simple.

Closes bug #620312
2010-06-02 03:54:23 +02:00
Lin Ma
c874a76a8b After talk with FEN dev, we dicide simply disable monitor function if
the current filesystem doesn't suport FEN.
2010-05-28 16:58:56 +08:00
Lin Ma
866e3dda60 Remove unused code. 2010-05-27 10:24:58 +08:00
Lin Ma
798eed43a2 bugster#6955199, on hsfs portfs will fail, and FEN backend will fail
to run lstat and port_associate on root node.
2010-05-26 14:32:37 +08:00
David Zeuthen
eec66b2f94 GDBus: Big-endian fixes
Tested this on my Powerbook G4 12", 867MHz PowerPC G4 running Fedora
11ish.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-25 12:03:27 -04:00
Matthias Clasen
9e25ec592b Document that vtable is not copied 2010-05-25 10:44:19 -04:00
Ryan Lortie
84a0605342 change GSettingsBackend.list() API 2010-05-24 22:20:47 -04:00
Matthias Clasen
1b7f645492 Improve the g_file_make_symbolic_link docs
Following a proposal by Neil Williams in bug 619527.
2010-05-24 21:09:55 -04:00
Ryan Lortie
77b9a46461 GIO: Add g_d{,c}gettext to PLT check exceptions 2010-05-24 17:03:26 -04:00
Ryan Lortie
3160bcad6a GDBusConnection.call(): add 'reply_type' argument
This allows the caller to specify the reply type that they are expecting
for this call.  If the reply comes back with the wrong type, GDBus will
generate an appropriate error internally.

  - add a GVariantType * argument to g_dbus_connection_call() and
    _call_sync().

  - move the internal API for computing message types from introspection
    data to be based on GVariantType instead of strings.  Update users
    of this code.

  - have GDBusProxy pass this calculated GVariantType into
    g_dbus_connection_call().  Remove the checks done in GDBusProxy.

  - Update other users of the code (test cases, gdbus-tool, GSettings
    tool, etc).  In some cases, remove redundant checks; in some other
    cases, we are fixing bugs because no checking was done where it
    should have been.

Closes bug #619391.
2010-05-24 17:00:04 -04:00
Tor Lillqvist
a83a9a43ed Most of the gdbus test programs build only on Unix 2010-05-24 11:22:41 +03:00
David Zeuthen
bf24dff88e Return an error for calls into unknown interfaces or unknown objects
Ryan pointed out on IRC that we didn't do anything here. Looking at
the code, it's painfully obvious that we should be returning an error
here since a comment already says that we've exhausted all possible
options.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-21 12:11:04 -04:00
Christian Persch
c7f0f2c437 Use stack-allocated GVariantBuilders
This saves a few allocations.
Also simplify the code a bit in gdbusconnection.

Bug #618616.
2010-05-20 21:17:14 +02:00
Christian Persch
41b3f6885d Add g_dc[p]gettext, and use it in gsettings
Avoid using LC_MESSAGES, and just call g_d[c]gettext directly.

Bug #617004.
2010-05-20 21:16:29 +02:00
David Zeuthen
366b3ffcde Bug 619142 – Build fixes
- Fix various #include issues

 - Change #error to #warning for the EXTERNAL authentication mechanism.
   It is not clear if this should work on Win32 at all.

 - Call close() before unlink() for the SHA1 keyring

 - Change #error to #warning so we don't forget to do
   permission checking of the .dbus-keyrings directory

 - Use Win32 SID for the SHA1 auth mech

 - Apparently we can't use word 'interface' as an identifier

 - Implement a _g_dbus_win32_get_user_sid() function. For now it's
   private. Don't know if it should be public somewhere. Maybe in
   a future GCredentials support for Win32? I don't know.

 - GFileDescriptorBased is not available on Win32. So avoid using
   it in GLocalFile stuff. Now, Win32 still uses GLocalFile + friends
   (which works with file descriptors) so expose a private function
   to get the fd for an OutputStream so things still work.

 - Fixup gio.symbols

 - Fixup tests/gdbus-peer.c so it builds

With this, at least things compile and the gdbus-peer.exe test case
passes. Which is a great start. I've tested this by cross-compiling on
a x86_64 Fedora 13 host using mingw32 and running the code on a 32-bit
Windows 7 box.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-20 10:53:08 -04:00
Ryan Lortie
caae8ac57a Add --uninstall option to glib-compile-schemas
If --uninstall is given then don't give an error if the schema directory
is empty.  Instead, erase the gschemas.compiled file, if it exists.
This is the right thing to do in the 'make uninstall' rule, where the
schema directory could very well be left empty as a result.

Modify gsettings.m4 to use this option.
2010-05-19 16:02:05 -04:00
Javier Jardón
257c519ba2 Fix trivial typo in GCredentials code
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=618839
2010-05-18 23:45:54 +02:00
Ryan Lortie
719e2dcb3b Bug 619031 - method-calls-in-thread test failing
The test was assuming that g_timeout_add() waited for at least the amount of
time given to it before running the function.  This is not the case -- the
function can be run as much as 1ms early.  Make the lower time bound asserted
in the test more permissive to account for this.
2010-05-18 17:25:43 -04:00
Ryan Lortie
6067f9f794 Bug 618839 - Typo at translation message
Fix trivial typo in GCredentials code
2010-05-18 16:43:36 -04:00
Ryan Lortie
12a8c0f50d Add sync method to GSettingsBackend, and pad 2010-05-18 16:14:50 -04:00
Ryan Lortie
7fcf353325 whitespace fix 2010-05-18 16:14:50 -04:00
Robert Ancell
587bdf3f0a Add missing gunixfdlist.h include in gdbus-example-server.c 2010-05-18 12:01:25 +10:00
David Zeuthen
a977f03235 GDBus: Fix obvious crasher when looking up annotations
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-17 19:52:09 -04:00
David Zeuthen
a621e0ed10 gdbus(1): Don't fetch props if introspection data indicates none are available
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-17 11:08:53 -04:00
David Zeuthen
98e4f7f6fb GDBus: Fix introspection of objects registered at /
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-17 11:08:40 -04:00
Ryan Lortie
799e0242ae improve thread safety in GDelayedSettingsBackend
- hold a lock while accessing the tree of delayed values
  - use weak reference counts with the owner object to avoid doing
    g_object_notify on a dead object
  - dispatch the "has-unapplied" notify to the proper main context
2010-05-17 07:16:37 -04:00
Ryan Lortie
61219e2640 GSettingsBackend: make signal dispatch threadsafe
This commit fixes up a few race conditions in the GSettingsBackend, mostly with
respect to change notifications occuring at the same time as the last reference
count on a GSettings is dropped.  With GDBus feeding us our incoming signals in
a separate thread, this is something that could easily happen.
2010-05-17 07:16:37 -04:00
Ryan Lortie
4967b6d2ab gitignore additions for gdbus, new test cases 2010-05-17 07:16:37 -04:00
Ryan Lortie
984258c662 GSettings: support emitting signals in threads
The thread-default context that was in effect at the time that the
GSettings was created will be used for emitting signals on that
GSettings.
2010-05-17 07:16:37 -04:00
Ryan Lortie
849684e540 GSettings tool: work-around GDBus issue
There is currently no way (near as I can tell) to ensure that a message
has been sent when using GDBus.  If we exit() before we are sure, then
it is very possible that the message isn't sent at all.  This behaviour
was observed when using the GSettings commandline tool with dconf.

A quick and dirty workaround for now.
2010-05-17 07:16:37 -04:00
Ryan Lortie
8e060adb2c intern a key name instead of using strdup() 2010-05-17 07:16:37 -04:00
Lin Ma
e5440f865d Reworked Solaris file event notification for GIO. See
https://defect.opensolaris.org/bz/show_bug.cgi?id=10194

Updated copyright.
2010-05-17 14:42:52 +08:00
Sebastian Dröge
5d379f1c37 Fix gio tests linking with binutils gold linker 2010-05-16 10:22:10 +02:00
Sebastian Dröge
e6c08a458c Fix build of gdbus tool with binutils gold linker 2010-05-16 10:22:10 +02:00
Matthias Clasen
2ad4b2d716 Fix build on !linux
Don't define __USE_GNU, thats a glibc-internal macro, and
don't use SOL_SOCKET when not including sys/socket.h.
Maybe this file should be called glinuxcredentialsmessage.c...

Bug #618730
2010-05-15 18:16:51 -04:00
Matthias Clasen
2ed13de153 Fix issues with GSETTINGS_CHECK_RULE
Rename the --schema-files option to --schema-file, since it only
accepts one file at a time. Change the GSETTINGS_CHECK_RULE to
use it that way, too. And also make it work better with !srcdir
builds.

Bugs #616731 and #616864
2010-05-14 21:58:08 -04:00
David Zeuthen
763c1dab1f GDBus: Use specific variant type in GetAll()
Without this fix, we segfault if the exported object returned an error
on all get_property() calls (in reality, this never happens).

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-14 21:08:01 -04:00
David Zeuthen
4baf104f0a GDBus: Fix a double free
Fix an unintentional double free introduced in commit
4ad4c306c3.

This bug manifested itself when trying to complete this

 $ gdbus introspect --system --dest <tab>
2010-05-14 20:52:15 -04:00
Christian Persch
661e5ea69f Plug mem leaks in gdbus tests & examples
Use "&s" instead of "s", and free the variant iters after use.

Bug #618663.
2010-05-15 00:12:18 +02:00
Christian Persch
60c53fef47 Plug a mem leak in gdbusauth
From valgrind running gdbus-peer test:

==20513== 32 bytes in 1 blocks are definitely lost in loss record 1 of 15
==20513==    at 0x4024E4C: realloc (vg_replace_malloc.c:429)
==20513==    by 0x4079BB1: g_realloc (gmem.c:174)
==20513==    by 0x4099472: g_string_maybe_expand (gstring.c:396)
==20513==    by 0x409A42A: g_string_insert_c (gstring.c:1050)
==20513==    by 0x42169AC: g_string_append_c_inline (gstring.h:153)
==20513==    by 0x421682C: _my_g_input_stream_read_line_safe (gdbusauth.c:336)
==20513==    by 0x421843E: _g_dbus_auth_run_server (gdbusauth.c:1265)
==20513==    by 0x4222B94: initable_init (gdbusconnection.c:1783)
==20513==    by 0x41CF8D5: g_initable_init (ginitable.c:106)
==20513==    by 0x41CFA8D: g_initable_new_valist (ginitable.c:219)
==20513==    by 0x41CF920: g_initable_new (ginitable.c:139)
==20513==    by 0x4223479: g_dbus_connection_new_sync (gdbusconnection.c:2046)

Bug #618650.
2010-05-15 00:12:18 +02:00
Christian Persch
5bc9d43288 Plug mem leak in g_dbus_address_get_stream_sync
==6279== 21,615 (4,708 direct, 16,907 indirect) bytes in 169 blocks are
definitely lost in loss record 12 of 13
==6279==    at 0x4024D2E: malloc (vg_replace_malloc.c:207)
==6279==    by 0x4079A90: g_malloc (gmem.c:135)
==6279==    by 0x4079DC8: g_malloc_n (gmem.c:252)
==6279==    by 0x4097E66: g_strsplit (gstrfuncs.c:2434)
==6279==    by 0x42169A2: g_dbus_address_get_stream_sync
(gdbusaddress.c:875)

Bug #618622.
2010-05-15 00:12:17 +02:00
Christian Persch
dc39825aa3 Plug a mem leak in get_uninitialized_connection
Free the bus address after creating the singleton.

==26308== 39,736 (10,517 direct, 29,219 indirect) bytes in 388 blocks
are definitely lost in loss record 14 of 15
==26308==    at 0x4024D2E: malloc (vg_replace_malloc.c:207)
==26308==    by 0x4079A90: g_malloc (gmem.c:135)
==26308==    by 0x4079DC8: g_malloc_n (gmem.c:252)
==26308==    by 0x4095607: g_strdup (gstrfuncs.c:102)
==26308==    by 0x4216B9A: g_dbus_address_get_for_bus_sync
(gdbusaddress.c:961)
==26308==    by 0x422A7AE: get_uninitialized_connection
(gdbusconnection.c:5241)

Bug #618622.
2010-05-15 00:12:17 +02:00
Christian Persch
5b2c7f10bd Plug mem leaks in parse_value_from_blob
The result of read_string() was leaked.

Bug #618615.
2010-05-15 00:12:17 +02:00
Christian Persch
0a7c0ac74b Plug a mem leak
This code leaked the return value of g_variant_get_child_value();
use g_variant_get() instead and free the iter when done.
2010-05-14 18:08:29 -04:00
David Zeuthen
ddc94bd0a6 GDBus: Remove cached value if a property is invalidated
Also add a test case to catch this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-14 12:56:09 -04:00
David Zeuthen
bb6530eb34 GDBus: Fix serialization of empty arrays
It turns out that we didn't observe padding (neither when reading nor
writing) for empty arrays which (apparently) is needed according to
the D-Bus spec and reference implementation. A simple test case to
provoke this behavior is as follows (notice the lack of 4 bytes worth
of padding at position 0x0064):

 Error calling dbus_message_demarshal() on this blob: org.freedesktop.DBus.Error.InvalidArgs: Message is corrupted (Alignment padding not null)
 0000: 6c 01 00 01  2e 00 00 00  41 00 00 00  37 00 00 00    l.......A...7...
 0010: 08 01 67 00  08 73 61 7b  73 76 7d 61  73 00 00 00    ..g..sa{sv}as...
 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  11 00 00 00  30 31 32 33    Member......0123
 0050: 34 35 36 37  38 39 30 31  32 33 34 35  36 00 00 00    4567890123456...
 0060: 00 00 00 00  0e 00 00 00  09 00 00 00  53 6f 6d 65    ............Some
 0070: 74 68 69 6e  67 00                                    thing.

 The blob was generated from the following GVariant value:
 ('01234567890123456', @a{sv} {}, ['Something'])

 If the blob was encoded using DBusMessageIter, the payload would have been:

 0000: 6c 01 00 01  32 00 00 00  41 00 00 00  36 00 00 00    l...2...A...6...
 0010: 01 01 6f 00  08 00 00 00  2f 66 6f 6f  2f 62 61 72    ..o...../foo/bar
 0020: 00 00 00 00  00 00 00 00  03 01 73 00  06 00 00 00    ..........s.....
 0030: 4d 65 6d 62  65 72 00 00  08 01 67 00  08 73 61 7b    Member....g..sa{
 0040: 73 76 7d 61  73 00 00 00  11 00 00 00  30 31 32 33    sv}as.......0123
 0050: 34 35 36 37  38 39 30 31  32 33 34 35  36 00 00 00    4567890123456...
 0060: 00 00 00 00  00 00 00 00  0e 00 00 00  09 00 00 00    ................
 0070: 53 6f 6d 65  74 68 69 6e  67 00                       Something.
 ** ERROR:gdbus-serialization.c:547:check_serialization: code should not be reached
 Aborted

and this is now in the libdbus-1-using serialization test case.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-14 12:56:09 -04:00
Matthias Clasen
ee9b16242c another !srcdir build fix 2010-05-14 10:49:03 -04:00
Matthias Clasen
159f533abf More !srcdir build fixes 2010-05-14 10:25:31 -04:00
Ryan Lortie
d8d1a02c55 include gunixcredentialsmessage from unixsocket
fixes a build issue
2010-05-14 15:31:14 +02:00
Matthias Clasen
1d22b64843 Cleanups
Sort #includes a bit better, and don't include platform-specific
headers in gio.h.
2010-05-14 08:38:07 -04:00
Matthias Clasen
0540798991 Fix !srcdir build
Thankfully we already had a SRCDIR define.
2010-05-14 01:36:25 -04:00
Matthias Clasen
4e7764fb2d Documentation cleanups 2010-05-14 00:21:39 -04:00
Matthias Clasen
6223341cac Merge branch 'gdbus-merge'
Conflicts:
	docs/reference/gio/gio-docs.xml
	docs/reference/gio/gio-sections.txt
	gio/tests/Makefile.am
2010-05-13 23:08:34 -04:00
Matthias Clasen
6e8637e478 The default timeout is 25s 2010-05-13 22:15:47 -04:00
Matthias Clasen
bdc29f82d3 Document more floating variant details. 2010-05-13 21:53:51 -04:00
Matthias Clasen
e72f7f52de Add some more details to the long description 2010-05-13 21:45:18 -04:00
Matthias Clasen
8f89b63930 Clean up platform-specific includes
The problem was pointed out in bug 618029. To solve it, we moved
the GUnixFDList typedef to giotypes.h.
2010-05-13 20:29:04 -04:00
Ryan Lortie
e1fb92551f check for working gettext() before running tests 2010-05-14 01:01:40 +02:00
David Zeuthen
68078ed648 GDBus: Nuke G_BUS_TYPE_NONE 2010-05-13 18:04:48 -04:00
David Zeuthen
1fd55b8bbf GDBus: Remove g_dbus_is_activated()
It's generally hard to get this right so don't attempt to do so.
2010-05-13 17:44:42 -04:00
David Zeuthen
51446baa52 GDBus: subscribe to PropertiesChanged() before calling GetAll()
Otherwise there's a slight chance of a race.
2010-05-13 17:20:39 -04:00
David Zeuthen
0e2c708bb2 GDBus: Don't take a GError for g_dbus_proxy_get_cached_property_names()
We stopped doing this for get_cached_property() so no reason to do it
here.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-13 17:10:15 -04:00
David Zeuthen
3ca28ef718 GDBus: Update docs for GDBusProxy::g-properties-changed signal
Also update the example. See

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

for more details.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-13 16:57:29 -04:00
Christian Persch
e3f5d3c005 Make GVariant handling in PropertiesChanged more efficient
There's no need to re-build the a{sv} array, just get it right out of
the parameters. Also avoid some string copies.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-13 16:46:18 -04:00
Christian Persch
4ad4c306c3 Plug some mem leaks
g_variant_get (v, "s", &str) returns a string copy; use "&s" instead.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-13 16:43:41 -04:00
David Zeuthen
60e7ae26af GDBus: Add GDBusAuthObserver param in g_dbus_connection_new_for_address()
This is to match g_dbus_connection_new(). This extension allows us to
extend GDBusAuthObserver to also be used in client-side authentication
in the future (right now it's only used on the server-side).
2010-05-13 16:32:11 -04:00
David Zeuthen
cb753dfd49 GDBus: Rename ::deny-authentication-peer to ::authorize-authenticated-peer 2010-05-13 16:20:31 -04:00
Matthias Clasen
9e90b381f5 Remove the credentials argument from g_unix_connect_send_credentials()
Instead, make it always send the current credentials.
2010-05-13 14:29:39 -04:00
David Zeuthen
33952347ff GDBus: Make message serialization routines take capabilities param
This is needed to e.g. allow encoding maybe types (once we add
G_DBUS_CAPABILITY_FLAGS_MAYBE_TYPES) if, and only if, that capability
has been negotiated with the peer (via authentication).
2010-05-13 14:03:58 -04:00
Matthias Clasen
107b4d4bae remove the redundant interface_name parameter 2010-05-13 13:09:58 -04:00
David Zeuthen
82158afdad GDBus: Catch up with new PropertiesChanged signal
After a long discussion, this has finally been standardized in the
D-Bus spec. See

 http://lists.freedesktop.org/archives/dbus/2010-May/012667.html
 http://lists.freedesktop.org/archives/dbus/2010-May/012712.html

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-13 11:56:15 -04:00
Matthias Clasen
2d75583fb2 Fill out the export section of the migration guide 2010-05-13 01:04:29 -04:00
Matthias Clasen
9a065edf6f Add an example of exporting a GObject
This is more manual work than dbus-glib.
2010-05-13 00:40:41 -04:00
David Zeuthen
ea1e0496b0 GDBus: add 'monitor' verb to gdbus(1)
This uncovered a bug in name watching if the name wasn't activatable.

Also provoked the need for on_connection variants of g_bus_watch_name
(added g_bus_watch_proxy's variant as well).
2010-05-12 23:12:14 -04:00
David Zeuthen
9695c23d4c GDBus: Make gdbus(1) print annotations when introspecting data
Also make the gdbus-example-server include some example
annotations. The output looks like this:

$ gdbus introspect --session --dest org.gtk.GDBus.TestServer --object-path /org/gtk/GDBus/TestObject
node /org/gtk/GDBus/TestObject {
  interface org.freedesktop.DBus.Properties {
    methods:
      Get(in  s interface_name,
          in  s property_name,
          out v value);
      GetAll(in  s interface_name,
             out a{sv} properties);
      Set(in  s interface_name,
          in  s property_name,
          in  v value);
    signals:
      PropertiesChanged(s interface_name,
                        a{sv} changed_properties);
  };
  interface org.freedesktop.DBus.Introspectable {
    methods:
      Introspect(out s xml_data);
  };
  interface org.freedesktop.DBus.Peer {
    methods:
      Ping();
      GetMachineId(out s machine_uuid);
  };
  @org.gtk.GDBus.Annotation("OnInterface")
  @org.gtk.GDBus.Annotation("AlsoOnInterface")
  interface org.gtk.GDBus.TestInterface {
    methods:
      @org.gtk.GDBus.Annotation("OnMethod")
      HelloWorld(in  s greeting,
                 out s response);
      EmitSignal(@org.gtk.GDBus.Annotation.("OnArg")
                 in  d speed_in_mph);
      GimmeStdout();
    signals:
      @org.gtk.GDBus.Annotation("Onsignal")
      VelocityChanged(d speed_in_mph,
                      @org.gtk.GDBus.Annotation.("OnArg_NonFirst")
                      s speed_as_string);
    properties:
      @org.gtk.GDBus.Annotation("OnProperty")
        @org.gtk.GDBus.Annotation("OnAnnotation_YesThisIsCrazy")
      readonly s FluxCapicitorName = 'DeLorean';
      readwrite s Title = 'Back To C!';
      readonly s ReadingAlwaysThrowsError;
      readwrite s WritingAlwaysThrowsError = "There's no home like home";
      writeonly s OnlyWritable;
      readonly s Foo = 'Tick';
      readonly s Bar = 'Tock';
  };
};
2010-05-12 22:11:18 -04:00
Matthias Clasen
cce08f1973 Add a note about implemented standard interfaces 2010-05-12 21:55:09 -04:00
David Zeuthen
f909cb5b27 GDBusProxy: Remove error in get_cached_property() and add set_cached_property()
This makes it possible to use the cached properties mechanism even if
constructing the proxy with the DO_NOT_LOAD_PROPERTIES flag.

This is useful for cases where you obtain the and track object
properties out-of-band. For example, in udisks, the plan is to have
something like this

 Manager.GetObjects    (out ao paths, out aa{sa{sv}} all_properties);
 Manager.ObjectAdded   (o path, a{sa{sv}} all_properties);
 Manager.ObjectChanged (o path, a{sa{sv}} all_properties);
 Manager.ObjectRemoved (o path, a{sa{sv}} all_properties);

E.g. the first GetObjects() call will return *all* data about *all*
exported objects. Further, this way a client will only need to listen
these three signals (three AddMatch) on the Manager object and it will
never need to do GetAll() etc (e.g. can use DO_NOT_LOAD_PROPERTIES).

(Of course this only works if the client is interested in all
objects... while this is true for udisks it is generally not true for
other D-Bus services).

Also use expected_interface to check for programming errors.
2010-05-12 20:51:06 -04:00
David Zeuthen
d40767fc62 GDBus: Add an example of a GDBusProxy subclass 2010-05-12 15:52:08 -04:00
Matthias Clasen
7c0196f026 Update an example to the latest auth observer api 2010-05-12 13:01:40 -04:00
Jesse van den Kieboom
246db9bfdb Added test cases for g_output_stream_close_async
https://bugzilla.gnome.org/show_bug.cgi?id=617937
2010-05-12 09:21:12 +02:00
Jesse van den Kieboom
adc5162b74 Flush when closing output stream async
https://bugzilla.gnome.org/show_bug.cgi?id=617937
2010-05-12 09:21:06 +02:00
Matthias Clasen
e2b9d07765 Update TODO list 2010-05-11 23:26:51 -04:00
Matthias Clasen
a63d3bb868 mention inline use of floating variants 2010-05-11 23:18:48 -04:00
Matthias Clasen
ab2ff1a307 Remove properties from GDBusMethodInvocation class 2010-05-11 22:51:14 -04:00
Matthias Clasen
c4cf88c22f Document remove_filter 2010-05-11 22:50:40 -04:00
Matthias Clasen
d7095dd470 Document DBUS address env vars 2010-05-11 22:35:59 -04:00
Matthias Clasen
26f65d83c5 Don't refer to nonexisting API. 2010-05-11 21:59:42 -04:00
Matthias Clasen
e4b1e48fca Match up parameter names
and similar cleanups to make gtk-doc happy.
2010-05-11 20:57:44 -04:00
Matthias Clasen
1d43e4140b Line up prototypes 2010-05-11 20:03:44 -04:00
Matthias Clasen
54a57bb894 Strip copyright headers from examples
These are included wholesale in the docs, and the copyright
headers make them even more overwhelming. Plus, we don't have
copyright headers on examples anywhere else.
2010-05-11 15:50:19 -04:00
David Zeuthen
8c523c069b GDBus: Update TODO list 2010-05-11 12:04:37 -04:00
Sebastian Dröge
6d5ac8163b gio: Fix gsettings build with binutils gold linker 2010-05-11 06:17:25 +02:00
Sebastian Dröge
936ff022f2 Don't include __bss_start, _edata and _end symbols in the abichecks
They are added by the binutils gold linker.
2010-05-11 06:17:25 +02:00
David Zeuthen
2d208c9d36 GDBus: In gdbus(1), try Get() if GetAll() fails
This fixes a problem with services that doesn't implement GetAll() for
one reason or another.

$ gdbus introspect --session --dest org.freedesktop.ReserveDevice1.Audio0 --object-path /org/freedesktop/ReserveDevice1/Audio0
node /org/freedesktop/ReserveDevice1/Audio0 {
  interface org.freedesktop.ReserveDevice1 {
    methods:
      RequestRelease(in  i priority,
                     out b result);
    properties:
      readonly i Priority = 0;
      readonly s ApplicationName = 'PulseAudio Sound Server';
      readonly s ApplicationDeviceName = 'Internal Audio Analog Stereo';
  };
  interface org.freedesktop.DBus.Properties {
    methods:
      Get(in  s interface,
          in  s property,
          out v value);
  };
  interface org.freedesktop.DBus.Introspectable {
    methods:
      Introspect(out s data);
  };
};
2010-05-10 16:20:59 -04:00
David Zeuthen
6e23b0b785 GDBus: Add TODO item about a need to validate data / messages 2010-05-10 14:43:08 -04:00
David Zeuthen
adf50912dd GDBus Add TODO items about finding and launching bus instances 2010-05-10 14:07:13 -04:00
David Zeuthen
7e8b07ae3b GDBus: Use GVariant instead of GHashTable for GDBusProxy::g-properties-changed 2010-05-10 13:31:54 -04:00
David Zeuthen
869b4c6833 GDBus: Use call() instead of invoke_method()
Lots of people been suggesting this. We still use MethodInvocation /
method_invocation for handling incoming method calls so use call()
instead of invoke_method() helps to separate the client and server
facilities. Which is a good thing(tm).
2010-05-10 11:47:08 -04:00
Matthias Clasen
728c4e38e7 More copyright year updates 2010-05-10 08:07:28 -04:00
Matthias Clasen
5d1135618e Trivia 2010-05-10 08:07:07 -04:00
Matthias Clasen
25a8aa5d88 Cosmetic fixes
Use P_() for properties, fix up indentation, etc.
2010-05-09 22:13:18 -04:00
Matthias Clasen
0cf467c2ca Update copyright years to include 2010 2010-05-09 13:14:55 -04:00
Matthias Clasen
e82eea6fda Microoptimize string reallocations 2010-05-09 13:09:54 -04:00
Matthias Clasen
b87dd96a8a Move some platform sources around
gunixcredentialsmessage.h ought to live with other UNIX headers,
and the credentials are moved from dbus-specific to just GIO sources.
Also move gfiledescriptorbased.c to the UNIX sources.
2010-05-09 12:41:02 -04:00
David Zeuthen
c148cafdd1 GDBus: Rework GCredentials type
These changes are is related to

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

and IRC discussions with danw.
2010-05-09 10:03:56 -04:00
Matthias Clasen
bb7106c5df Add some conceptual changes 2010-05-09 02:27:09 -04:00
Matthias Clasen
8315eb77d5 Some documentation tweaks
Add links to the D-Bus docs in some places, and various
other additions.
2010-05-09 01:44:11 -04:00
Matthias Clasen
7ca2e00054 Doc improvements
Make sure all unix-specific apis are marked as such.
2010-05-08 23:28:17 -04:00
Matthias Clasen
e8bc8c6cbf Document length parameter of g_settings_get/set_strv
This parameter was not mentioned in the doc comment, as pointed
out in bug 617767.
2010-05-08 20:14:41 -04:00
Matthias Clasen
9164fd02c9 Document length parameter of g_settings_get/set_strv
This parameter was not mentioned in the doc comment, as pointed
out in bug 617767.
2010-05-08 20:10:57 -04:00
Dan Winship
af263a3a10 remove broken useless initialization in socket-client/socket-server
https://bugzilla.gnome.org/show_bug.cgi?id=618051
2010-05-07 19:08:13 -04:00
David Zeuthen
f1855c2f77 GDBus: add TODO item about maybe having to rework ::g-properties-changed 2010-05-07 15:02:37 -04:00
David Zeuthen
85c85ae63a GDBus: add TODO item about the need to rewrite private GDBusAuth* classes 2010-05-07 14:57:20 -04:00
David Zeuthen
5bd876bef0 Add TODO item about wanting G_DBUS_NONCE_TCP_TMPDIR 2010-05-07 14:56:01 -04:00
David Zeuthen
44fd23b649 GDBus: Add more symbols to pltcheck.sh's SKIP variable
In particular, add these symbols

 g_memdup
 g_print
 g_random_int
 g_propagate_prefixed_e
 g_thread_create_full
 g_int_hash
 g_file_open_tmp
 g_thread_self
 g_usleep
2010-05-06 17:41:31 -04:00
David Zeuthen
46ce134d51 GDBus: Add new symbols to gio.symbols 2010-05-06 17:31:51 -04:00
David Zeuthen
fb1b4599a0 GDBus: Fix up i18n 2010-05-06 16:34:23 -04:00
David Zeuthen
0fd6498cd8 Add "Since: 2.26" to all new GDBus API 2010-05-06 16:02:08 -04:00
David Zeuthen
c490c14f4e Set up gtk-doc for GDBus
Also move send_credentials() and receive_credentials() to
GUnixConnection. This code might change, discussion is still ongoing
in

 https://bugzilla.gnome.org/show_bug.cgi?id=617483.
2010-05-06 15:31:45 -04:00
David Zeuthen
d0a14469d0 Initial GDBus code-drop from GDBus-standalone repo
Things compile and the test-suite passes. Still need to hook up
gio.symbols and docs. There are still a bunch of TODOs left in the
sources that needs to be addressed.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-06 14:21:32 -04:00
Vincent Untz
5b4189fc42 Fix binding between writability of key and sensitivity of a widget
We were not setting the key correctly, result in usage of invalid keys.

Bug 617788.
2010-05-06 11:15:24 -05:00
Javier Jardón
434a4e1d25 Do not include "glib.h" in gio files 2010-05-06 17:42:09 +02:00
Torsten Schönfeld
f39a49b036 gio: Add a boxed type for GFileAttributeMatcher
https://bugzilla.gnome.org/show_bug.cgi?id=616892
2010-05-03 20:13:35 +02:00
Tor Lillqvist
4487b326d7 Fix list of sources in the gio Visual Studio project
List the additional sources needed in gio/Makefile.am, not in
gio.vcprojin. Fix broken usage of sort. Filter out Unix-only source
files.
2010-05-03 19:56:46 +03:00
Tor Lillqvist
0f795345d6 Fix misspelled identifier in the Win32 code 2010-05-03 19:24:35 +03:00
Dan Winship
622916b731 g_cancellable_release_fd: allow NULL cancellable
Almost all GCancellable methods silently do nothing if passed NULL for
the cancellable. Make g_cancellable_release_fd() do that as well.
2010-05-03 12:08:14 -04:00
Ryan Lortie
644dfbd704 GSettings: fix mixed use of a pointer
- used in some places as a move-along-as-we-go pointer
  - used in other places as a pointer to the fixed base of an array

Switch all users to the first style to avoid a crasher.
2010-05-02 14:15:33 -05:00
Ryan Lortie
8dddf6499e GSettingsBackend API/ABI change
- add list() virtual method
  - add 'default_value' flag to read() call
2010-04-28 14:41:42 -05:00
Dan Winship
9ba690b386 .gitignore updates for gsettings stuff 2010-04-27 17:04:57 -04:00
Dan Winship
5046dfc85d GSocket: fix garbled error messages on windows
socket_strerror() was assuming all "strerror" messages are shorter
than 128 bytes, which is certainly true on Linux, but apparently not
on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=615494
2010-04-27 09:02:20 -04:00
David Zeuthen
3ceddd74bb Bug 616877 – Several issues with g_socket_receive_message
The messages array was not reallocated correctly because it was using
malloc instead of realloc. Also, if the user requested messages but
none were received we would segfault. Rewrite the code to fix this
and, for better readability, use GPtrArray instead of rolling our own.

Also make the docs mention that the user need to free the returned
GSocketControlMessage objects using g_object_unref().

Clarify that *messages may be set to %NULL if there are no messages
(this will save pointless allocs of arrays).

Finally, the Win32 version didn't set messages to the expected value.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-04-26 19:19:17 -04:00
Christian Persch
6f7fb3744b Add testcases for <range> and <choices>
Bug #616102.
2010-04-25 20:07:26 -05:00
Ryan Lortie
22ce6ed82d Add range restriction to gschema-compiler
Patch from Christian Persch, with minor modifications.

Bug #616102
2010-04-25 20:06:13 -05:00
Ryan Lortie
5e6e7cbadf GVariant: add bind map for strings to byte arrays 2010-04-25 19:12:14 -05:00
Tor Lillqvist
da306296cf Can't use stderr as a field name 2010-04-25 17:26:41 +03:00
Matthias Clasen
daa405c191 Rename in more places 2010-04-23 20:05:27 -04:00
Matthias Clasen
ec664445a9 Rename gschema-compile to glib-compile-schemas
And clean up the autofoo a bit: use an uppercase variable,
check for pkg-config, check for presence of glib-compile-schemas.
2010-04-23 17:27:26 -04:00
Ryan Lortie
172c229c8f add missing #endif from last patch 2010-04-23 13:54:02 -04:00
Dan Winship
1504a77655 GSocket: define CMSG_LEN and CMSG_SPACE if the system doesn't
https://bugzilla.gnome.org/show_bug.cgi?id=589989
2010-04-23 12:38:33 -04:00
Dan Winship
29f3e3f766 GSocket: add support for timeouts
Also add options for testing timeouts to socket test programs

https://bugzilla.gnome.org/show_bug.cgi?id=587898
2010-04-23 12:31:31 -04:00
Dan Winship
2c4a79c810 GSocket: Merge the unix and windows socket sources together
And remove the bits that were added to gasynchelper.c to support the
previous unix socket source.

part of https://bugzilla.gnome.org/show_bug.cgi?id=587898
2010-04-23 12:25:56 -04:00
Dan Winship
5b329c506a gio/tests/socket-client, socket-server: fix for win32
The addition of unix socket support broke these on win32
2010-04-23 12:24:30 -04:00
Matthias Clasen
25725345fb Fix up distcheck 2010-04-22 22:01:19 -04:00
Dan Winship
19d8cc3375 GUnixSocketAddress: handle abstract sockets with non-0-padded names
There are apparently two incompatible ways of naming abstract sockets:
pad the sockaddr with 0s and use the entire thing as the name, or else
don't, and just pass a shorter length value to the relevant functions.
We previously only supported the former method. Add support for the
latter.

Also correctly handle "anonymous" unix sockaddrs (eg, the client side
of a connection, or a socketpair() socket), and add unix domain socket
support to the socket-client and socket-server test programs to make
sure this all works.

https://bugzilla.gnome.org/show_bug.cgi?id=615960
2010-04-22 11:54:41 -04:00
Matthias Clasen
f3e04973e7 Rename gsettings-tool to gsettings
And make it verb-based.
2010-04-22 01:17:02 -04:00
Javier Jardón
bf0f8ad8ee [gsettings] Add g_return_*_if_fail() guards in GSettingsBackend 2010-04-22 03:20:17 +02:00
Javier Jardón
0fa791b29d [gsettings] Add g_return_*_if_fail() guards
Reported by Christian Persch here:
https://bugzilla.gnome.org/show_bug.cgi?id=616405
2010-04-22 03:10:42 +02:00
Matthias Clasen
78ed401a51 Add a test for g_settings_get_child 2010-04-21 21:03:53 -04:00
Matthias Clasen
88ff21ee92 Be more careful about memory management
This was leading to crashes, e.g. bug 616432.
2010-04-21 18:08:05 -04:00
Matthias Clasen
89b718f7d3 Pedantic terminology fix
Elements are not function calls and attributes are not arguments...
2010-04-21 17:45:29 -04:00
Matthias Clasen
585a37f374 Handle NULL string properties in bindings
Admittely, we just handle them by failing the conversion...
2010-04-21 14:49:05 -04:00
Dan Winship
3814868b7a gio.symbols: add two missing G_GNUC_CONSTs 2010-04-21 13:42:15 -04:00
Matthias Clasen
ccf9361490 Handle non-readable/-writable properties when binding
And document readability/writability requirements for binding flags.
2010-04-21 12:33:55 -04:00
Matthias Clasen
8a988e8e88 Test binding non-readable/writable properties 2010-04-21 12:31:10 -04:00
Bastien Nocera
e63a1a3d6e Fix gschema-compile tests for --schema-files changes 2010-04-21 15:04:28 +01:00
Matthias Clasen
1c2aea7854 Add tests for --allow-any-name 2010-04-21 09:50:42 -04:00
Bastien Nocera
0b61a87c29 Allow passing multiple schemas to gschema-compile
To make test suites easier to implement

https://bugzilla.gnome.org/show_bug.cgi?id=616312
2010-04-21 14:38:08 +01:00
Matthias Clasen
9708431788 Remove leftover test data 2010-04-21 09:34:57 -04:00
Matthias Clasen
64cc81f769 Add an --allow-any-name option
This will make it easier for people to keep their GConf key names
in the transition period.

Conflicts:

	gio/gschema-compile.c
2010-04-21 09:33:57 -04:00
Matthias Clasen
c83a976245 Add some more schema compiler tests 2010-04-21 00:43:55 -04:00
Matthias Clasen
564714bc95 Fix type mapping for float in gsettings-schema-convert
Bug 616331.
2010-04-20 23:40:22 -04:00
Matthias Clasen
afff087785 Simplify gschema-compile test suite
Add --one-schema-file option to gschema-compile to allow easier test
setup. Simplify the test setup.

Bug #616276.
2010-04-20 23:28:49 -04:00
Matthias Clasen
463203ee0a Add gettext-domain when required, and allow to specify it on the cmdline
Bug 616309
2010-04-20 22:55:15 -04:00
Matthias Clasen
bedf4c3259 Add documentation and translation for gsettings-tool 2010-04-20 22:55:15 -04:00
Matthias Clasen
1dbe06c30a Add a minimal commandline utility to poke GSettings 2010-04-20 22:55:15 -04:00
Javier Jardón
3569de342e [gio] Use G_DEFINE_INTERFACE macro
Use this macro in gasyncinitable, gconverter, ginitable and
gsocketconnectable

https://bugzilla.gnome.org/show_bug.cgi?id=616245
2010-04-21 02:32:43 +02:00
Tor Lillqvist
3585e64be8 Tweak the generation of the file list in gio.vcproj
Visual Studio doesn't like slash as directory separator, so use
backslash. While at it, sort the list of files put in the project file
just for clarity.
2010-04-21 03:22:59 +03:00
Ryan Lortie
8b6d2c1fc1 remove empty initialisers { } for MSVC's sake 2010-04-20 20:14:50 -04:00
Ryan Lortie
a4e3878675 Merge remote branch 'gvdb/master' 2010-04-20 20:13:56 -04:00
Christian Persch
9488d18a87 Fix gsettings mapping for uint64
Bug #616295.
2010-04-20 19:40:26 -04:00
Matthias Clasen
1b61680abb Flesh out the porting guide some more 2010-04-20 19:40:26 -04:00
Matthias Clasen
3277b77769 Document g_settings_bind_writable 2010-04-20 19:40:26 -04:00
Richard Hughes
9717833e82 Don't crash gsettings-schema-convert for GConf schemas that contain empty elements
This can be observed in gnome-power-manager with one of the entries that
contains <long></long>
2010-04-20 22:30:01 +01:00
Ryan Lortie
f82839b8fe gschema-compile: output to srcdir by default
If the target directory is not explicitly set then output to the source
directory.  Closes bug #616311 reported by Bastien Nocera.
2010-04-20 17:27:17 -04:00
Ryan Lortie
f5990c1aef GSettings: bind to writablity of a key 2010-04-20 12:30:40 -04:00
Richard Hughes
890a842b26 Fix up the gtk-doc comment for the GSettings::changed signal 2010-04-20 16:14:11 +01:00
Ryan Lortie
3c54cc074d gschema-compile: return quickly on parse error
Suggested by Christian Persch in #616102
2010-04-20 10:37:33 -04:00
Matthias Clasen
3b9de5f10a Don't forget to install and distribute gsettings-schema-convert 2010-04-19 19:09:15 -04:00
Matthias Clasen
7d330078e7 Don't forget to install and distribute gsettings-schema-convert 2010-04-19 18:26:41 -04:00
Matthias Clasen
cd9b8b563f 2.25.0 2010-04-19 17:30:42 -04:00
Christian Persch
27d2dbacd4 Use g_set_error_literal where appropriate 2010-04-19 14:18:59 -04:00
Matthias Clasen
40869e9544 Install a dtd in /usr/share/glib-2.0/schemas/gschema.dtd 2010-04-19 14:04:42 -04:00
Matthias Clasen
2d38da0746 Remove misnamed files 2010-04-19 13:28:00 -04:00
Matthias Clasen
0e48b0638d Some tests for gschema-compile
Mostly making sure that we produce reasonable error messages for
typical mistakes.
2010-04-19 13:28:00 -04:00
Javier Jardón
a64625a134 Little fix in gio/test/Makefile.am
This was introduced in
commit 4a605693fc
2010-04-19 17:59:23 +02:00
Matthias Clasen
32477d4fbf Another shadowed variable fix
See bug 616154.
2010-04-19 11:49:12 -04:00
Matthias Clasen
4a605693fc Don't segfault when <default> is missing
Also add a framework for schema compiler tests.

Fixes bug 616086.
2010-04-19 11:49:12 -04:00
David Zeuthen
ccbafd0f14 Bug 615111 – GAsyncInitable's default implementation is broken
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-04-19 10:43:48 -04:00
Ryan Lortie
40fdc929f8 Don't write out zero-byte sections in builder
This and the previous issue caught by Christian Persch in bug #616156
2010-04-19 10:39:54 -04:00
Ryan Lortie
646dc7de87 Whitespace fixups 2010-04-19 10:39:54 -04:00
Ryan Lortie
33104067d4 Fix logic error for missing options in reader 2010-04-19 10:39:54 -04:00
Matthias Clasen
3f354af402 Handle int64 and double types correctly 2010-04-19 10:34:42 -04:00
Matthias Clasen
a072c1fc29 Fix up some typos in the new tests 2010-04-19 10:34:22 -04:00
Christian Persch
230038f684 Add testcase for g_settings_bind with [u]int64 properties
And use different values for the doubles test.

All of these fail currently since g_settings_bind default mapping
truncate to glong (eek!).

Bug #616119
2010-04-19 10:00:03 -04:00
Christian Persch
dd98785e85 Rename shadowed variables
Bug #616154.
2010-04-19 09:46:32 -04:00
Matthias Clasen
69bd033e11 Call setlocale initially
That seems to be required to make bindtextdomain work in the
l10n tests. See bug 616152.
2010-04-19 09:31:31 -04:00
Tor Lillqvist
4523b2b9cd Bypass l10n tests for now on Windows 2010-04-19 16:14:45 +03:00
Tor Lillqvist
a96360ad68 Avoid non-portable <glob.h> API
And thus we can build gschema-compile on all platforms, and run it in
tests.
2010-04-19 15:48:30 +03:00
Matthias Clasen
c279b5b999 Add a schema convertion script 2010-04-19 08:04:57 -04:00
Tor Lillqvist
df8800e59a Portability improvements
Gschema-compile uses glob which is available on Unix only. Thus can't
run the gschema-compile test except on Unix either.

To avoid an Automake error, comment out the SOURCES and LDADD of
unix-streams which for some reason has been commented out from
TEST_PROGS.

Can't use a Makefile.am target called foo_PROGRAMS for random files
that aren't actually programs, as Automake assumes EXEEXT should be
appended to the file names.
2010-04-19 12:28:44 +03:00
Tor Lillqvist
9af8b83211 Add GWin32InputStream and GWin32OutputStream classes
Correspond to GUnixInputStream and GUnixOutputStream. No true async
support though. But that is how the Win32 API is, for files not
explicitly opened for so-called overlapped IO.

The API to create these streams takes Win32 HANDLEs. Not file
descriptors, because file descriptors are specific to the C library
used. The user code and GLib might be using different C libraries.

Also add a test program for the new classes, and a gio-windows-2.0.pc
file.
2010-04-19 11:54:56 +03:00
Matthias Clasen
32de7d6905 Fix up docs for backend setup functions 2010-04-18 15:57:11 -04:00
Matthias Clasen
fd8cdb83e1 Refer to gio-querymodules in the extension point docs 2010-04-18 15:55:14 -04:00
Matthias Clasen
e0850b56e2 Correct filename extension in help output. 2010-04-18 15:37:55 -04:00
Matthias Clasen
626d8ac9e1 More distcheck fixes 2010-04-17 21:31:30 -04:00
Matthias Clasen
187883dc58 add a keyfile test 2010-04-17 21:20:33 -04:00
Matthias Clasen
f07613997c More distcheck fix attempts 2010-04-17 20:54:53 -04:00
Matthias Clasen
3db0f554e4 Some build fixes 2010-04-17 16:57:28 -04:00
Matthias Clasen
137cee425f Correct the sense of an assertion 2010-04-17 16:48:10 -04:00
Matthias Clasen
d2b837df5d Document the tests
Add a short note for each test that explains what it tries to test.
2010-04-17 16:13:22 -04:00
Ryan Lortie
118ae129bc GDelayedSettingsBackend: another mandatory fixup
- emit the "has-unapplied" property notify if dropping the last key
    from the changeset due to a mandatory key
2010-04-17 11:58:52 -04:00
Ryan Lortie
e06e441ac2 GSettings delayed: fix handling of mandatory keys
- if a key becomes mandatory, drop it from the changeset

  - if we still get failing writes (ie: because of a race) then drop the
    entire changeset and signal that it happened
2010-04-17 11:49:22 -04:00
Ryan Lortie
eaaa4d14aa add backend setup APIs 2010-04-17 10:26:51 -04:00
Matthias Clasen
c8a7bb6ccd Merge GSettings tests 2010-04-17 01:48:05 -04:00
Ryan Lortie
265ca3db9d let binding functions return a floating GVariant 2010-04-17 01:27:00 -04:00
Ryan Lortie
c8e264b6d0 add GMemorySettingsBackend 2010-04-17 01:26:34 -04:00
Ryan Lortie
77ab3c28b9 add pltcheck.sh exception for GChecksum 2010-04-17 01:02:05 -04:00
Ryan Lortie
79bc511d95 XML schemas are now *.gschema.xml 2010-04-17 00:40:09 -04:00
Matthias Clasen
16637a1687 Document G_SETTINGS_BIND_GET_NO_CHANGES 2010-04-17 00:16:01 -04:00
Matthias Clasen
a2716ad020 Merge the keyfile settings backend. 2010-04-16 23:57:26 -04:00
Ryan Lortie
a187634b29 merge GSettings 2010-04-16 23:23:40 -04:00
Ryan Lortie
43a72ce1be GSettingsSchema: add call to get list of keys 2010-04-16 23:21:08 -04:00
Matthias Clasen
a922596e54 Some doc tweaks 2010-04-16 19:30:58 -04:00
Ryan Lortie
d4a4a4ccdb GSettings: import delayed backend to master 2010-04-16 12:02:44 -04:00
Ryan Lortie
04c1eadfff GSettings: more PLT/visibility fixups 2010-04-16 12:02:29 -04:00
Ryan Lortie
149224664f gio.symbols: remove pointless whitespace 2010-04-16 12:01:56 -04:00
Ryan Lortie
2474ebf15e GSettingsBackend: fix type in g_return_val_if_fail 2010-04-16 12:01:56 -04:00
Ryan Lortie
69801f8dc8 Merge remote branch 'gvdb/master' 2010-04-16 11:05:22 -04:00
Ryan Lortie
897bd9f384 GSettings: merge the schema compiler 2010-04-15 23:35:49 -04:00
Ryan Lortie
2bc8157735 merge GSettingsSchema 2010-04-15 22:30:11 -04:00
Ryan Lortie
45a1c41e8c Merge remote branch 'gvdb/master' 2010-04-15 22:14:39 -04:00
Ryan Lortie
defd75fbc5 GSettingsBackend: fix NULL vs "" context issues 2010-04-15 18:30:06 -04:00
Ryan Lortie
3e36ee3426 add 'null' GSettings backend 2010-04-15 18:22:14 -04:00
Ryan Lortie
c2675af4d7 GSettings: Modify backend API 2010-04-15 18:22:04 -04:00
Ryan Lortie
18ba085d0a merge GSettingsBackend 2010-04-15 14:59:41 -04:00
Tor Lillqvist
1229281d95 Define a public documented type for the struct stat used by g_stat()
Define GStatBuf as the type used by g_stat() and g_lstat(). Replaces
the non-public struct tag _g_stat_struct. Mostly relevant for Windows
where there are several variants of stat-style structs. On POSIX, is
just another name for struct stat.

Actually, also on many POSIX systems there are in fact several
variants of struct stat and corresponding stat() and lstat()
functions, but as g_stat and g_lstat are normally on POSIX just macros
that expand to stat and lstat, this should not cause a problem. It's
only when it's the actual g_stat() or g_lstat() implementation inside
GLib that gets called that one needs to be sure the passed struct is
the same as what GLib expects.)
2010-03-30 19:22:39 +03:00
Benjamin Otte
e7763678b5 Fix race in g_cancellable_cancel()
We need to check priv->cancelled after taking the lock. Previously we
only checked it just before taking the lock, which left a small chance
for a race.
2010-03-29 12:57:35 -05:00
Benjamin Otte
5527a2ac2c Remove unneccessary variable from g_cancellable_cancel()
The variable makes a complicated function even more complicated.
2010-03-29 12:57:35 -05:00
Matthias Clasen
7c8a108165 Fix a typo 2010-03-26 11:05:02 -04:00
Matthias Clasen
78b764f325 More doc fixups 2010-03-26 10:19:57 -04:00
Matthias Clasen
c4ea7d58f7 Small doc addition 2010-03-26 09:30:25 -04:00
Matthias Clasen
6e77ee0971 Correct the error handling in splice_stream_with_progress
We need to get out of both loops, so a simple 'break' doesn't cut it.
Bugs 613748 and 613923
2010-03-26 09:03:22 -04:00
Ryan Lortie
fd448dd7ce Add doc note about read_until() inconsistency.
See bug 584284 for more information.
2010-03-23 10:01:53 -05:00
Ryan Lortie
ace9a25fb3 Bug 613601 - buglet in dup_close_on_exec_fd()
Fix copy/paste error and 'or' FD_CLOEXEC into the existing flags instead
of just setting it outright.
2010-03-22 12:03:24 -05:00
Tor Lillqvist
226cc663e4 Avoid much of duplication in lists of source files
Don't keep the lists of source files for libglib, libgobject and
libgio in the VS project files in addition to the canonical location,
the corresponding Makefile.am files.

Instead, generate the corresponding .vcproj files at make dist time
using the C preprocessor, from template files called .vcprojin. We
still list explicitly in the .vcprojin files some of the
Windows-specific source files, and the sources files of gnulib and
pcre.
2010-03-21 16:15:02 +02:00
Tor Lillqvist
504b8b8f01 Avoid struct stat issues with MSVC 2010-03-21 14:50:45 +02:00
Colin Walters
f552689058 [GDesktopAppInfo] New function g_desktop_app_info_get_filename
This allows access to the full file path, where possible.

https://bugzilla.gnome.org/show_bug.cgi?id=612832
2010-03-14 15:45:46 -04:00
Thomas Kristensen
1be8ad3514 Close the socket event in finalizer instead of in close method
There might be a GSource attached to a GMainContext, about to be removed by a
pending cancellation. Deleting the handle too early will trigger a g_warning in
the "select()" call in GMainContext. Attached patch fixes this by deferring
destruction of WSAEVENT object until GSocket's finalize().

Patch from bug #612702.

Signed-off-by: Tor Lillqvist <tml@iki.fi>
2010-03-14 11:51:24 +02:00
Tor Lillqvist
a57522deae The SO_KEEPALIVE value seems to actually be a char on Windows
Do still use a BOOL variable, but initialize it to FALSE before the
getsockopt(), and drop the assertion on Windows. Should fix bug
2010-03-12 10:45:52 +02:00
Alexander Larsson
8cd5c94f42 Add pregenerated ids for TRASH_ORIG_PATH and TRASH_DELETION_DATE
This fixes the build for me
2010-03-08 12:03:40 +01:00
Matthias Clasen
826abbefce Add defines for trash::orig-path and trash::deletion-date
See bug 612107.
2010-03-08 00:36:00 -05:00
Matthias Clasen
0a51b58e07 Minor doc clarification
Mention g_realloc() as a possible function to use with
g_memory_output_stream_new(). Bug 612041.
2010-03-08 00:12:33 -05:00
Matthias Clasen
9dd6c60fbf Plug a memleak in g_io_modules_scan_all_in_directory
...and at the same time, fix a malloc<>g_free mismatch.
Patch by Caolan McNamara, bug 611897
2010-03-07 17:44:23 -05:00
Jonh Wendell
7504095de0 Mark a string for translation 2010-03-04 17:03:13 -03:00
Christian Dywan
c423c3a9c9 Add licence headers to gnativevolumemonitor.c/h
Fixes bug #609531
2010-03-04 11:02:31 +01:00
Felix Riemann
373f3d8b52 Fix API docs for GZlibCompressor and GZlibDecompressor
Corrects the general descriptions and makes the signals and implemented
interfaces appear.
2010-03-03 17:44:28 +01:00
Dan Winship
9a886135c8 GResolver: fix Windows 2000 workaround
Move the <wspiapi.h> include from gwin32resolver.c to
gnetworkingprivate.h, since gthreadedresolver.c needs it too.

https://bugzilla.gnome.org/show_bug.cgi?id=611696
2010-03-03 08:35:32 -05:00
Paolo Borelli
277b9717da Remove utf8inputstream leftovers in a few other places 2010-03-01 10:24:43 +01:00
Alexander Larsson
2bfddf162e Remove GUtf8InputStream for now
It turns out that the way this worked did not work out for the current
main usecase (gedit) due to issues with how this is best integrated
with GtkTextView. So, in order to not have to support an unused non-ideal
API forever we remove this before its been in a stable release.

The basic feature seems to have some utility though, so we hope for it
to eventually return in a better form.
2010-03-01 09:56:02 +01:00
Saleem Abdulrasool
a495a2122d include gio.h, not giotypes.h
Including giotypes.h in gfiledescriptor.h causes a compilation failure for users
of the header as giotypes.h may not be included directly.
2010-02-23 16:23:07 -08:00
Emilio Pozuelo Monfort
a7cc500d38 Test for unexisting files in $TMP and not in $HOME
Some buildd environments have an unwritable $HOME, which makes the
test that looks for an unexisting file there fail. Use $TMP instead,
which should be more reliable.

https://bugzilla.gnome.org/show_bug.cgi?id=610860
2010-02-23 18:37:39 +01:00
Emilio Pozuelo Monfort
202d7d37d6 Don't fail a couple of tests when running as root
root can access and write to a directory when it doesn't have
exec and write permissions respectively. So expect the tests that
check that to succeed rather than to fail when running as root.

https://bugzilla.gnome.org/show_bug.cgi?id=552912
2010-02-22 19:54:38 +01:00
Alexander Larsson
4535683b3f Keep metadata when files are renamed and trashed
This fixes https://bugzilla.gnome.org/show_bug.cgi?id=609813
2010-02-22 12:37:16 +01:00
Matthias Clasen
3983418c25 Fix up GFileDescriptorBased docs 2010-02-21 19:55:02 -05:00
Matthias Clasen
2de84d6594 Fix up make check 2010-02-21 19:42:37 -05:00
Matthias Clasen
21080a33e1 Add missign single include guards
Reported in bug 609530. patch by Christian Dywan.
2010-02-21 16:12:35 -05:00
Matthias Clasen
6c1a914d51 Fix build on Solaris 8
System header fun. See bug 610131.
2010-02-21 15:55:10 -05:00
Christian Kellner
48f74cab39 Move event support in the inotify backend
This adds support for G_FILE_MONITOR_SEND_MOVED events when requested by
the user to the inotify backend. Last part to fix bug #547890.
Based heavily on a patch by Martyn Russel <martyn@lanedo.com>.
2010-02-18 15:50:26 +01:00
Christian Kellner
239af97712 GLocalFileMonitor: Support for GFileMonitorFlags
Evaluate and remember GFileMonitorFlags. This is a part of move 
event support for fs-monitoring (bug #547890).
2010-02-18 15:50:26 +01:00
Christian Kellner
41956b2376 Move event support for fs-monitoring: Event & flag
Add a G_FILE_MONITOR_SEND_MOVED flag indicating the API user
wants to receive the new G_FILE_MOINOTR_EVENT_MOVED event 
instead of single CREATED/DELETED events.
First part of bug #547890.
2010-02-18 15:50:26 +01:00
Christian Kellner
bb4f63d639 GFile: Support for splice(2) in copy_fallback
The (linux specific) system call splice can be
used to transfer data between file descriptors
whitout copying them into user space.
See bug #604086 for additional details.
2010-02-15 13:25:50 +01:00
Christian Kellner
28f90db1ed GLocalFileOutputStream: Implement GFileDescriptorBased
Also convert GLocalFileIOStream to use the new interface to obtain
the file descriptor.
2010-02-15 13:25:50 +01:00
Christian Kellner
670f6210ce GLocalFileInputStream: Implement GFileDescriptorBased 2010-02-15 13:25:50 +01:00
Christian Kellner
4536a4adbc GFileDescriptorBased: New interface
New interface for file descriptor based io object. The interface
is only exported on unix based systems. See bug 604086.
2010-02-15 13:25:50 +01:00
Alexander Larsson
b37da7134b Set result_uncertain in win32 g_content_type_guess implementation
Fixes bug #609143
2010-02-15 10:13:10 +01:00
Tim-Philipp Müller
813d0d17a6 Don't leak filename in g_io_modules_scan_all_in_directory
https://bugzilla.gnome.org/show_bug.cgi?id=608159
2010-02-06 13:37:04 +01:00
Tor Lillqvist
021643cda4 Clarify use of struct stat on Windows 2010-02-04 19:59:05 +02:00
Tor Lillqvist
3f3c163aa2 Put a version info resource also in the gio DLL
Also, distribute gio/gio.rc(.in).
2010-02-04 00:37:13 +02:00
River Tarnell
2b121c02ef properly guard the includes
Fixes: Bug 604967 -  2.22.3 libasyncns build fails on HP-UX 11.11

* gio/libasyncns/asyncns.c: properly guard the includes of sys/select.h
  and sys/time.h
2010-02-03 17:31:02 +01:00
Ryan Lortie
f411e23043 GIO: Remove trailing "." from Since: tags in docs
Typing "Since: 2.22." results in the creation of an api-index-2.22..xml
file (ie: the last '.' is taken to be part of the version number).
2010-01-30 14:06:12 -05:00
Christian Dywan
7d6af08777 Add gtk-doc comments with Since tags to GMemoryOutputStream properties 2010-01-26 20:46:53 +01:00
Matthias Clasen
bc4f3904f2 Another few failing tests disabled 2010-01-25 12:43:10 -05:00
Matthias Clasen
d819c8e486 Typo fixes 2010-01-24 20:50:51 -05:00
Ryan Lortie
e71dcb204e gio: .gitignore gio-querymodules 2010-01-23 01:07:46 -05:00
Javier Jardón
a6ab4b7872 Upgrade to version 0.8 of libasyncns
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=602240
2010-01-13 12:02:39 -05:00
Alexander Larsson
94b8613b5f Use unconditional thread calls in gio and gobject
If threads are available we always enable threads in gobject, which
means all gio/gobject code can enable the unconditional thread calls.

This is a minor optimization since we avoid a bunch of unnecessary
is-threads-enabled checks.

https://bugzilla.gnome.org/show_bug.cgi?id=606775
2010-01-12 21:37:50 +01:00
Alexander Larsson
74ad124cfb Implement lazy loading of fam plugin 2010-01-12 16:34:23 +01:00
Alexander Larsson
57b771235e Add gio-querymodule program
This can be used to update the giomodule.cache file in directories with
giomodules in order to support lazy module loading.
2010-01-12 16:34:18 +01:00
Alexander Larsson
682b3da99b Use the new lazy loading of modules for gio modules 2010-01-12 16:31:29 +01:00
Alexander Larsson
488bede191 Add support for lazy loading of giomodules
Adds an optional query method to giomodules which should return all
possible extension points the module may implement.

Then we add a new call g_io_modules_scan_all_in_directory() similar to
g_io_modules_load_all_in_directory() that doesn't return all loaded
modules, thus allowing lazy loading.

In g_io_modules_scan_all_in_directory we look for an optional
giomodule.cache file and use the information in that to avoid
loading modules until they are needed for an extension point.
2010-01-12 16:31:29 +01:00
Ignacio Casal Quinteiro
6aa1aef556 Flush gcharsetconverter when needed.
This patch fixes bug #605686.
2010-01-12 12:56:54 +01:00
Matthias Clasen
759fbac7b7 Add properties to GMemoryOutputStream
This helps bindings. Patch by Krzysztof Kosiński. See bug 605733.
2010-01-06 17:37:11 -05:00
Matthias Clasen
f2d8f6287d Fix the filename roundtrip check
The check was always failing because the code was comparing
the wrong strings. Reported in bug 605977.
2010-01-06 13:27:19 -05:00
Ryan Lortie
baf20e0984 GUnixFDMessage: fix a small typo in an extra check
In the deserialise function, GUnixFDMessage was comparing 'level' to
both SOL_SOCKET and SCM_RIGHTS.  It is correct to compare 'type' to
SCM_RIGHTS.  The code passed tests only because:

1) it's a "should always be OK" double-check

2) SOL_SOCKET and SCM_RIGHTS, by chance, both have the value '1' on
   Linux systems.
2010-01-05 18:52:33 -05:00
Matthias Clasen
b00c6d7fb5 Fix a memleak
An early exit in expand_application_parameters forgot to free
a GString. Reported by Steve Grubb.
2010-01-05 18:18:55 -05:00
Matthias Clasen
6cee86a3ef Fix an off-by-one error
Reported by Steve Grubb.
2010-01-05 18:16:37 -05:00
Matthias Clasen
a91514ba19 Document that various functions ref GSimpleAsyncResult
Patch by Will Thompson, see bug 602417.
2010-01-02 19:53:02 -05:00
Matthias Clasen
f58fa69343 Document that _finish() must be called at most once.
The patch was provided by Will Thompson in bug 602417.
2010-01-02 19:53:02 -05:00
Matthias Clasen
74af99b860 Fix a typo
...and some whitespace fixes. Pointed out by Will Thompson in
bug 602417.
2010-01-02 19:53:02 -05:00
Matthias Clasen
ab799115de Don't return anything from a void function
Sun C doesn't like it. Reported in bug 604824.
2010-01-02 19:17:37 -05:00
Paolo Borelli
32f79f55ef Bug 604457 - gutf8inputstream.c: increasing unknown size pointer 2009-12-31 12:42:41 +01:00
Dan Winship
f74c0e257f update .gitignores 2009-12-18 12:27:36 +01:00
Dan Winship
28d91b5bb6 Fix UnixWare build by not using "sa_len" as a variable name
https://bugzilla.gnome.org/show_bug.cgi?id=604875
2009-12-18 10:26:09 +01:00
Gian Mario Tagliaretti
3f41e31bf9 Remove wrong file imports, only gio/gio.h should be included 2009-12-16 23:18:17 +01:00
Tor Lillqvist
8dc200db04 Check for <wspiapi.h> and use it if present
Should help bug #603527 if glib is built in an environment that has
<wspiapi.h>.
2009-12-14 03:09:46 +02:00
Paolo Borelli
cdf00a6a9b Add unit tests for some more methods 2009-12-08 17:05:09 +01:00
Alexander Larsson
4fbbe190b7 Remove default implementation of async filter steam ops
Not only is the default implementation broken (it causes infinite recursion
as seen in bug #603982), but its also worthless. If we just fall back on the
default stream operations we automatically get async version based on
the sync filter stream operations, which is what we want.
2009-12-07 22:14:10 +01:00
Paolo Borelli
8a6d5e203e Fix makefile typo 2009-12-06 15:45:37 +01:00
Paolo Borelli
568cd48365 Add GUtf8InputStream - Bug #603270
Add a filter input stream that performs utf8 validation.
2009-12-06 15:23:33 +01:00
Jeroen Nijhof
3d8035f799 [gio] Remove some commas at end of enumerator list
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=603476
2009-12-01 19:48:04 +01:00
Dan Winship
39cd766e8e Use G_DEFINE_INTERFACE in gio
Note: Since we export types with Iface in the name rather than
Interface we have to use some typedefs to make this work. New
interfaces should probably use Interface as the public name.
2009-12-01 10:44:42 +01:00
Matthias Clasen
8907bfee86 Fix up GIO docs 2009-11-29 22:54:16 -05:00
Matthias Clasen
06c71ba399 Fix 'make check' in gio 2009-11-29 20:55:25 -05:00
Matthias Clasen
a4a69df105 Remove filter-cat from TEST_PROGS
Since it is not intended to be run as part of make check.
2009-11-29 20:48:52 -05:00
Paolo Borelli
e7992b7b06 Fix return type of g_converter_[in|out]put_stream.
Fixes bug #603265
2009-11-29 15:14:10 +01:00
Ryan Lortie
8586b636c7 Bug 589631 - enclose literals with double quotes
Improve strings for purpose of translation.

Based on a patch from Leonardo Ferreira Fontenelle.
2009-11-26 12:15:04 -05:00
Christian Kellner
09b1b6414b Add "default location" support to GMount
The "default location" of the given mount is a path that reflects
the main entry point for the user (e.g. the home directory, or the
root of the volume).

https://bugzilla.gnome.org/show_bug.cgi?id=561998
2009-11-26 16:12:18 +01:00
Alexander Larsson
2b2195bf68 Pass in the right device to vfs->local_file_add_info for symlinks
We used to pass the path for the symlink, but the device of the target
which is wrong and breaks metadata access.

https://bugzilla.gnome.org/show_bug.cgi?id=593809
2009-11-26 16:05:07 +01:00
Mures Andone
96f41b6283 Fixed bug 91 (GIO monitoring not working due to bad assert)
https://bugzilla.gnome.org/show_bug.cgi?id=593856
2009-11-26 15:40:01 +01:00
Will Thompson
97db31fa14 Apply English pedantry to GAsyncInitable's docs
• "asynchronous" was misspelled as "asyncronous" in various places;
• punctuation was missing;
• g_async_initable_new_async() had a stray "and";
• references to g_async_initable_new_finish() were missing a "the".

https://bugzilla.gnome.org/show_bug.cgi?id=602417
2009-11-26 15:14:46 +01:00
Alexander Larsson
08d33b81ee Remove unused variable 2009-11-26 13:15:11 +01:00
Ryan Lortie
3d7edc137e Bug 601637 - add GUnixFDList
change GUnixFDMessage to contain a GUnixFDList.

add test case for GUnixFDMessage and GUnixFDList.

update docs.
2009-11-24 17:55:57 -05:00
Alexander Larsson
e5a98502be Update gio.symbols with new functions 2009-11-24 13:31:33 +01:00
Alexander Larsson
b7c4aa6152 Export g_charset_converter_get_num_fallbacks in header 2009-11-24 13:31:10 +01:00
Alexander Larsson
2af69f4135 Fix GZlibCompressorFormat names
What used to be called RAW is really the zlib header format.
There is a real "raw" format, so rename the default and add a RAW type.
2009-11-24 13:02:05 +01:00
Ryan Lortie
85501f5ffa Bug 591214 - Warnings building gcancellable.o
- check for EINTR on read() and write() calls
- remove unused 'priv' variable
2009-11-23 13:53:39 -05:00
Ryan Lortie
48e2a57043 Bug 598712 - can't detect text file with backspace
looks_like_text(): Allow '\b' to appear in text files.
2009-11-23 13:47:16 -05:00
Alexander Larsson
230745a350 Add filter-cat test for GConverter streams 2009-11-23 16:22:53 +01:00
Alexander Larsson
92b9218cbf Add GZlibCompressor 2009-11-23 16:22:53 +01:00
Alexander Larsson
38c3eb14e4 Add GZlibDecompressor for zlib decompression 2009-11-23 16:22:53 +01:00
Alexander Larsson
8cb1252d92 Add zlib dependency to gio
Will be used by compression APIs
2009-11-23 16:22:52 +01:00
Alexander Larsson
fce2873641 Add test for converter streams 2009-11-23 16:22:52 +01:00
Alexander Larsson
7f8991596b Add GConverterOutputStream
This allows for conversion when saving
2009-11-23 16:22:52 +01:00
Alexander Larsson
afe3324fca Add g_output_stream_is_closing
Need this to check how we're flushing when closing a converter
output stream.
2009-11-23 16:22:52 +01:00
Alexander Larsson
848e0bf760 Add GConverterInputStream
Read and convert data from an input stream
2009-11-23 16:22:52 +01:00
Alexander Larsson
134e9bd84f Add fallback mode to GCharsetConverter 2009-11-23 16:22:52 +01:00
Alexander Larsson
4b8382823e Add GCharsetConverter 2009-11-23 16:22:52 +01:00
Alexander Larsson
0d86b25f91 Add GConverter interface
This is an interface for stateful conversions of data. Its a generic
interface suitable for things like IConv, compression, decompression,
and regexp replacement.
2009-11-23 16:22:52 +01:00
Alexander Larsson
110133135d Add G_IO_ERROR_PARTIAL_INPUT and G_IO_ERROR_INVALID_DATA errors
These are needed for GConverter
2009-11-23 16:22:52 +01:00
Ryan Lortie
56eee6759b Remove #include "glocalfile.h" from GFile
It might give somebody the wrong idea. =)
2009-11-20 14:42:38 -06:00
Juan A. Suarez Romero
ba2b2bbca2 priv variable should only be used in win32 code 2009-11-20 16:49:47 +01:00
Ryan Lortie
8e2fa44953 g_socket_listener_add_any_inet_port is Since 2.24
accidentally committed an old patch without updating.
2009-11-19 10:19:01 -06:00
Ryan Lortie
c005878ae7 Bug 585566 - GSocketListener API issues
Add a new function, g_socket_listener_add_any_inet_port(), to deal with
the desired use case.
2009-11-19 10:04:27 -06:00
Christian Dywan
77baa70eda Bug 600550 - (...) doesn't treat arguments properly
Add some additional checking to g_app_info_create_from_commandline to
make it handle strange inputs more elegantly.
2009-11-19 10:00:38 -06:00
Vincent Untz
3257e8ebe4 Bug 600620 - Add g_app_info_get_display_name()
This new API can make use of X-GNOME-FullName in .desktop files, to have
the full name of applications.
2009-11-19 09:47:46 -06:00
Ryan Lortie
9681d7e75f Bug 595138 - GFile not robust with invalid input
Improve handling of g_file_query_default_handler() when called on an
invalid GFile (ie: one created with an invalid URI).
2009-11-19 09:45:53 -06:00
Ryan Lortie
983a717fa6 Bug 535159 - g_file_has_parent
- add a g_file_has_parent() function as a wrapper around
   g_file_get_parent()
2009-11-17 20:27:38 -06:00
Javier Jardón
ba0a6e1911 Fix compilation warning: Initialize the variable 2009-11-17 20:44:16 +01:00
Javier Jardón
c6243026ed Fix compilation warning: Remove unused function 2009-11-17 20:44:10 +01:00
Javier Jardón
00a331f970 Fix compilation warning: cast to (GCompareFunc) 2009-11-17 20:44:01 +01:00
Ryan Lortie
6b7b7a7602 Bug 587300 - g_cancellable_disconnect deadlock
add documentation to clarify that a deadlock is the expected case for
calling this function from a signal handler
2009-11-11 23:54:18 -05:00
Ryan Lortie
3d09b8e09c Bug 591216 - Warning building resolver.o
check result of write system call to quiet compiler warning
2009-11-11 23:21:48 -05:00
Ryan Lortie
78e8b39b49 GSocket.receive_message: fix bogus allocation math 2009-11-11 22:22:41 -05:00
Stéphane Démurget
ef6117f78d Bug 324930 - Nicer message for EPERM on symlink
Introduced a more precise error message for EPERM when symlinking to
a local filesystem.

EPERM on symlink means symlinking is not supported by the underlying
fs so it is not the general meaning of EPERM which roughly translates
to 'Operation not permitted'.
2009-11-05 14:31:14 +01:00
Matthias Clasen
f3fbf37dd8 Avoid a warning 2009-10-25 02:56:13 -04:00
Matthias Clasen
e63262d49d Don't give up too early when collecting mime types
Since returning exactly one match has special significance, don't
give up matching before we've found at least 2 types. Also, make
sure that we don't return the same mime type more than once.
Bug 541236.
2009-10-25 02:55:46 -04:00
Tor Lillqvist
d105f431b0 Fix GWin32DirectoryMonitor
GWin32DirectoryMonitor was quite broken, but nobody had apparently
noticed, or at least not filed any bug. Only now with a bleeding edge
GTK+ file chooser does the code get exercised in common programs like
gtk-demo or GIMP, apparently. Bug #598899.
2009-10-23 00:46:50 +03:00
Tomas Bzatek
e95a3b0576 Documentation fixes 2009-10-13 16:21:42 +02:00
Tor Lillqvist
443674faaa Construct the gio module directory pathname at run-time on Windows 2009-10-12 00:20:28 +03:00
Alexander Larsson
2a3710872f xdgmime: sort glob hits with larger weight first
Higher weight is more important, so return these first meaning
they will be used as the default.
2009-10-08 12:02:52 +02:00
Alexander Larsson
07ad638adf remove xdgmime test
This is getting diverged from the xdgmime copy and we don't need it here.
2009-10-02 12:55:54 +02:00
Alexander Larsson
c7c0bcef89 xdgmime - Correct the range checks for magic matching 2009-10-02 12:55:54 +02:00
Alexander Larsson
2624e7d6c6 Remove unnecessary includes 2009-10-02 12:55:54 +02:00
Alexander Larsson
e1643fd76d xdgmime - support the new case sensitive flag 2009-10-02 12:55:54 +02:00
Alexander Larsson
7c27df1fee xdgmime - support cache files with minor version 2 2009-10-02 12:55:54 +02:00
Alexander Larsson
ce239a010e Read the new glob2 format with case sensitive flags 2009-10-02 12:55:54 +02:00
Matthias Clasen
e9fe53980b Fix --runtime-libdir option
For stable releases, it needs to take LT_REVISION into account, not
hardcode 0.
2009-09-29 23:08:03 -04:00
Matthias Clasen
6555e0171d Fix mime_info_cache_dir_add_desktop_entries
This function tried to avoid adding duplicate entries, but failed
due to using the wrong search function. See bug 595972.
2009-09-29 20:52:26 -04:00
Matthias Clasen
5fdb169b72 Clarify docs of g_async_result_get_source_object
It returns a new reference. Reported in bug 596748
2009-09-29 20:33:39 -04:00
Alexander Larsson
90e1308809 Avoid critical error in thread check if source is destroyed
The source can be destroyed by the time we complete the result, and
then the g_source_get_context(current_source) call will cause
a critical error. We check for the source being destroyed and avoid
the check in that case.

This means we miss the right-thread check in this case, but thats
merely a helper, so this is not critical.
2009-09-29 11:27:15 +02:00
Alexander Larsson
6f1ce483eb Always report metadata on the path, not symlink target
Metadata are really part of the pathname, not the target file
(as they are stored by pathname, and for many metadata like icon position
etc make not sense using the target data). So, even if nofollow
is not specified we should not follow links for metadata.

Ideally this should be implemented in the metadata extension in gvfs,
but the extension API does not allow this, so we do it in gio.

See https://bugzilla.gnome.org/show_bug.cgi?id=593809
2009-09-28 15:55:44 +02:00
Josselin Mouette
cc4970cf94 Fall back to inotify_init if inotify_init1 does not work
This fixes monitoring failing to work when glib is built on a 2.6.27+
kernel but run on an older one.

http://bugs.debian.org/544354
https://bugzilla.gnome.org/show_bug.cgi?id=593775
2009-09-23 18:39:45 +02:00
Mart Raudsepp
c755a7fd11 gio: Fix some typos in G*AppInfo documentation 2009-09-22 11:22:44 +03:00
Mart Raudsepp
6c061da2a2 gio: Fix a Since tag to actually show up in new API of 2.20 indeces
Typo made in e05426062
2009-09-22 11:22:44 +03:00
Paolo Borelli
80f66b1141 Fix build with srcdir != builddir, bug #594597 2009-09-19 10:22:33 +02:00
Matthias Clasen
53fc10d269 Fix a lot of clang complaints
Mostly dead assignments.
2009-09-18 19:20:06 -04:00
Sjoerd Simons
8667317766 Fix GNetworkAddress skipping addresses when enumerating
g_network_address_address_enumerator_next_finish takes the first item of the
address list and moves the pointer to the next one, so we shouldn't do the same
in g_network_address_address_enumerator_next_async function

Fixes bug #593941
2009-09-11 15:25:34 +01:00
Richard Hughes
cdd04f36ca Make the error const for g_simple_async_result_set_from_error 2009-09-11 15:20:34 +01:00
James Hunt
11477609d1 g_socket_send_message() fails due to invalid sendmsg(2) params.
g_socket_send_message() and g_socket_send_to() fail with ENOBUFS or
EFAULT due to the fact that if no "address" argument is specified to
g_socket_send_message, when g_socket_send_message() calls sendmsg(2),
the 2nd parameter to sendmsg ("const struct msghdr *msg") contains
uninitialized values. The fix is simple - initialize msg.msg_name to
NULL and msg.msg_msg_namelen to 0.

https://bugzilla.gnome.org/show_bug.cgi?id=594759
2009-09-11 08:52:14 -04:00
Alexander Larsson
8af494d987 Avoid reading uninitialized memory
If the statfs call fails, don't look at the result.
2009-09-07 12:50:58 +02:00
Alexander Larsson
06de24f430 Remove warning in g_simple_async_result_complete
This warning hits code that uses GSimpleAsyncResult outside of a
mainloop as a helper object. For instance EggDBus does this.
Since the bugs this warning would fix are pretty easy to spot
and since EggDBus is deployed already we just remove the
"called from outside main loop" warning.

However, we need to keep the "called from wrong context" warning
as that is very helpful when debugging misuse of the new multiple
main context code.
2009-09-07 10:25:14 +02:00
Matthias Clasen
034d516160 Another dead assignment 2009-09-07 03:28:35 -04:00
Matthias Clasen
6cda9bfb02 Remove a dead initialization 2009-09-07 03:14:15 -04:00
Matthias Clasen
30645bd0a5 Remove a dead increment 2009-09-07 03:12:06 -04:00
Matthias Clasen
0d1ffbf361 Remove another dead assignment 2009-09-07 03:10:01 -04:00
Matthias Clasen
f2c8572d84 Remmove a dead assignment.
Spotted by clang.
2009-09-07 03:07:22 -04:00
Matthias Clasen
1ec32c403b Move a assignment to the relevant #ifdef branch
Dead code spotted by clang.
2009-09-07 03:02:58 -04:00
Matthias Clasen
e67c3cf2b0 Remove dead code 2009-09-07 03:01:02 -04:00
Matthias Clasen
80fd5ed402 Don't evaluate an uninitialized value
Bug found by clang.
2009-09-07 02:50:51 -04:00
Benjamin Otte
4114f1214c Bug 594034 - Use g_mkstemp_full() when creating the replacement file
Previous code used g_mkstemp(). But when using
G_FILE_CREATE_REPLACE_DESTINATION, no attempt was made to ensure proper
mode and flags of the created temporary file. The visible issue was that
the file was always created with mode 0600 as opposed to using 0666.
(The invisible issue was that O_RDWR was used instead of O_WRONLY.)
2009-09-04 22:45:57 +02:00
Benjamin Otte
3826963e65 Use lchmod instead of stat + chown if available
Fallout of the NOFLOOW_SYMLINKS fix from bug 593406
2009-09-01 21:53:35 +02:00
Benjamin Otte
48e0af0157 Bug 593406 - Permissions set to 777 after copying via Nautilus
Only fail to set the permissions when the actual file is a symlink.
The previous fix failed for every file when NOFOLLOW_SYMLINKS was set.
2009-09-01 21:33:11 +02:00
Benjamin Otte
bb7852e34b Only do the chmod NOFOLLOW_SYMLINK checks with HAVE_SYMLINK 2009-09-01 21:29:43 +02:00
Benjamin Otte
fc44bf40a4 Fix gtk-doc syntax 2009-09-01 12:48:55 +02:00
Benjamin Otte
e695c0932f Bug 593406 - Permissions set to 777 after copying via Nautilus
When doing a g_file_copy() with nofollow-symlinks (to copy a link for
example), the later copying of the file attributes copies the source
links 777 attributes to the target's attributes. As chmod affects the
symlink target, this would cause such copies to always set the target to
777 mode.

This patch makes setting the mode with nofollow-symlinks fail with
NOT_SUPPORTED.

The aforementioned g_file_copy() will still succeed, because it ignores
errors of the attribute copy.
2009-09-01 12:15:31 +02:00
Matthias Clasen
c47dca4cfe Re-commit 30b8774f7f
Turns out Alex had agreed to this.
2009-08-27 23:40:16 -04:00
Matthias Clasen
2889f1b8a3 Use the saved errno value
Bug 591995
2009-08-27 23:02:08 -04:00
Matthias Clasen
3a47f48311 Revert "add a "gsettings-backend" extension point to GIO"
This reverts commit 30b8774f7f.
2009-08-27 22:51:53 -04:00
Ryan Lortie
30b8774f7f add a "gsettings-backend" extension point to GIO 2009-08-27 13:45:48 -04:00
Matthias Clasen
eadef0325a Documentation fixes 2009-08-24 13:34:38 -04:00
Dan Winship
cd5bd15987 Use MSG_NOSIGNAL in GSocket if it's available
Even though we ignore SIGPIPE, gdb will still stop when the process
receives one, which sometimes confuses people into thinking the app
has crashed (eg, bug 578984, bug 590420), and is annoying anyway. So
use MSG_NOSIGNAL if it's there.

http://bugzilla.gnome.org/show_bug.cgi?id=591378
2009-08-19 12:12:15 -04:00
Dan Winship
021dd960cf Re-run res_init() when resolv.conf changes
libc caches the contents of resolv.conf, so if it changes (eg, because
the network state changed), we need re-run res_init().

http://bugzilla.gnome.org/show_bug.cgi?id=584246
2009-08-19 12:08:15 -04:00
Benjamin Otte
6db03d73a4 When creating a pipe for a cancelled cancellable, write to it
Includes (untested) fix for win32 that calls SetEvent() in that case.
2009-08-19 11:02:06 +02:00
Benjamin Otte
faae032ad0 Use g_cancellable_release_fd()
Part of: Bug 591388 - number of GCancellables available is too limited
2009-08-19 11:02:06 +02:00
Benjamin Otte
e2c97292c2 Implement g_cancellable_release_fd()
Part of: Bug 591388 - number of GCancellables available is too limited
2009-08-19 11:02:06 +02:00
Benjamin Otte
63426886ff Add g_cancellable_release_fd()
This patch only adds the function. The function is a NOP.
See the API documentation for a rationale.

Part of: Bug 591388 - number of GCancellables available is too limited
2009-08-19 11:02:05 +02:00
Benjamin Otte
bb8e4f06ab Bug 591714 – Figure out failure handling for g_cancellable_make_pollfd()
Make g_cancellable_make_pollfd() return a gboolean that indicates its error
status. Update the code that calls this function accordingly.
2009-08-19 11:02:05 +02:00
Benjamin Otte
a6ac4e90d5 Fix multiple returns in gtk-doc comment 2009-08-18 11:34:20 +02:00
Dan Winship
8f6d26e964 g_inet_socket_address_to_native: properly zero out sockaddr_in6 2009-08-17 13:20:49 -04:00
Shixin Zeng
406c3aa019 [Win32] Avoid superfluous '/' from g_file_resolve_relative_path()
Patch from bug #591532.
2009-08-14 23:23:28 +03:00
Dan Winship
882e36106d Fix a bad void return. #588901 2009-07-30 11:18:35 -04:00
Dan Winship
f34b1f024f Conditionalize portability #includes in g-asyncns.h
http://bugzilla.gnome.org/show_bug.cgi?id=589988
2009-07-29 22:35:07 -04:00
Dan Winship
45067ab9e9 Fix leaks in GSocketClient and GThreadedResolver
Also update gio/tests/send-data.c to test async connection, and free
more stuff in several tests to make leaks easier to see.
2009-07-23 16:27:01 -04:00
Lin Ma
4654a7d593 Fixed a missing head which will cause crashes for 64bit applications
Without that head, the returned pointer will be truncated to 32bit, then
causes crashes for 64bit applications.
2009-07-21 10:45:25 +08:00
Benjamin Otte
dfda26d1a9 Propagate the right error 2009-07-20 14:29:51 +02:00
Tor Lillqvist
474ba7dbc3 Make it compile on Windows.
Surround a symlink-related code snippet with ifdef S_ISLNK.
2009-07-07 14:39:10 +03:00
Matthias Clasen
3d1e812778 Document support_thread_contexts 2009-07-06 00:00:42 -04:00
Matthias Clasen
563c55bb71 Fix a segfault in g_cancellable_cancel 2009-07-05 23:38:09 -04:00
Matthias Clasen
5694ab7642 Revert "Move gio tests from gio/tests/ to tests/gio/"
This reverts commit 2262d76b33.

Move GIO tests back to where they belong.
2009-07-05 22:49:24 -04:00
Matthias Clasen
8de4be69a9 Move comment to the right place 2009-07-05 22:35:55 -04:00
Matthias Clasen
aa065346d3 Register ids for new file attributes 2009-07-05 22:26:11 -04:00
David Zeuthen
99a1c47343 Allow interaction when unmounting mounts
For details, see bug 587482. The new api:

 - Provide new _with_operation() variants of all unmount and eject methods

 - Add GMountOperation::show-processes signal
   - this can be used to show processes blocking an unmount operation

 - Deprecate all unmount and eject methods

 - Add g_drive_can_start_degraded() method
   - this is to avoid auto-starting degraded drives

 - Make g_drive_stop() resp. g_file_stop_mountable() take a GMountOperation
   - these ops were recently added and not yet public API so it's fine
     to change how they work

 - Provide a way to poll mountable files, e.g. g_file_poll_mountable()

 - Add some missing file attributes for mountable files
  - G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE
    - needed for the GDU Nautilus extensions to format a volume
  - G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED:
    - mimics g_drive_can_start_degraded()
  - G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL:
    - mimics g_drive_can_poll_for_media()
  - G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC
    - mimics g_drive_is_media_check_automatic()
2009-07-05 21:59:38 -04:00
Benjamin Otte
c85ff0c750 [gio] minor improvements to g_cancellable_cancel()
- make this function not crash when cancellable is NULL
- avoid locking when the cancellable has already been cancelled
2009-07-05 21:36:03 +02:00
Dan Winship
29e6525b1e Two "make check" fixes for late changes to the thread-context patch
g_simple_async_result_complete() now checks that it's being run from
the correct main loop, so tests/gio/simple-async-result was failing,
because it called it from outside any main loop. (And gio's pltcheck
was failing because I hadn't added g_main_current_source() to it.)
2009-07-01 13:52:49 -04:00
Benjamin Otte
2262d76b33 Move gio tests from gio/tests/ to tests/gio/
This avoids getting tests built every time when working on libgio and
running make in the gio/ directory.
2009-07-01 19:03:19 +02:00
Dan Winship
65cc5d895a Support g_main_context_push_thread_default() in gio
GFile allows for the possibility that external implementations may not
support thread-default contexts yet, via
g_file_supports_thread_contexts(). GVolumeMonitor is not yet
thread-default-context aware.

Add a test program to verify that basic gio async ops work correctly
in non-default contexts.

http://bugzilla.gnome.org/show_bug.cgi?id=579984
2009-07-01 09:02:46 -04:00
Dan Winship
90381ecdbd Use low-level GSource methods in a few more places
(in preparation for thread-default context support)
2009-07-01 09:01:48 -04:00
Dan Winship
28a39fab5a Remove some unused code 2009-06-30 19:05:44 -04:00
Dan Winship
70e8eed6ac Fix GResolver for g_simple_async_result_set_op_res_gpointer change
Previously, re-setting the pointer value would cause the old
GDestroyNotify to be lost; now it causes it to be run.

http://bugzilla.gnome.org/show_bug.cgi?id=587415
2009-06-30 18:48:36 -04:00
Benjamin Otte
d589da7e86 Bug 587434 – regression tests fail
make this test not only compile, but also run successfully with mad
CFLAGS.
2009-06-30 20:42:14 +02:00
Benjamin Otte
80561f9718 Bug 587434 – regression tests fail
I missed one s/tmpfile/tmp_file/ which caused crashes.
2009-06-30 20:40:52 +02:00
Dan Winship
53beca955e Add GCancellables to GSocket ops
Currently, to implement cancellability correctly, all synchronous
calls to GSocket must be preceded by a g_socket_condition_wait() call,
(even though GSocket does this internally as well) and all
asynchronous calls must do occasional manual
g_cancellable_is_cancelled() checks. Since it's trivial to do these
checks inside GSocket instead, and we don't particularly want to
encourage people to use the APIs non-cancellably, move the
cancellation support into GSocket and simplify the existing callers.

http://bugzilla.gnome.org/show_bug.cgi?id=586797
2009-06-30 11:42:17 -04:00
Benjamin Otte
fc2b3ee560 remove unused label
complained about by -Wall
2009-06-29 18:32:09 +02:00
Benjamin Otte
afd63c3281 fix warnings from gcc compilation with my mad CFLAGS 2009-06-29 18:25:02 +02:00
Benjamin Otte
4b8ad50fc4 add g_file_attribute_set_*_by_id() and use them
This patch and the previous ones fixes the performance issues noted in
Bug 587089 – lookup_attribute() takes too much CPU
It increases performance for querying attributes by ~15% in my tests.
2009-06-29 18:25:02 +02:00
Benjamin Otte
bd198e5e45 export and use _g_file_attribute_matcher_matches_id() 2009-06-29 18:25:02 +02:00
Benjamin Otte
ceba40c27d add private header with attribute ids
attribute ids are generated when the attribute hash is initialized. This
way we can guarantee that the ids match every time.
2009-06-29 18:25:02 +02:00
Benjamin Otte
2620c23577 split lookup_attribute() into two functions 2009-06-29 18:25:02 +02:00
Benjamin Otte
66cebd7292 split attribute hash initialization into its own function 2009-06-29 18:25:01 +02:00
Tom Parker
e7a258692c Add NULL to end of g_filename_complete_get_completions() return value
g_filename_complete_get_completions() return value is meant to be a
g_strfreev-compatible array i.e. NULL-terminated. However, pointer arrays
aren't automagically NULL-terminated. This fixes bug 586868
2009-06-26 22:43:31 -04:00
Alexander Larsson
d884e509db Allow setting G_FILE_ATTRIBUTE_TYPE_INVALID attributes in GFileInfo
This is used to unset an attribute in g_file_set_attributes_from_info.
2009-06-25 09:18:01 +02:00
Richard Hughes
b0dc7afd2a Allow GCancellable to be subclassed by adding a private structure 2009-06-24 10:33:24 +02:00
David Zeuthen
0ccd18bc83 Bug 586675 – Runtime library location
Introduce an option to specify the runtime location for libraries via
a relative path to libdir.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-06-23 12:58:35 -04:00
Alexander Larsson
7662c86611 Add extension point for adding metadata for local files
This adds a local_file_add_info vfunc to GVfs that vfs implementations
can override to add metadata for local files.
2009-06-23 16:35:42 +02:00
Alexander Larsson
9a6146f54c Add g_file_info_set_attribute_status
Required for gvfs implementation for set_attribures_from_info.
2009-06-23 16:35:41 +02:00
Alexander Larsson
becf4186e6 Add g_file_info_has_namespace
Need this to quickly see if we should set attributes from
this GFileInfo in metadata extension.
2009-06-23 16:35:41 +02:00
Alexander Larsson
0ed9201ad2 Add string vector attribute type to GFileInfo
This is needed for the new metadata backend since nautilus has a
string-list metadata type, and we want to use this for nautilus.
2009-06-23 16:35:41 +02:00
Alexander Larsson
c1ab6454fe Copy namespaces correctly in g_file_copy_attributes
File attribute namespaces are delimited with "::", but
build_attribute_list_for_copy only used ":", so we didn't copy
any writable namespaces.
2009-06-23 16:35:41 +02:00
Matthias Clasen
854a43a3cd Fix build on mingw
Mingw does not have sys/uio.h. This was reported in bug 585937.

Author:    Matthias Clasen <mclasen@redhat.com>
2009-06-19 23:25:18 -04:00
Alexander Larsson
8cb481fd5f Use io_prio as mainloop prio for async-emulation (#579449)
I'm not sure why we used the elaborate formula to convert the io-priority
to the priority of the mainloop idle when emulating async i/o with idles.
However, it causes the default io priority to be less than the normal
idle prio, so the i/o won't be scheduled if there is an idle outstanding.

There is really no great mapping to use here, doing blocking i/o in an
idle of any prio is generally bad and apps doing a lot of async i/o should
initialize threads. However, if we use the io-priority directly we at least
avoid the starvation problem above and make things easier to understand.
2009-06-18 19:43:46 +02:00
Benjamin Otte
9fba812884 Revert "clarify documentation"
This reverts commit d218cf0f67.
This has been fixed in the code, so no need to keep the updated docs.
2009-06-18 15:29:41 +02:00
Benjamin Otte
835c03a5c1 syntax fix in documentation 2009-06-18 15:27:42 +02:00
Benjamin Otte
cf95d07691 fix typo in documentation 2009-06-18 15:27:42 +02:00
Benjamin Otte
d218cf0f67 clarify documentation 2009-06-18 15:27:41 +02:00
Matthias Clasen
0fbeab4520 Add g_setenv 2009-06-15 12:57:21 -04:00
David Zeuthen
fae755e056 Bug 585591 – Starting/stopping drives
Add API for starting/stopping drives. This new API will enable
GVolumeMonitor and GVfs implementations to add support for the
following features

 1. Powering down external hard disk enclosures / drives

 2. Starting/stopping multi-disk devices (such as RAID/btrfs/ZFS)

 3. Connecting/disconnecting iSCSI devices

 4. Reacting to the user pressing e.g. the "remove drive" button on
    a IBM/Lenovo Ultrabay: http://www.thinkwiki.org/wiki/Ultrabay

See the bug for the corresponding GVfs and Nautilus changes.
2009-06-15 10:59:43 -04:00
Ondrej Jirman
bb4f7c48f9 Fix incorrect freeing of thread pool in GThreadedSocketService (#584255) 2009-06-15 15:56:45 +02:00
Alexander Larsson
31cb0bdcb0 Emit changed in g_socket_listener_add_socket, not in add_address
This way we emit this signal when add_socket is called from another
place than add_address too.
2009-06-15 15:43:39 +02:00
Alexander Larsson
a640695f16 Ref the passed in socket in g_socket_listener_add_socket (#585599) 2009-06-15 15:42:38 +02:00
Alexander Larsson
67de6cba50 Add bound address out-argument to g_socket_listener_add_address (#585566)
This is very useful when binding to "any" port.
2009-06-15 14:23:57 +02:00
Alexander Larsson
740ae3aa29 Avoid unnecessary work if mount watching not specified (#585360)
If G_FILE_MONITOR_WATCH_MOUNTS isn't specified, don't do all the work
when the mtab changes.
2009-06-15 12:26:57 +02:00
Matthias Clasen
129eb07482 Support special icons for xdg user dirs
The icon names are folder-documents, folder-download, folder-music,
folder-pictures, folder-publicshare, folder-templates, folder-videos.
See bug 541276.
2009-06-15 01:45:34 -04:00
Matthias Clasen
50a7f53055 Don't use deprecated GLib api
Fixes bug 585673.
2009-06-15 01:12:50 -04:00
Matthias Clasen
642e9c7540 Fix the icon property implementation
Turns out both the setter and the getter were broken...
Fixes bug 585676.
2009-06-15 00:45:55 -04:00
Matthias Clasen
b533a944ff Trivial formatting fixes 2009-06-15 00:38:34 -04:00
Matthias Clasen
ce4aa6253e Include sys/uio.h for struct iovec
This fixes the build on OS X, bug 585280.
2009-06-14 23:55:12 -04:00
Matthias Clasen
8a3a3d797e Use inotify_init1 when available
To avoid leaking the inotify fd. Fixes bug 585478.
2009-06-14 22:29:17 -04:00
Ryan Lortie
4dbc2074bc Add GNIO test cases to .gitignore 2009-06-14 13:58:35 -04:00
Ryan Lortie
cb1a609240 Bug 585575 – g_socket_listener_add_inet_port()
Change the logic in g_socket_listener_add_inet_port() as per the
reasoning in the bug report.

  - If the OS supports neither IPv6 or IPv4, fail.
  - If the OS supports only IPv6, do that.
  - If the OS supports only IPv4, do that.
  - If the OS supports IPv6 and IPv6 "speaks" IPv4 then bind it
    and be done.
  - If the OS supports IPv6 and IPv6 doesn't "speak" IPv4 then
    create an additional socket for IPv4.
  - If binding any socket fails then fail the entire call.

Also, remove the ability to call this function with port == 0.  This
is a useless thing to do anyway since you have no way to know what
port number was actually allocated.  We should have a separate
function to deal with this.
2009-06-12 13:01:04 -04:00
Ryan Lortie
f7d756f5b6 add g_socket_speaks_ipv4()
Partial fix for Bug 585575.
2009-06-12 12:21:07 -04:00
Benjamin Otte
fd22781b18 make all APIs that take inet port arguments take a guint16 2009-06-12 15:57:51 +02:00
Benjamin Otte
3e3e3c2946 don't make strings const when they are not
gets rid of compiler warnings
2009-06-12 15:57:12 +02:00
Matthias Clasen
a402875de1 Fix an oversight in the previous commit
We don't want to unset DISPLAY etc, if none is specified in the
app launch context.
2009-06-11 12:41:16 -04:00
Matthias Clasen
9e43937d03 Include sys/types.h in gunixfdmessage.c
As recommended in 'man socket'. Fixes bug 585281.
2009-06-10 23:28:32 -04:00
Matthias Clasen
d3d81f74c5 Make setting DISPLAY work
And remove a bunch of grotty code to manipulate an environment
array at the same time. Instead, simply call setenv in the child_setup
function.
2009-06-10 16:20:51 -04:00
Dan Winship
74a3c71dcf Revert part of fix for old OS X that broke the compile on current OS X
http://bugzilla.gnome.org/show_bug.cgi?id=584574
2009-06-09 09:32:43 -04:00
Benjamin Otte
ced88fd0de Bug 585189 – g_cancellable_reset() must be called in same thread ...
... as g_cancellable_cancel()
Rework a g_critical() that would (rarely) trigger when _reset() was
called in a thread different from _cancel() by making _reset() wait for
the cancel function to be finished the same way
g_cancellable_disconnect() uses.
2009-06-09 12:19:24 +02:00
Benjamin Otte
74fd3e734f typo in documentation 2009-06-08 15:30:28 +02:00
Benjamin Otte
29a4a0a44d only query file info in g_file_copy() when we need it
The default implementation of g_file_copy() checked the size of the file
to copy to give useful progress updates unconditionally. This can cause
long delays on 1-connection FTP servers while it tries to open a second
connection before it returns EBUSY. This patch makes this query only
happen when we actually send progress updates.
2009-06-08 15:30:28 +02:00
Alexander Larsson
0bb5739f32 Reformat g_themed_icon_get_names return type to make gtk-doc work
Seems the gtk-doc scanner needs "const gchar* const *" to work, so switching
to that.
2009-06-01 22:10:41 +02:00
Dan Winship
ce6fbd6231 Fix multiple bugs in g_srv_target_list_sort()
In particular, targets with weight 0 should be very UNlikely to be
selected, not very likely, as they were before. However, even ignoring
that bug in the logic, there was an additional bug (swapping list
items would cause the 0-weight items to get re-ordered incorrectly
anyway), and the code contained several fencepost errors.

This patch also adds gio/tests/srvtarget.c, which confirms that for a
sample list of targets, we now generate all possible correct random
sortings and no incorrect sortings, and the correct sortings occur in
roughly the expected proportions (though if the current code is
still wrong, those proportions may be wrong as well).

http://bugzilla.gnome.org/show_bug.cgi?id=583398
2009-06-01 14:31:48 -04:00
Dan Winship
1ca91a2125 Clarify some GSocket docs 2009-06-01 14:24:44 -04:00
Dan Winship
5b3d62a7a6 Misc networking build fixes
http://bugzilla.gnome.org/show_bug.cgi?id=580301
http://bugzilla.gnome.org/show_bug.cgi?id=584176
2009-06-01 14:21:05 -04:00
Tor Lillqvist
85816117e3 Bump _WIN32_WINNT to 0x0501
Needed to get prototypes for getaddrinfo() and friends on mingw.
2009-06-01 14:04:49 +03:00
Hans Breuer
75ef018248 Updated msvc build files 2009-05-30 15:29:23 +02:00
Hans Breuer
780185449f Version resource template for gio 2009-05-30 15:24:06 +02:00
Hans Breuer
73dbe591fb Handle EAI_NODATA==EAI_NONAME in win32 SDK 2009-05-30 15:18:02 +02:00
Hans Breuer
cbca0ac5d9 Include io.h for write() on win32 2009-05-30 15:14:01 +02:00
Hans Breuer
f4e89ab877 Replace FIXME with proper SDK version define 2009-05-30 15:02:14 +02:00
Matthias Clasen
62abf79be2 Another pedantic docs fix 2009-05-28 14:40:18 -04:00
Alexander Larsson
d32226da6d Ref the right type in g_socket_control_message_deserialize
We were not looking at the right type at all due to a typo.
2009-05-28 15:34:57 +02:00
Alexander Larsson
390549f6c4 Document g_socket_control_message_deserialize 2009-05-28 15:34:57 +02:00
Shixin Zeng
dbe7408a5c Fix string length bugs in GWinHttpFile (#580347) 2009-05-28 12:55:11 +03:00
Matthias Clasen
a859f883cf Fix make check 2009-05-28 00:30:21 -04:00
Matthias Clasen
576839adbe Fix references to nonexisting functions 2009-05-27 22:44:31 -04:00
Matthias Clasen
06144900ec Documentation and coding style fixups
Lots of pedanic changes.
2009-05-27 18:20:08 -04:00
Hans Breuer
209a662c2f Correct reference and implement close_fn (#578769)
Do proper referencing and unreferencing of
GWinHttpFileInputStream::file and
GWinHttpFileInputStream::file::vfs. Implement
GWinHttpFileInputStream::close_fn.
2009-05-27 15:12:31 +03:00
Alexander Larsson
f99be75ff9 Remove mention of non-existing calls from docs
The docs mentions a separate seekable API for the various file streams
which don't actually exists. Change this to refer to the generic
GSeekable calls.
2009-05-25 15:46:35 +02:00
Alexander Larsson
3c0feca7f1 Don't end enum with comma (#583663)
This is valid C but breaks C++, so don't put it in headers.
2009-05-25 12:47:12 +02:00
Alexander Larsson
c93c98732a Don't return something from a void function (#583408) 2009-05-25 12:46:03 +02:00
Alexander Larsson
ce171195d9 Add g_inet_address_get_native_size (#583205)
This can be used to get the size of g_inet_address_to_bytes().
2009-05-25 11:33:56 +02:00
Christian Persch
54b43229f4 Use g_error_new_valist instead of a private copy of it 2009-05-23 17:53:01 +02:00
Alexander Larsson
14d53dcfa8 Fix connect on win32
We should not wait before calling connect for non-blocking connect.
Also, use the right error code for the nonblocking pending case on win32.
2009-05-20 16:40:55 +02:00
Alexander Larsson
bb66fdcce3 Fix build on win32 2009-05-20 16:40:54 +02:00
Alexander Larsson
c897cca601 Don't add unix specific APIs on win32 2009-05-20 16:40:54 +02:00
Alexander Larsson
5a46e4d140 Clarify g_cancellable_push_current docs wrt cancellable being NULL (#575013) 2009-05-20 14:55:14 +02:00
Alexander Larsson
ab29e09dac Don't dereference identifier_type if it is NULL (#579558) 2009-05-20 14:46:51 +02:00
Robert Bragg
d0d10e847f Take a reference on the gio file monitors while signaling pending file changes
It was possible for a signal handler to remove the last reference and
dispose the monitor.  If there were remaining pending_file_changes they
tried to dereference the disposed monitor.

This patch simply calls g_object_{ref,unref} around the loop that signals
the changes.
2009-05-20 14:23:53 +02:00
Alexander Larsson
6a9df8256a Use G_GSSIZE_FORMAT where needed (#577884) 2009-05-20 14:17:27 +02:00
Sjoerd Simons
7498049a16 Propagate errors from g_network_service_address_enumerator_next_async in its _finish function 2009-05-20 13:59:50 +02:00
Jonathon Jongsma
2be66c0458 Typedef GResolverClass in the standard way
It's a bit lame, but some of our C++ wrapping scripts expect objects to be
typedefed like:
    typedef struct _FooClass FooClass;
    struct {} _FooClass;

Rather than:
    typedef struct {} FooClass;

Functionally they're the same, but the former makes our lives easier in the
short term
2009-05-20 13:58:13 +02:00
Alexander Larsson
cb7a300e31 Don't return something from void function (#583229)
g_async_initable_init_async is void, don't return something from it.
2009-05-20 13:49:47 +02:00
Christian Persch
1cbdd2495d Preserve errno when using g_set_error with _() and g_strerror() 2009-05-20 13:47:55 +02:00
Christian Persch
80cfd099f3 Use g_set_error_literal
Bug #583206.
2009-05-20 13:46:39 +02:00
Alexander Larsson
c20b8d4d53 Check that close_fn is not %NULL before calling (#578499)
Some streams have no close function, so this caused a crash.
2009-05-20 13:41:25 +02:00
Sjoerd Simons
9033b37589 Add helper functions for connecting to service (#583061) 2009-05-20 12:41:50 +02:00
Dan Winship
25800ed4a3 Ignore SIGPIPE when using GSocket
http://bugzilla.gnome.org/show_bug.cgi?id=583001
2009-05-20 12:32:58 +02:00
Alexander Larsson
2ea22d8f46 Remove non-existing parameter from docs
g_unix_socket_address_abstract_names_supported has no address argument
2009-05-20 12:14:55 +02:00
Alexander Larsson
9d36c86f8a Add missing symbols to gio.symbols 2009-05-20 12:14:55 +02:00
Alexander Larsson
5cd86fbda6 Remove protocol names, instead use an enum with common protocols
The whole protocol name thing is pretty weird. The getprotobyname functions
seem to only specify one mapping for name <-> ids, so all families/types
must use the same values. Plus the values used for the protocols are
standardized by IANA, so are always the same.

So, we drop using names for protocols, intead introducing an enum with
a few commonly availible and used protocols.
2009-05-20 12:14:50 +02:00
Alexander Larsson
6d01593b06 Clarify "current condition" in g_socket_create_source docs 2009-05-20 11:30:43 +02:00
Alexander Larsson
8088182644 Actually implement max_threads for GThreadedSocketService 2009-05-20 11:28:27 +02:00
Alexander Larsson
053f9e72b1 Add support for graceful disconnect to GTcpConnection 2009-05-20 11:19:47 +02:00
Alexander Larsson
f061765e54 Call sync close function directly in async implementation
The g_io_stream_wrapper fails since there is already an outstanding
operation (the async close).
2009-05-20 11:18:34 +02:00
Alexander Larsson
fdfdec36d0 Add send-data, a g_socket_client test case 2009-05-19 13:44:11 +02:00
Alexander Larsson
18373cfbe8 Set the listen backlog before calling listen.
If we set it after it won't be used.
2009-05-19 12:06:29 +02:00
Alexander Larsson
64383fa3d9 Fix g_unix_socket_address_abstract_names_supported docs
The previous description was a cut-n-paste from another function.
2009-05-19 11:53:42 +02:00
Alexander Larsson
0ffe722193 Add g_socket_shutdown 2009-05-19 11:52:33 +02:00
Alexander Larsson
03441e724a Document GOutputVector and GInputVector 2009-05-19 11:27:07 +02:00
Alexander Larsson
e1a4389cbc Rename g_socket_check_pending_error to g_socket_check_connect_result
This is only used for connect anyway, and this describes the operation
better.
2009-05-19 10:57:58 +02:00
Alexander Larsson
bcba61c951 Update docs on listen backlog
Mention g_socket_set_listen_backlog in g_socket_listen.
Explain that listen backlock needs to be set before calling
listen. Also verify this with a g_return_if_fail.
2009-05-19 10:47:55 +02:00
Alexander Larsson
69130db81a Read socket state in g_socket_get_local/remote_address
Previously we saved the location in various places which is unnecessary
and sometimes even wrong. For instance, we saved the address we bound to
which may not have the final port set.
2009-05-19 10:40:27 +02:00
Alexander Larsson
f8cd1c5304 Clean up refereces to @protocol_id in g_socket_new docs
This was not fully updated from the protocol to protocol_id change.
2009-05-19 10:16:32 +02:00
Alexander Larsson
3756ddb0ee Ignore error when setting SO_REUSEADDR
The main error would be "not supported" which could happen for e.g.
unix domain sockets, we don't really care, as this is mainly something
for TCP to help out a bit.
2009-05-18 23:24:13 +02:00
Alexander Larsson
f24c7fa9cb Add support for abstract unix socket addresses 2009-05-18 21:31:28 +02:00
Alexander Larsson
d8bdc3e567 Add GError to g_socket_address_to_native
This is nice for some callers so they can report an error.
It is also required to support opional address types like
abstract paths for unix domain sockets.
2009-05-18 21:31:28 +02:00
Alexander Larsson
6ea86cc57f Update the docs for the new network APIs
This imports the network APIs into the gio reference docs, and cleans
up a bunch of gtk-doc warnings and documentation issues.
2009-05-18 13:07:43 +02:00
Alexander Larsson
e1afc6e79b Remove gtk-doc warnings
Some code was using gtk-doc comment blocks for non-gtk-doc contents, just
turn it into ordinary comments.
2009-05-18 13:07:39 +02:00
Alexander Larsson
c3f4e01627 Make all non-static functions start with underscore
We don't want to export a lot of non-namespaced internal symbols.
2009-05-18 11:27:49 +02:00
Alexander Larsson
66d49b8bde Remove g_socket_set/get_reuse_address from header
These functions have been removed.
2009-05-18 09:28:26 +02:00
Alexander Larsson
13cb011762 Add max_threads argument to g_threaded_socket_service_new 2009-05-18 08:47:49 +02:00
Paul Pogonyshev
5b683af237 Fix error message in set_mtime_atime()
Bug #578786.
2009-05-17 15:17:57 +03:00
Alexander Larsson
34e74378c9 Add test apps for highlevel socket classes
echo-server - simple echo server
httpd - simple http server
2009-05-15 21:34:14 +02:00
Alexander Larsson
67df7d43e9 Add references to highlevel classes in GSocket docs 2009-05-15 21:27:54 +02:00
Alexander Larsson
ce8361217c Import all the highlevel socket classes from gnio 2009-05-15 21:26:24 +02:00
Alexander Larsson
2597e3adc3 Remove unused variable 2009-05-15 20:58:27 +02:00
Alexander Larsson
4ade78fc3d Include stdlib.h to avoid warning
Fixes a "implicit declaration of function ‘strtol’" warning
2009-05-15 20:43:02 +02:00
Alexander Larsson
d3a2c457cb Forgot to return the allocated data in async_op_wrapper_new 2009-05-15 20:42:04 +02:00
Alexander Larsson
a48fc53251 Make cancellable pipe fds close-on-exec
GCancellable is purely an in-process thing, so ensure that no cancellable
fds accidentally leak to child processes.
2009-05-15 10:42:28 +02:00
Alexander Larsson
23424e7bcb Add padding to new classes 2009-05-15 10:28:30 +02:00
Alexander Larsson
8f67f47e05 Add test apps for GSocket API 2009-05-15 10:08:18 +02:00
Alexander Larsson
a258ec3b5b Fix deadlock in threaded resolver
When you're using the threaded resolver and using a sync call
without a cancellable the resolve_sync forgot to unlock the
initial req->mutex lock, leading to a deadlock when unrefing
the request.
2009-05-15 10:05:55 +02:00
Alexander Larsson
f662e7e86b Store protocol by id, add lookup function for name
We want to use the protocol id for lookup in the GSocketConnection
code, so we expose it. We also make GSocket store the protocol
as an int for less memory use and to allow platform specific protocols
to be specified.

Also added g_socket_protocol_id_lookup_by_name() to allow the higher
level code to specify the name by string, and g_socket_get_protocol_name()
to get it.
2009-05-15 09:10:23 +02:00
Alexander Larsson
bd87df9e73 Make GSocketSourceFunc return the GSocket
This is very useful when you have multiple sockets with sources.
2009-05-14 18:12:40 +02:00
Alexander Larsson
7ffdc91f51 Set optlen before calling getsockopt
We were sometimes failing in g_socket_check_pending_error because
we were not setting optlen on input and it was sometimes randomly
less than sizeof(int).
2009-05-14 16:19:07 +02:00
Alexander Larsson
145cec3c93 Import GInitable, GSocket and dependencies from gnio
This adds:
GInitable - failable object constructor interface
GAsyncInitable - async failable object constructor interface
GSocket - Platform independent lowlevel berkely socket style object
GSocketControlMessage - For passing control messages over GSocket
GUnixFDMessage - unix fd passing socket control message

Some changes were done during the import from gnio to make things
work in glib. For instance, types were moved to other headers, header
file boiler plate were updated to glib style and gio.symbols stuff
was added.
2009-05-14 15:44:36 +02:00
Alexander Larsson
33c00e5c33 Add g_network_address_parse
This is useful if you want to allow users to specify
the hostname and optionally a port.
2009-05-14 15:34:12 +02:00
Alexander Larsson
80a484ad2c Add the new GFile ops to gio.symbols
This adds all the symbols related to GFile GIOStream support that was
recently added.
2009-05-14 15:34:12 +02:00
Alexander Larsson
ed08218565 Add tests for local GIOStream GFile ops 2009-05-13 14:42:57 +02:00
Alexander Larsson
14d58d51a3 Local file implementation of GFileIOStream and ops
This implements all the GIOStream file ops for local files.
We use the "fallback to output stream" for all GFileIOStream ops.
Some helpers stuff was added to the local input and output streams
so they could be reused.
2009-05-13 14:42:57 +02:00
Alexander Larsson
7a2d4889b5 Add GIOStream operations to GFile
g_file_open_readwrite, g_file_create_readwrite, g_file_replace_readwrite
and async variants, with default implementations using threads.
2009-05-13 14:42:51 +02:00
Alexander Larsson
bd0b8c60c2 Add GFileIOStream class
This is similar to GFileInputStream and GFileOutputStream for GIOStreams.
The default implementations chain to the Output stream.
2009-05-13 14:42:46 +02:00
Alexander Larsson
6d0bebb7df Add comment about lifecycle issues for GIOStreams 2009-05-13 14:42:45 +02:00
Alexander Larsson
05f544c591 Import GIOStream from gnio
Based on gnio rev 84516a5f544d8d5f3da368a83844e84eca8ef771
2009-05-13 14:42:38 +02:00
Alexander Larsson
1ecfae6a71 Remove close in finalize, we do it in dispose
This is not needed, and in fact it may be a bad idea to call
it from finalize anyway since the object isn't fully alive then.
2009-05-13 13:18:28 +02:00
Alexander Larsson
2bbb85633f Remove not actually used member "cancelled" 2009-05-12 13:58:18 +02:00
Alexander Larsson
b3e4b761f4 Fix gcancellable.c build on non-win32
I forgot to add #ifdef G_OS_WIN32 in one place, sorry.
2009-05-06 13:26:17 +02:00
Alexander Larsson
e10edefff1 Simplify GCancellable support on win32
There is no need to have a GIOChannel in the GPollFD in
g_cancellable_create_pollfd. All we need is an Event object that
we signal when cancelling and reset when resetting.

Also, supporting g_cancellable_get_fd on Windows using _pipe is useless
as it doesn't work with any corresponding poll() function, so just don't
support that on win32.

I tested this with the cancellation support in GSocket from gnio.
2009-05-06 13:14:04 +02:00
Paul Pogonyshev
2fff3026ef Don't try to ref NULL pointer in g_desktop_app_info_dup()
Fixes bug #573246.
2009-05-05 22:16:59 +03:00
Carlos Garnacho
d89cc0d7cb Add a GMount::pre-unmount signal
This is the per-mount analogon to GVolumeMonitor::mount-pre-unmount.
2009-05-05 14:45:18 -04:00
Matthias Clasen
a28215fa90 Release 2.21.0 2009-05-03 18:08:49 -04:00
Paul Pogonyshev
4e694faa33 Fix g_input_stream_skip_async() documentation
Remove mention of inexisting argument.  Spotted in relation to bug
581229.
2009-05-04 00:55:35 +03:00
Matthias Clasen
3f06ddd8cd Match up parameter names to help gtk-doc 2009-05-02 23:17:29 -04:00
Matthias Clasen
2e4b51aeb3 Plug a memory leak in g_simple_async_result_set_op_res_gpointer
Fixes bug 579272.
2009-05-02 22:59:02 -04:00
Dan Winship
92ac8d165e Misc warning fixes
glib/pcre/pcre_ucp_search_funcs.c, glib/pcre/pcre_valid_utf8.c: add
back missing config.h includes, and this time add them to the copies
in glib/update-pcre/ too so they don't get lost again on the next PCRE
update.

glib/garray.c, glib/gbase64.c: fix signed/unsigned pointer casts

gio/xdgmime/xdgmimeglob.c: remove unused variable

gio/tests/live-g-file.c: fix printf args on x86_64

tests/Makefile.am, tests/regex-test.c: remove redundant -DENABLE_REGEX
2009-05-01 10:37:45 -04:00
Alexander Larsson
d8029ca9bc Ensure g_inet_address_get_type() call is not optimized away
Yet another place where the get_type call can be optimized away due
to the G_GNUC_CONST attribute. Use a volatile variable to ensure
its not.
2009-04-30 10:46:37 +02:00
David King
97fe421518 Fix ginetaddress.c compile on Linux
The GType type definition belongs outside the G_OS_WIN32 typedef.
2009-04-29 14:23:17 -04:00
Alexander Larsson
d80e12104f Ensure we're actually initializing the winsock library
It turns out that just calling g_inet_address_get_type() isn't
enough, since its marked G_GNUC_CONST, so the call is optimized
away. If we assign the return value to a volatile location we ensure
it is called.
2009-04-29 12:19:57 +02:00
Dan Winship
7c9caecfeb Fix the networking stuff on (current) OS X
OS X's headers split up the current and old (BIND 4) nameserver stuff
slightly differently than Linux does, but explicitly including
arpa/nameser_compat.h does the right thing on both. Part of #580301
2009-04-26 13:21:53 -04:00
Dan Winship
9a15da50e4 Fix ginetaddress.c compile on Solaris
In glibc, IN6_IS_ADDR_UNSPECIFIED() et al. cast their argument to a
uint32_t*, so it doesn't matter whether you pass them the in6_addr
itself (which is what you're supposed to do) or one of its union
members (which is what we were actually doing). Solaris's macro
accesses the in6_addr fields directly though, and so only works if you
pass the actual in6_addr. #580194.
2009-04-26 13:18:17 -04:00
Johan Bilien
491a036d84 Fix translation from GIO's file attr to xattr attributes
Bug 579862 – requesting xattr::foo ends up calling getxattr(...,
user.:foo,...)

The patch makes sure we escape xattr::, not xattr:, before adding user.
and calling getxattr.
2009-04-22 19:09:34 +01:00
Christian Persch
a9c33dbd7a Use P_ for translatable param spec strings
Translatable param spec strings should be annotated with P_() instead of
plain _(). Bug #579830.
2009-04-22 16:11:38 +02:00
Dan Winship
9a3d18d2a6 GResolver wrappers: GNetworkAddress, GNetworkService, GSocketConnectable
Higher-level wrappers around GResolver. GSocketConnectable provides an
interface for synchronously or asynchronously iterating multiple
socket addresses, with GNetworkAddress and GNetworkService providing
interfaces based on hostname and SRV record resolution.
Part of #548466.
2009-04-22 08:36:38 -04:00
Dan Winship
c94d3f9288 Add GResolver, a glib-ish interface to DNS
GResolver provides asynchronous (and synchronous-but-cancellable) APIs
for resolving hostnames, reverse-resolving IP addresses back to
hostnames, and resolving SRV records. Part of #548466.
2009-04-22 08:36:32 -04:00
Dan Winship
68fc055627 Add network address and socket types
Types and methods for dealing with IPv4 and IPv6 addresses (and UNIX
domain socket addresses under UNIX). This does not include code for
actual socket I/O.

Originally from "gnio". Much of the code was written by Christian
Kellner, Samuel Cormier-Iijima, and Ryan Lortie.

Part of #548466.
2009-04-22 08:36:10 -04:00
Alexander Larsson
0f48f804b6 Use g_cancellable_connect/disconnect
Use the new cancellable helper functions to avoid races. (#572844)
2009-04-20 13:17:10 +02:00
Alexander Larsson
0001014c37 Add helpers for connecting/disconnecting to cancelled signal
There are race conditions when connecting and disconnecting from the
"cancelled" signal on GCancellable which you need to do when
implementing cancellable operations. This adds helper functions that
avoid these races and mentions these races in the docs. (#572844)
2009-04-20 13:17:03 +02:00
Matthias Clasen
2c1dc529e8 Add a note about handling non-hal backends 2009-04-09 21:34:49 -04:00
Gian Mario Tagliaretti
856632c496 Fix a typo in GFile docs
Fixed function name in GFile docs from g_set_display_name to
g_file_set_display_name so that gtk-doc can link correctly.  (#578002)
2009-04-09 14:35:57 -04:00
Alexander Larsson
d0cf7b3878 Only mark regular files as backup files
Apps don't generally create backup directories, etc. So, if the file
ends with ~ but is not a regular file shouldn't be considered a backup
file. (#573673)
2009-04-08 09:12:02 +02:00
Matthias Clasen
e6e82c51a6 Move hex_digits to rodata
Turn a string into a constant array.
2009-04-03 00:35:43 -04:00
Matthias Clasen
25ff8ee748 Don't lie about ext4 filesystems
When returning a filesystem type id, say "ext3/ext4" instead of "ext3",
since both use the same superblock magic, so we can't discriminate
them without more work.
2009-04-03 00:23:54 -04:00
Alexander Larsson
1ce74b0dd3 On trash, if rename fails with EXDEV, return G_IO_ERROR_NOT_SUPPORTED
Sometimes it seems like the trash dir and the file are on the same
filesystem but the rename fails with EXDEV anyway (can happen
e.g. with bind mounts or multiple mounts of the same device). In this
case we want to return the right error so that apps can fallback to
regular delete.
2009-04-02 19:01:56 +02:00
Matthias Clasen
785bed2e18 Update README files to refer to git
Update various README files to refer to git instead of svn.
Add a README.commits that is pretty much a copy of the same file
in GTK+. Also discontinue ChangeLog files.
2009-03-31 19:39:16 -04:00
Carlos Garnacho
dabbea65c6 Bug 575270 – GVolumeMonitor::mount-pre-unmount not being emitted
2009-03-26  Carlos Garnacho  <carlosg@gnome.org>

        Bug 575270 – GVolumeMonitor::mount-pre-unmount not being emitted

        * gunixmount.c (eject_unmount_cb) (eject_unmount_do_cb)
        (eject_unmount_do): Emit ::mount-pre-unmount and wait 500msec before
        actually trying to unmount.


svn path=/trunk/; revision=8020
2009-03-26 13:59:02 +00:00
Colin Walters
1d1fba442f Bug 575708 - runaway inotify madness ...
2009-03-17  Colin Walters  <walters@redhat.com>

	Bug 575708 - runaway inotify madness ...

	* gfilemonitor.c: Queue up events in a local list and
	fire one idle, instead of queuing lots of individual
	idles which has bad performance behavior.


svn path=/trunk/; revision=8010
2009-03-17 21:59:18 +00:00
Alexander Larsson
a3fe428081 fix attributes argument of query_info methods to be "const char *".
2009-03-17  Alexander Larsson  <alexl@redhat.com>

        * glocalfileinputstream.c:
        * glocalfileoutputstream.c:
	fix attributes argument of query_info methods to
	be "const char *".


svn path=/trunk/; revision=8000
2009-03-17 11:21:37 +00:00
Alexander Larsson
6cff88ba18 Bug 575555 – Use fsync() when replacing files to avoid data loss on
2009-03-16  Alexander Larsson  <alexl@redhat.com>

	Bug 575555 – Use fsync() when replacing files to avoid data loss on crash

        * configure.in:
	Look for fsync().

        * glib/gfileutils.c:
        (write_to_temp_file):
	fsync temp file if destination file exists

2009-03-16  Alexander Larsson  <alexl@redhat.com>

	Bug 575555 – Use fsync() when replacing files to avoid data loss on crash

        * glocalfileoutputstream.c:
        (g_local_file_output_stream_close):
        (_g_local_file_output_stream_replace):
	fsync temp file before closing if replacing target file

	

svn path=/trunk/; revision=7991
2009-03-16 16:03:13 +00:00
Matthias Clasen
5a8a224ff0 2.20.0
svn path=/trunk/; revision=7976
2009-03-13 05:44:11 +00:00
Alexander Larsson
70a276eca3 Bug 573843 – g_get_current_dir returns non-absolute path
2009-03-04  Alexander Larsson  <alexl@redhat.com>

	Bug 573843 – g_get_current_dir returns non-absolute path

	* glocalfile.c (canonicalize_filename):
	Handle the case where g_get_current_dir() returns a non-absolute path.


svn path=/trunk/; revision=7958
2009-03-04 13:47:53 +00:00
Alexander Larsson
73477419e8 Bug 573970 – crash in gunixvolumemonitor:update_mounts when unmounting
2009-03-04  Alexander Larsson  <alexl@redhat.com>

	Bug 573970 – crash in gunixvolumemonitor:update_mounts when unmounting

        * gunionvolumemonitor.c:
        (g_union_volume_monitor_dispose):
	Run dispose on child monitors when disposing.

        * gunixvolumemonitor.c:
	Remove all volumes and mount on dispose to avoid circular
	dependencies not freeing the monitor



svn path=/trunk/; revision=7957
2009-03-04 10:45:10 +00:00
Alexander Larsson
896c3d1b2c Bug 561172 – gnome-open fails on local URIs with anchors
2009-03-03  Alexander Larsson  <alexl@redhat.com>

	Bug 561172 – gnome-open fails on local URIs with anchors

        * gdesktopappinfo.c:
	Don't force uris to filenames if the uri has an anchor, because
	that would strip the anchor.

        * glocalvfs.c:
	Strip anchor from file:// uris when creating GFile, since
	g_filename_from_uri doesn't handle them.



svn path=/trunk/; revision=7953
2009-03-03 19:02:16 +00:00
Alexander Larsson
f891d4e04e Bug 562613 – Missing const modifier in string parameters
2009-03-03  Alexander Larsson  <alexl@redhat.com>

	Bug 562613 – Missing const modifier in string parameters

        * gfileinputstream.[ch]:
        * gfileoutputstream.[ch]:
        * glocalfileinfo.[ch]:
	Make string arguments const if used as such.



svn path=/trunk/; revision=7952
2009-03-03 15:50:13 +00:00
Alexander Larsson
0b9f24c1e1 Handle filesystems no supporting reporting how much is free. This fixes
2009-03-03  Alexander Larsson  <alexl@redhat.com>

	* glocalfile.c (g_local_file_query_filesystem_info):
	Handle filesystems no supporting reporting how much is free.
	This fixes bug 573454 where the filesystem not supporting this
	is the gvfs smb backend over the fuse filesystem.



svn path=/trunk/; revision=7951
2009-03-03 14:40:44 +00:00
Matthias Clasen
a902f5257c 2.19.10
svn path=/trunk/; revision=7942
2009-03-02 06:36:08 +00:00
Matthias Clasen
3f07ef2119 2.19.9
svn path=/trunk/; revision=7939
2009-03-02 05:49:44 +00:00
Matthias Clasen
fea99b4b1a Add a Since: tag
svn path=/trunk/; revision=7937
2009-03-02 05:07:21 +00:00
Matthias Clasen
0712b73358 Use a separate lock for extension point registration to avoid deadlock.
* giomodule.c: Use a separate lock for extension point registration
        to avoid deadlock. Discovered by Torsten Schoenfeld


svn path=/trunk/; revision=7935
2009-03-02 03:50:09 +00:00
Matthias Clasen
74882fb655 Fix docs
svn path=/trunk/; revision=7934
2009-03-01 17:12:58 +00:00
Matthias Clasen
474db07f6a Clarify docs
svn path=/trunk/; revision=7923
2009-02-27 21:02:19 +00:00
David Zeuthen
120300e659 Fix up bug reference in previous commit
svn path=/trunk/; revision=7921
2009-02-27 18:21:14 +00:00
David Zeuthen
e38e6aafe0 Bug 540461 – GEmblemedIcon leak
2009-02-27  David Zeuthen  <davidz@redhat.com>

        Bug 540461 – GEmblemedIcon leak

        * gemblemedicon.c (g_emblemed_icon_finalize):
        Avoid leaking a GList.


svn path=/trunk/; revision=7920
2009-02-27 18:19:05 +00:00
Alexander Larsson
b3cb7caf7d Split out the extension point registration code to its own function.
2009-02-27  Alexander Larsson  <alexl@redhat.com>

        * giomodule-priv.h:
        * giomodule.c:
	Split out the extension point registration code to its
	own function.

        * glocalvfs.c:
	Ensure extension points are registered before extending it.
	It might not have happened yet if g_vfs_get_local() is called.



svn path=/trunk/; revision=7919
2009-02-27 15:22:11 +00:00
Alexander Larsson
b89e432e8d Bug 540461 – g_memory_output_stream_get_data_size() doesn't behave as
2009-02-26  Alexander Larsson  <alexl@redhat.com>

	Bug 540461 – g_memory_output_stream_get_data_size() doesn't behave as document
        * gmemoryoutputstream.c:
	Track actual valid size, even if we later seek back.

        * tests/memory-output-stream.c:
	Add testcase



svn path=/trunk/; revision=7916
2009-02-26 15:41:29 +00:00
Alexander Larsson
1ab68f9ee9 Bug 543183 – Clarify docs for g_file_has_prefix
2009-02-26  Alexander Larsson  <alexl@redhat.com>

	Bug 543183 – Clarify docs for g_file_has_prefix

	* gfile.c: (g_file_has_prefix):
	Clarify how the prefix matching works.


svn path=/trunk/; revision=7915
2009-02-26 15:03:11 +00:00
Alexander Larsson
fa558d00c3 Support desktop file key X-GIO-NoFuse which disables use of fuse pathnames
2009-02-26  Alexander Larsson  <alexl@redhat.com>

	* gdesktopappinfo.c:
	Support desktop file key X-GIO-NoFuse which disables
	use of fuse pathnames for %u and %U arguments.



svn path=/trunk/; revision=7914
2009-02-26 14:59:16 +00:00
Alexander Larsson
8c6e7c103f Bug 570073 – Add support for reading filesystems on Interix
2009-02-25  Alexander Larsson  <alexl@redhat.com>

	Bug 570073 – Add support for reading filesystems on Interix

	* gunixmounts.c (_g_get_unix_mounts):
	Support Interix. Patch from  Fabian Groffen 


svn path=/trunk/; revision=7911
2009-02-25 16:37:35 +00:00
Paolo Borelli
ddfe508c04 Bug 570069 – wrong preprocessor directive in gio/glocalfileinfo.c
2009-02-25  Paolo Borelli  <pborelli@katamail.com>

	Bug 570069 – wrong preprocessor directive in gio/glocalfileinfo.c

	* glocalfileinfo.c: fix preprocessor condition. Patch by Markus Duft.

svn path=/trunk/; revision=7910
2009-02-25 13:30:49 +00:00
Alexander Larsson
319d60e444 Remove accidentally commited spew
2009-02-23  Alexander Larsson  <alexl@redhat.com>

	* glocalfile.c:
	Remove accidentally commited spew



svn path=/trunk/; revision=7903
2009-02-23 15:12:39 +00:00
Matthias Clasen
f548330275 Fix "it's" vs "its" confusion throughout the source. Patch by Will
* Fix "it's" vs "its" confusion throughout the source. Patch
        by Will Thompson.


svn path=/trunk/; revision=7897
2009-02-23 04:30:06 +00:00
Alexander Larsson
9fdf70ba5f Don't ever sniff desktop files when the filename is known. In other words,
2009-02-20  Alexander Larsson  <alexl@redhat.com>

        * gcontenttype.c:
        (g_content_type_guess):
	Don't ever sniff desktop files when the filename is known.
	In other words, only allow desktop files with the .desktop extension
	and when the filename isn't known.
	This is a security precaution since desktop files can execute
	arbitrary code when launched and we don't want to allow them to
	try and hide as another type. There is no legit reason to not
	have the .desktop extension anyway.



svn path=/trunk/; revision=7892
2009-02-20 07:46:57 +00:00
Ryan Lortie
1ee6cc4882 update gitignore
svn path=/trunk/; revision=7887
2009-02-19 17:26:29 +00:00
Ryan Lortie
4dcba4adf7 8 spaces -> tab in ChangeLog
svn path=/trunk/; revision=7886
2009-02-19 17:25:54 +00:00
Alexander Larsson
0ee2b46405 Bug 549298 – impossible to copy files with p (pipe) flag
2009-02-19  Alexander Larsson  <alexl@redhat.com>

        Bug 549298 – impossible to copy files with p (pipe) flag

        * gfile.c:
        (file_copy_fallback):
	Error out if the source file is a special file


svn path=/trunk/; revision=7885
2009-02-19 15:26:32 +00:00
Alexander Larsson
0fd66d7e22 Bug 560564 – Replacing a symlink with its linked file truncates the
2009-02-18  Alexander Larsson  <alexl@redhat.com>

	Bug 560564 – Replacing a symlink with its linked file truncates the original file

        * gioenums.h:
	Add G_FILE_CREATE_REPLACE_DESTINATION

        * glocalfileoutputstream.c:
        (handle_overwrite_open):
        (_g_local_file_output_stream_replace):
	Handle G_FILE_CREATE_REPLACE_DESTINATION when overwriting files.

        * gfile.c:
        (file_copy_fallback):
	Pass G_FILE_CREATE_REPLACE_DESTINATION to g_file_replace when copying
	with overwrite.


svn path=/trunk/; revision=7880
2009-02-18 14:49:25 +00:00
Ryan Lortie
3fd881b5bb unref the destination's attribute matcher before overwriting it.
2009-02-17  Ryan Lortie  <desrt@desrt.ca>

        * gfileinfo.c: unref the destination's attribute matcher before
        overwriting it.


svn path=/trunk/; revision=7879
2009-02-17 23:36:13 +00:00
Matthias Clasen
4611dadadd 2.19.8
svn path=/trunk/; revision=7876
2009-02-17 18:36:36 +00:00
Ryan Lortie
5f15c71a14 fix changelog date
svn path=/trunk/; revision=7873
2009-02-17 10:13:52 +00:00
Matthias Clasen
e05426062b Add missing exports
svn path=/trunk/; revision=7872
2009-02-17 06:32:44 +00:00
Matthias Clasen
7b106d2066 2.19.7
svn path=/trunk/; revision=7868
2009-02-17 02:49:52 +00:00
Matthias Clasen
49cb04caf0 Add an "aborted" signal to abort a mount operation from the backend side.
* gmountoperation.[hc]: Add an "aborted" signal to abort a
        mount operation from the backend side.

        * gvolume.h: Add docs regarding the "aborted" signal.


svn path=/trunk/; revision=7866
2009-02-17 00:02:06 +00:00
Ryan Lortie
e8c635841a Bug 505042 – add file attribute for actually used file size in bytes
2009-02-13  Ryan Lortie  <desrt@desrt.ca>

	Bug 505042 – add file attribute for actually used file size in bytes

	* gfileinfo.h: add G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE define to
	"standard::allocated-size"
	* gfileattribute.c: document
	* glocalfileinfo.c: set the allocated size from st_blocks * 512


svn path=/trunk/; revision=7865
2009-02-16 14:22:43 +00:00
Ryan Lortie
2bd1d5d737 Bug 571598 – GAsyncResult with NULL gobject
2009-02-16  Ryan Lortie  <desrt@desrt.ca>

        Bug 571598 – GAsyncResult with NULL gobject

        * gsimpleasyncresult.c: remove various assertions and add some checks
        to allow for a NULL source_object in GSimpleAsyncResult.


svn path=/trunk/; revision=7864
2009-02-16 09:33:39 +00:00
Matthias Clasen
bbf0530f24 Cope with EEXIST == ENOTEMPTY. Reported by Nicolas Joseph
* gioerror.c (g_io_error_from_errno): Cope with EEXIST == ENOTEMPTY.
        Reported by Nicolas Joseph


svn path=/trunk/; revision=7859
2009-02-12 01:52:17 +00:00
Murray Cumming
a431c976af Correct the grammar in some property documentation.
2009-02-06  Murray Cumming  <murrayc@murrayc.com>

* gio/gfilterinputstream.c:
* gio/gfilteroutputstream.c: Correct the grammar in some property 
documentation.
* gio/gdatainputstream.c:
* glib/gregex.c: Correct the spelling of 
occurrence in documentation.

svn path=/trunk/; revision=7856
2009-02-06 14:08:19 +00:00
Alexander Larsson
cefebf7ff2 Bug 566747 - URIs opened with firefox %u load as local files
2009-02-04  Alexander Larsson  <alexl@redhat.com>

	Bug 566747 - URIs opened with firefox %u load as local files

	* gdummyfile.c (g_dummy_file_get_path):
	Dummy files are never used for local paths, so always return NULL
	in get_path(). 


svn path=/trunk/; revision=7849
2009-02-04 08:01:42 +00:00
Matthias Clasen
afa157a73d 2.19.6
svn path=/trunk/; revision=7845
2009-02-02 20:09:08 +00:00
Paolo Borelli
49719cca38 plug a tiny mem leak.
2009-01-31  Paolo Borelli  <pborelli@katamail.com>

	* glocalfileinfo.c: plug a tiny mem leak.


svn path=/trunk/; revision=7841
2009-01-31 20:06:02 +00:00
Ryan Lortie
83e88655c0 handle all possible cases of EAGAIN and EWOULDBLOCK being (un)defined and
2009-01-29  Ryan Lortie  <desrt@desrt.ca>

        * gioerror.c (g_io_error_from_errno): handle all possible cases of
        EAGAIN and EWOULDBLOCK being (un)defined and (un)equal.


svn path=/trunk/; revision=7836
2009-01-29 15:55:11 +00:00
Ryan Lortie
129e86cf2c Bug 568575 – _async functions for GDataInputStream
2009-01-28  Ryan Lortie  <desrt@desrt.ca>

        Bug 568575 – _async functions for GDataInputStream

        * gdatainputstream.h:
        * gdatainputstream.c: add _async versions of read_line and read_until.
        * gio.symbols:
        * ../docs/reference/gio/gio-sections.txt: add new functions
        * tests/sleepy-stream.c: new test case for async read line
        * tests/Makefile.am: add new test


svn path=/trunk/; revision=7835
2009-01-28 16:39:39 +00:00
Ryan Lortie
fc10cb46ad Bug 568723 – g_buffered_input_stream_fill_async doesn't take count == -1
2009-01-22  Ryan Lortie  <desrt@desrt.ca>

        Bug 568723 – g_buffered_input_stream_fill_async doesn't take count == -1

        * gbufferedinputstream.c (g_buffered_input_stream_fill_async,
        g_buffered_input_stream_fill): check for count < -1 instead of count <
        0 and copy modified check to non-async version for consistency.
        document the "count = -1" API.


svn path=/trunk/; revision=7828
2009-01-22 19:18:26 +00:00
Ryan Lortie
fb50c2ae1a Bug 568741 – g_buffered_input_stream_fill_async doesn't work
2009-01-22  Ryan Lortie  <desrt@desrt.ca>

        Bug 568741 – g_buffered_input_stream_fill_async doesn't work

        * gbufferedinputstream.c (fill_async_callback): grow the buffer tail
        after we have successfully read data from the base stream


svn path=/trunk/; revision=7827
2009-01-22 19:00:05 +00:00
Ryan Lortie
a9c978a354 Bug 568394 – dropping the last reference to a stream filter closes the
2009-01-20  Ryan Lortie  <desrt@desrt.ca>

        Bug 568394 – dropping the last reference to a stream filter closes the
        base stream

        * gfilterinputstream.h:
        * gfilterinputstream.c: add "close-base-stream" property and only
        close the base stream if it is true.  issue async close callbacks from
        correct source object.
        * gfilteroutputstream.h:
        * gfilteroutputstream.c: add a "close-base-stream" property and only
        close the base stream if it is true.  issue async close callbacks from
        correct source object.
        * gbufferedoutputstream: check g_filter_output_stream_get_close_base()
        before closing the base stream.  fix invalid source tag comparison in
        close_async (was comparing to flush_async).
        * ../docs/reference/gio/gio-sections.txt:
        * gio.symbols: add
        g_filter_{in,out}put_stream_{g,s}et_close_base_stream
        * tests/filter-streams.c: new test cases
        * tests/Makefile.am: add new test
        * tests/.gitignore: add new test


svn path=/trunk/; revision=7825
2009-01-21 14:09:56 +00:00
Matthias Clasen
ce9729b2fb Expand docs
svn path=/trunk/; revision=7822
2009-01-19 22:58:38 +00:00
Matthias Clasen
af6a048743 2.19.5
svn path=/trunk/; revision=7820
2009-01-19 07:46:43 +00:00
Matthias Clasen
4a6a9dae2c Doc addition
svn path=/trunk/; revision=7819
2009-01-19 07:05:07 +00:00
Matthias Clasen
b77a6eeac9 Some cleanups
svn path=/trunk/; revision=7817
2009-01-19 06:09:11 +00:00
Matthias Clasen
f8cfff0686 Don't assume filenames are UTF-8.
* xdgmime/xdgmimecache.c:
        * xdgmime/xdgmimeglob.c: Don't assume filenames are UTF-8.

svn path=/trunk/; revision=7784
2009-01-09 05:19:17 +00:00
Matthias Clasen
a6b965efa1 Make tests work with current shared-mime-info
svn path=/trunk/; revision=7783
2009-01-09 04:53:14 +00:00
Matthias Clasen
2479abee27 Add a G_IO_ERROR_TOO_MANY_OPEN_FILES error code. Requested by Olivier
* gioenums.h: Add a G_IO_ERROR_TOO_MANY_OPEN_FILES error code.
        Requested by Olivier Sessink.

        * gioerror.c: Translate EMFILE to G_IO_ERROR_TOO_MANY_OPEN_FILES.

        * glocalfileenumerator.c: Translate G_FILE_ERROR_MFILE to
        G_IO_ERROR_TOO_MANY_OPEN_FILES.


svn path=/trunk/; revision=7782
2009-01-08 01:32:15 +00:00
Matthias Clasen
85fa6de695 2.19.4
svn path=/trunk/; revision=7777
2009-01-05 18:06:05 +00:00
Dan Winship
7943f976d4 cast a "char **" to "const char **" to avoid a warning.
* gdesktopappinfo.c (update_mimeapps_list): cast a "char **" to
	"const char **" to avoid a warning.

	* gemblem.c (g_emblem_from_tokens):
	* gemblemedicon.c (g_emblemed_icon_from_tokens):
	* xdgmime/xdgmime.c (xdg_mime_get_icon): remove unused
	variables

svn path=/trunk/; revision=7775
2009-01-05 16:57:55 +00:00
Matthias Clasen
a836486e24 Try using O_NOATIME when sniffing for mime types. Based on a patch by A.
* glocalfileinfo.c (get_content_type): Try using O_NOATIME when
        sniffing for mime types. Based on a patch by A. Walton


svn path=/trunk/; revision=7773
2009-01-05 16:20:40 +00:00
Ryan Lortie
481559a031 improve add new simple-async-result test new file to test
2009-01-05  Ryan Lortie  <desrt@desrt.ca>

        * tests/.gitignore: improve
        * tests/Makefile.am: add new simple-async-result test
        * tests/simple-async-result.c: new file to test GSimpleAsyncResult


svn path=/trunk/; revision=7767
2009-01-05 06:58:22 +00:00
Ryan Lortie
876f03f807 Add g_simple_async_result_is_valid(). Implementation by Dan Winship.
2009-01-05  Ryan Lortie  <desrt@desrt.ca>

        * gio.symbols:
        * ../docs/reference/gio/gio-sections.txt:
        * gsimpleasyncresult.h:
        * gsimpleasyncresult.c: Add g_simple_async_result_is_valid().
        Implementation by Dan Winship.  Closes #566170.


svn path=/trunk/; revision=7766
2009-01-05 06:57:16 +00:00
Matthias Clasen
782fe440ef Add notes about being UNIX-specific
svn path=/trunk/; revision=7756
2008-12-31 07:47:19 +00:00
Ryan Lortie
caa5ed0d22 move some changelog entries that i put in the wrong spot
svn path=/trunk/; revision=7754
2008-12-20 19:41:07 +00:00
Matthias Clasen
649c25f216 2.19.3
svn path=/trunk/; revision=7746
2008-12-15 20:01:49 +00:00
Matthias Clasen
be914f6841 Make these work on x86_64
svn path=/trunk/; revision=7744
2008-12-13 23:56:05 +00:00
Ryan Lortie
b941139254 free the tokens when done with them
2008-12-12  Ryan Lortie  <desrt@desrt.ca>

        * gio/gicon.c (g_icon_to_string_tokenized): free the tokens when done
        with them


svn path=/trunk/; revision=7743
2008-12-12 20:59:54 +00:00
Ryan Lortie
a28d87bfc9 fix leak that occurs when multiple mount entries match the requested path
2008-12-12  Ryan Lortie  <desrt@desrt.ca>

        * gio/gunixmounts.c (g_unix_mount_at): fix leak that occurs when
        multiple mount entries match the requested path


svn path=/trunk/; revision=7742
2008-12-12 20:03:36 +00:00
Alexander Larsson
3b4ad625b9 Bug 562452 - Ensure we return G_IO_ERROR_CANCELLED if cancelling
2008-12-10  Alexander Larsson  <alexl@redhat.com>

	Bug 562452 - Ensure we return G_IO_ERROR_CANCELLED if cancelling
	g_simple_async_result_run_in_thread
	
        * gsimpleasyncresult.c:
	Make g_simple_async_result_run_in_thread check cancellation before
	calling out to the user in the callback. This means we guarantee
	reporting cancels of async operations from the main threads, which
	is probably more in line with what users expect.
	
	Note that there are still no such guarantees for cancelling sync
	operations or cancelling async operation from outside the main
	thread. Furthermore, the exact behaviour of async implementations
	not using run_in_thread may differ.



svn path=/trunk/; revision=7740
2008-12-10 13:25:59 +00:00
Alexander Larsson
39b3b41484 Bug 515777 - incorrect date&time on copy
2008-12-09  Alexander Larsson  <alexl@redhat.com>

	Bug 515777 - incorrect date&time on copy
	
        * glocalfile.c:
        (g_local_file_class_init):
	Copy mtime by default
	
        * gfile.c:
	Change docs about G_FILE_COPY_ALL_METADATA to not mention
	mtime as an example.



svn path=/trunk/; revision=7738
2008-12-09 11:15:36 +00:00
Matthias Clasen
c7d37fca34 Hide ecryptfs mounts, so that the desktop does not show both the mount and
* gunixmounts.c: (guess_system_internal): Hide ecryptfs mounts,
        so that the desktop does not show both the mount and the target
        directory. Patch by Martin Pitt


svn path=/trunk/; revision=7736
2008-12-08 05:47:26 +00:00
Matthias Clasen
b047087ac3 Add "fd" and "close-fd" properties including getters and setters. Patch by
* gio.symbols:
        * gunixinputstream.[hc]:
        * gunixoutputstream.[hc]: Add "fd" and "close-fd" properties
        including getters and setters. Patch by Maciej Piechotka


svn path=/trunk/; revision=7735
2008-12-08 05:41:43 +00:00
Matthias Clasen
b2f0d44acb Support compilers that don't understand ISO C varargs macros. Patch by
* tests/live-g-file.c: Support compilers that don't understand
        ISO C varargs macros. Patch by Eric Lamarque



svn path=/trunk/; revision=7734
2008-12-08 04:38:54 +00:00
Matthias Clasen
08b1ec389b Use g_access() to check accessibility of local devices. Patch by Martin
* gunixmounts.c: Use g_access() to check accessibility of local devices.
        Patch by Martin Pitt


svn path=/trunk/; revision=7733
2008-12-08 04:33:41 +00:00
Matthias Clasen
cce2159983 2.19.2
svn path=/trunk/; revision=7721
2008-12-01 20:01:16 +00:00
Matthias Clasen
e959473234 Revert behaviour change in g_data_input_stream_read_line
svn path=/trunk/; revision=7720
2008-12-01 19:02:58 +00:00
Matthias Clasen
ec48fa8fc2 2.19.1
svn path=/trunk/; revision=7717
2008-12-01 14:44:26 +00:00
Alexander Larsson
a95b7a3fab Add and document g_mount_is_shadowed plus calls to set/unset a mount as
2008-12-01  Alexander Larsson  <alexl@redhat.com>

        * gio.symbols:
        * gmount.[ch]:
        * gunionvolumemonitor.c:
        * gvolume.c:
	Add and document g_mount_is_shadowed plus calls
	to set/unset a mount as shadowed
	


svn path=/trunk/; revision=7716
2008-12-01 13:46:11 +00:00
Matthias Clasen
8b39fa1e6a Comment out two failing tests
svn path=/trunk/; revision=7714
2008-12-01 06:47:04 +00:00
Matthias Clasen
a44f5f6aaa Add g_app_info_get_commandline. Requested by Hans Petter Jansson.
* gio.symbols:
        * gappinfo.[hc]: Add g_app_info_get_commandline. Requested
        by Hans Petter Jansson.

        * gdesktopappinfo.c: And implement it here.


svn path=/trunk/; revision=7706
2008-11-28 23:16:45 +00:00
Christian Dywan
b5321fe34c Fix a typo, s/detext/detect. Patch by Enrico Tröger.
2008-11-28  Christian Dywan  <christian@imendio.com>

	* gappinfo.c: Fix a typo, s/detext/detect. Patch by Enrico Tröger.

svn path=/trunk/; revision=7700
2008-11-28 09:43:10 +00:00
Matthias Clasen
5e6aea1b2f Bug 559633 – gtk_image_new_from_gicon does not always work for .desktop
2008-11-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 559633 – gtk_image_new_from_gicon does not always work for
        .desktop files

        * gdesktopappinfo.c (g_desktop_app_info_new_from_keyfile): Ignore
        extensions on icon names.  Proposed by Axel von Bertoldi.


svn path=/trunk/; revision=7698
2008-11-28 08:28:39 +00:00
Matthias Clasen
d4d876846e Bug 548163 – Nautilus displays wrong error message for too long file
names

        * glocalfile.c (g_local_file_set_display_name): Correctly set
        error conditions if the new name is e.g. too long. Reported
        by Leonardo Ferreira Fontenelle.


svn path=/trunk/; revision=7696
2008-11-28 08:05:49 +00:00
Matthias Clasen
e449a91b98 Bug 547481 – g_data_input_stream_read_line behaves not as stated in the
2008-11-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 547481 – g_data_input_stream_read_line behaves not as stated in
        the docs

        * gdatainputstream.c (g_data_input_stream_read_line): Behave as
        documented and include the line end in the returned string.
        Pointed out by Paul Pogonyshev.

        * tests/data-input-stream.c: Fix the read_line test to test the
        documented behaviour.



svn path=/trunk/; revision=7694
2008-11-28 07:42:48 +00:00
Matthias Clasen
688b2e0ed2 Only allow deleting files that have been created by
* gdesktopappinfo.c (g_app_info_can_delete): Only allow deleting
        files that have been created by g_app_info_create_from_commandline.


svn path=/trunk/; revision=7693
2008-11-28 07:27:13 +00:00
Matthias Clasen
77a8c5cc15 Better fix
svn path=/trunk/; revision=7691
2008-11-28 07:04:43 +00:00
Matthias Clasen
c5938128ec Avoid unused variables
svn path=/trunk/; revision=7690
2008-11-28 07:02:57 +00:00
Matthias Clasen
0b715510de Bug 562393 – g_buffered_input_stream_read_byte broken if data available
2008-11-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 562393 – g_buffered_input_stream_read_byte broken if data
        available

        * gio/gbufferedinputstream.c (g_buffered_input_stream_read_byte): Fix
        handling of buffered content.  Patch by Philip Withnall

        * gio/tests/buffered-input-stream.c: Add a testcase for this bug.
        * gio/tests/Makefile.am: And build it



svn path=/trunk/; revision=7686
2008-11-28 05:57:07 +00:00
Matthias Clasen
6a0f0c2bfb Bug 561807 – inotify_sub.c :: dup_dirname() fails to remove trailing '/'
2008-11-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 561807 – inotify_sub.c :: dup_dirname() fails to remove trailing
        '/'

        * inotify/inotify-sub.c (dup_dirname): Actually strip the trailing
        '/' away. Spotted by Dan Williams.

`

svn path=/trunk/; revision=7682
2008-11-28 05:09:21 +00:00
Christophe Fergeau
ff4a7678e6 Bug 561212 – GFileReadMoreCallback API doc refers to non-existant function
* gio/giotypes.h: fix name of function referred to in
GFileReadMoreCallback API documentation

svn path=/trunk/; revision=7666
2008-11-21 10:30:43 +00:00
Cosimo Cecchi
d20bf1076b Bug 561375 – Leaks mountpoint description
2008-11-21  Cosimo Cecchi  <cosimoc@gnome.org>

	Bug 561375 – Leaks mountpoint description

	* glocalfile.c: (get_mount_info): don't leak the mountpoint description
	string.

svn path=/trunk/; revision=7662
2008-11-21 00:01:22 +00:00
Cosimo Cecchi
8dc9c875ff Bug 561352 – Leak of icon description
2008-11-21  Cosimo Cecchi  <cosimoc@gnome.org>

	Bug 561352 – Leak of icon description

	* gcontenttype.c: (g_content_type_get_icon): don't leak the XDG mimetype
	generic icon string.

svn path=/trunk/; revision=7660
2008-11-20 23:58:39 +00:00
Matthias Clasen
ce008aebe6 Add G_FILE_ATTRIBUTE_PREVIEW_ICON to doc table
svn path=/trunk/; revision=7654
2008-11-15 00:03:25 +00:00
Tor Lillqvist
2f575b95ac Bug 556415 - Crash on Windows 2000 in g_winhttp_vfs_init()
2008-11-12  Tor Lillqvist  <tml@novell.com>

	Bug 556415 - Crash on Windows 2000 in g_winhttp_vfs_init()

	* win32/gwinhttpvfs.h: Move the set of function pointers to
	winhttp.dll into a separate struct GWinHttpDllFuncs. Just have a
	pointer to that in the GWinHttpVfsClass.
	
	* win32/gwinhttpvfs.c: Move the lookup of functions from
	winhttp.dll into a function of its own, that stores the pointers
	in a separate GWinHttpDllFuncs variable. Add two bookeeping
	booleans lookup_done and funcs_found.

	Don't call g_io_extension_point_implement() to register the
	winhttp extension unless winhttp.dll has been successfully loaded
	and the required functions found in it.

	* win32/gwinhttp*.c: Adjust calls of the functions looked up from
	winhttp.dll correspondingly.


svn path=/trunk/; revision=7648
2008-11-12 17:52:39 +00:00
Grahame Bowland
df719f749c Bug 558185 – 'parent' variable in
2008-10-31  Grahame Bowland  <grahame@angrygoats.net>

	Bug 558185 – 'parent' variable in g_local_file_get_child_for_display_name() 
	hits g_object_unref(NULL) assertion

	* gio/glocalfile.c: 
	- remove unused variable. Patch by Matt Johnston <matt@ucc.asn.au>

svn path=/trunk/; revision=7636
2008-10-31 02:23:55 +00:00
Cosimo Cecchi
e8bb63a7db reviewed by: Alexander Larsson <alexl@redhat.com>
2008-10-28  Cosimo Cecchi  <cosimoc@gnome.org>

	reviewed by: Alexander Larsson <alexl@redhat.com>

	* gdatainputstream.c: Make the docs of g_dada_input_stream_read_line ()
	clearer about the behavior when there's no more content to read.

svn path=/trunk/; revision=7632
2008-10-28 14:51:56 +00:00
Federico Mena Quintero
7b46b2a43b Fix leak inside g_local_file_get_parse_name()
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=7629
2008-10-27 20:42:32 +00:00
Tor Lillqvist
6b2d7a5344 Bug 557592 - Missing include in gwinhttpfile.c
2008-10-27  Tor Lillqvist  <tml@novell.com>

	Bug 557592 - Missing include in gwinhttpfile.c

	* win32/gwinhttpfile.c: Include <wchar.h> to make it compile with
	MSVC2008.


svn path=/trunk/; revision=7628
2008-10-27 08:30:08 +00:00
Matthias Clasen
b616e892ca Bug 556910 – [fam-helper.c:223]: Memory leak: sub
2008-10-24  Matthias Clasen  <mclasen@redhat.com>

        Bug 556910 – [fam-helper.c:223]: Memory leak: sub

        * fam/fam-helper.c: Fix a memory leak and formatting issues.
        Reported by Daniel Marjamäki


svn path=/trunk/; revision=7624
2008-10-24 04:04:42 +00:00
Matthias Clasen
da2ee0c57f Fix docs
svn path=/trunk/; revision=7622
2008-10-24 03:52:02 +00:00
Alexander Larsson
8286387779 Bug 528320 - Incorrect icons displayed for files with custom mimetype
2008-10-23  Alexander Larsson  <alexl@redhat.com>

	Bug 528320 - Incorrect icons displayed for files with custom mimetype icons
	
        * glocalfileinfo.c:
        (_g_local_file_info_get):
	Don't return the fallback icon (text-x-generic) for all files.
	This is causing problems with theme icon lookup and custom mime
	icons, as the generic fallback overrides custom mime icons in
	inherited themes.

	This is a slight change as applications might not get an icon wher
	they previously did. But there is no guarantee to get on neither before
	or after this change, so it should not break applications. Changes
	to nautilus and gtk+ will be done to manually use the generic fallback
	icon if no icon is found, but this is only required for rare cases.


svn path=/trunk/; revision=7620
2008-10-23 09:10:01 +00:00
Alexander Larsson
17c1241103 Add G_FILE_ATTRIBUTE_PREVIEW_ICON (#557182)
2008-10-21  Alexander Larsson  <alexl@redhat.com>

        * gfileinfo.h:
	Add G_FILE_ATTRIBUTE_PREVIEW_ICON (#557182)


svn path=/trunk/; revision=7619
2008-10-21 13:02:05 +00:00
Alexander Larsson
4f0b18d203 Bug 555740 - gicon serialization Based on patch from David Zeuthen
2008-10-21  Alexander Larsson  <alexl@redhat.com>

	Bug 555740 - gicon serialization
	Based on patch from David Zeuthen
	
        * gicon.[ch]:
        * gio.symbols:
	Add g_icon_to_string() and g_icon_new_for_string().
	
        * gemblem.c:
        * gemblemedicon.c:
        * gfileicon.c:
        * gthemedicon.c:
	Implement icon serialization for built-in icon types
	
        * tests/Makefile.am:
        * tests/g-icon.c:
	Added GIcon serialization test



svn path=/trunk/; revision=7618
2008-10-21 11:51:48 +00:00
Christian Persch
cef6abff8e Bug 557087 – mem leak in g_content_types_get_registered
svn path=/trunk/; revision=7616
2008-10-20 16:49:16 +00:00
Matthias Clasen
82c68c6a14 2.19.0
svn path=/trunk/; revision=7611
2008-10-16 23:59:50 +00:00
Matthias Clasen
61aa1f7db0 Bug 556422 – g_file_enumerator_next_file: unclear whether return value
2008-10-16  Matthias Clasen  <mclasen@redhat.com>

        Bug 556422 – g_file_enumerator_next_file: unclear whether return
        value needs to be freed

        * gfileenumerator.c (g_file_enumerate_next_file): Clarify
        the return value docs. Pointed out by Armin Burgmeier

svn path=/trunk/; revision=7603
2008-10-16 04:19:53 +00:00
Matthias Clasen
154bbc462a Bug 556334 – Warning when building without selinux support
2008-10-14  Matthias Clasen  <mclasen@redhat.com>

        Bug 556334 – Warning when building without selinux support

        * glocalfileinfo.c: Avoid compiler warnings when selinux is
        disabled. Patch by Pascal Terjan


svn path=/trunk/; revision=7601
2008-10-15 03:37:56 +00:00
Matthias Clasen
8caab42314 Fix make check
svn path=/trunk/; revision=7600
2008-10-15 01:32:01 +00:00
Christian Persch
630f89fb1a Bug 555311 – format not a string literal and no format arguments
svn path=/trunk/; revision=7597
2008-10-13 12:43:37 +00:00
Alexander Larsson
6eb38fb4db When adding an application as handling a mime type (but not as the
2008-10-13  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
	When adding an application as handling a mime type (but
	not as the default), copy the full list of desktop ids handling
	that type in before adding the new one on the end of the list.
	This means we're not accidentally changing the default by overriding
	the info from the later directories in the search path.
	
	Also, fixes small leak of removed_entries.



svn path=/trunk/; revision=7595
2008-10-13 10:02:30 +00:00
David Zeuthen
5a10b403c7 Deprecate g_volume_monitor_adopt_orphan_mount() (#555331).
2008-10-12  David Zeuthen  <davidz@redhat.com>

        * gio.symbols:
        * gunionvolumemonitor.c:
        * gvolumemonitor.h:
        Deprecate g_volume_monitor_adopt_orphan_mount() (#555331).


svn path=/trunk/; revision=7594
2008-10-12 17:05:17 +00:00
Alexander Larsson
84eabd3d59 Upper half of byte is >> 4, not >> 8. Found by Kjartan Maraas via sparse
2008-10-10  Alexander Larsson  <alexl@redhat.com>

	* gfileattribute.c (escape_byte_string):
	Upper half of byte is >> 4, not >> 8.
	Found by Kjartan Maraas via sparse


svn path=/trunk/; revision=7590
2008-10-10 11:35:39 +00:00
Matthias Clasen
a8c88cae76 Bug 555711 – Wrong fallback order of mimetype icons
* gcontenttype.c: Don't prefer generic icons over
        default mimetype icons.

        * xdgmime/xdgmimecache.c (xdg_mime_cache_get_icon):
        * xdgmime/xdgmime.c (xdg_mime_get_icon): Don't fall back
        to generic icons.
        Patch by Krysztof Kosiński


svn path=/trunk/; revision=7587
2008-10-10 05:07:56 +00:00
Matthias Clasen
b8f103901f Bug 555121 – Improved build-time handling of gio module-dir
2008-10-10  Matthias Clasen  <mclasen@redhat.com>

        Bug 555121 – Improved build-time handling of gio module-dir

        * fam/Makefile.am: Use GIO_MODULE_DIR consistently.
        * Makefile.am: Create the module dir.


svn path=/trunk/; revision=7586
2008-10-10 05:00:17 +00:00
Matthias Clasen
6310f898b8 Fix gcc warnings
svn path=/trunk/; revision=7585
2008-10-10 04:54:51 +00:00
Alexander Larsson
585135279f Actually return -1 in case of cancelled, not old res value.
2008-10-09  Alexander Larsson  <alexl@redhat.com>

	* gunixinputstream.c (g_unix_input_stream_read):
	Actually return -1 in case of cancelled, not old res value.



svn path=/trunk/; revision=7583
2008-10-09 10:03:12 +00:00
Christian Persch
5d31f41df4 Bug 555313 – GFileAttribute boxed type get_type function should use
usual get_type pattern

svn path=/trunk/; revision=7580
2008-10-08 20:54:39 +00:00
Colin Walters
b383c8f08f Bug 554745 - GFileAttributeInfoList should be boxed
2008-10-06  Colin Walters  <walters@verbum.org>

	Bug 554745 - GFileAttributeInfoList should be boxed

	* gio/gfileattribute.c: Define a boxed type for GFileAttributeList
	for convenience of bindings.
	* gio/gfileattribute.h: Prototype it.


svn path=/trunk/; revision=7573
2008-10-06 21:59:29 +00:00
Pascal Terjan
d8b489853c Bug 554970 – segfault when update-desktop-database is not available
2008-10-05  Pascal Terjan  <pterjan@linuxfr.org>

	Bug 554970 – segfault when update-desktop-database is not available
	on the system

	* gdesktopappinfo.c (run_update_command): Have the error set before 
	using it.


svn path=/trunk/; revision=7570
2008-10-05 00:33:43 +00:00
David Zeuthen
04f0742818 If possible, always pass FUSE file:// URIs (such as
2008-10-01  David Zeuthen  <davidz@redhat.com>

	* gdesktopappinfo.c (expand_macro): If possible, always pass FUSE
	file:// URIs (such as '/home/davidz/.gvfs/sftp on foo/file.avi')
	instead of the gio URI (such as sftp://foo/file.avi) when using
	g_app_info_launch() and friends. With a sufficiently recent gvfs,
	apps using gio+gvfs will map the FUSE file:// URI back to the gio
	URI (and thus bypass the fuse daemon) thanks the patch from bug
	#530654.  Since Nautilus is an user of g_app_info_launch() it
	means that non-gio POSIX apps, such as mplayer, will Just Work(tm)
	when launced via the file manager. Win. Fixes bug #528670.

	* gappinfo.c: Add some notes about the FUSE POSIX URI <-> GIO URI
	mapping to the description of GAppInfo.

2008-10-01  David Zeuthen  <davidz@redhat.com>

	* README.in: Add "Notes about glib 2.20" section detailing the
	ramifications of the patch from bug #528670.


svn path=/trunk/; revision=7566
2008-10-01 17:46:57 +00:00
Tor Lillqvist
402d950ec7 Build desktop-app-info only on Unix.
2008-09-30  Tor Lillqvist  <tml@novell.com>

	* tests/Makefile.am: Build desktop-app-info only on Unix.


svn path=/trunk/; revision=7562
2008-09-30 11:08:38 +00:00
Tor Lillqvist
801da1dfc1 Avoid a g_critical(). Pass a large enough result buffer to
2008-09-30  Tor Lillqvist  <tml@novell.com>

	* glocalfile.c (get_volume_for_path) [Win32]: Avoid a
	g_critical(). Pass a large enough result buffer to
	GetVolumePathNameW(). Just use MAX_PATH.


svn path=/trunk/; revision=7561
2008-09-30 10:47:06 +00:00
David Zeuthen
8070d3b02f Clarify semantics of g_volume_mount_finish() (#552168)
2008-09-29  David Zeuthen  <davidz@redhat.com>

        * gvolume.c: Clarify semantics of g_volume_mount_finish() (#552168)


svn path=/trunk/; revision=7559
2008-09-29 17:42:01 +00:00
Dan Winship
29ddd48ff2 Use g_assert_error() and g_assert_no_error()
* tests/data-input-stream.c:
	* tests/data-output-stream.c:
	* tests/live-g-file.c:
	* tests/memory-input-stream.c:
	* tests/memory-output-stream.c: Use g_assert_error() and
	g_assert_no_error()

svn path=/trunk/; revision=7556
2008-09-27 01:43:43 +00:00
Matthias Clasen
764e187fd9 Bug 545350 – GAppInfo deletion Bug 545351 – Reset associations for
2008-09-26  Matthias Clasen  <mclasen@redhat.com>

        Bug 545350 – GAppInfo deletion
        Bug 545351 – Reset associations for content type

        * gio.symbols:
        * gappinfo.[hc]: New functions g_app_info_can_delete,
        g_app_info_delete and g_app_info_reset_type_associations.

        * gdesktopappinfo.c:
        * gwin32appinfo.c: Implementations of these.

        * tests/Makefile.am:
        * tests/desktop-app-info.c: Tests for GAppInfo functionality.


svn path=/trunk/; revision=7554
2008-09-26 19:57:36 +00:00
Dan Winship
7f4864e58d Bug 505361 - gunixinputstream.c assumes poll() available
Bug 509446 - portable blocking gio cancellation

	* gcancellable.c (g_cancellable_make_pollfd): New method to make a
	GPollFD for a cancellable (which is slightly more complicated on
	Windows than Unix).

	* gunixinputstream.c (g_unix_input_stream_read):
	* gunixoutputstream.c (g_unix_output_stream_write): Use
	g_cancellable_make_pollfd() and g_poll() rather than using poll()
	directly.

	* tests/unix-streams.c: test of GUnixInputStream,
	GUnixOutputStream, and GCancellable.

svn path=/trunk/; revision=7553
2008-09-26 16:19:35 +00:00
Dan Winship
5360907e9e add a cast to stop a gcc warning
* gdesktopappinfo.c (get_all_desktop_entries_for_mime_type): add a
	cast to stop a gcc warning

	* gfile.c (g_file_copy_attributes): add parens to stop a gcc
	warning

svn path=/trunk/; revision=7550
2008-09-26 16:00:17 +00:00
Dan Winship
efce76ce67 Bug 553426 - cancellable clarifications
* gcancellable.c (g_cancellable_class_init): Add a note to the
	"cancelled" signal docs warning about thread-safety issues
	(g_cancellable_cancel): Note that cancelling an asynchronous
	operation takes effect asynchronously, not immediately.

svn path=/trunk/; revision=7541
2008-09-25 12:04:52 +00:00
Michael Natterer
0275c4141e Move ChangeLog entry to right ChangeLog.
svn path=/trunk/; revision=7538
2008-09-23 18:57:16 +00:00
Nelson Benítez León
811fcbcd95 Add new GFileCopyFlag
svn path=/trunk/; revision=7526
2008-09-21 23:53:40 +00:00
Matthias Clasen
130d8f010f Plug a memory leak
svn path=/trunk/; revision=7520
2008-09-21 00:00:18 +00:00
Matthias Clasen
ac516ab07e 2.18.1
svn path=/trunk/; revision=7505
2008-09-17 23:56:04 +00:00
Michael Natterer
2623f6fc0f can't assign the return value of g_strdupv() to an array. Fill the array
2008-09-16  Michael Natterer  <mitch@imendio.com>

	* gcontenttype.c (g_content_type_guess): can't assign the return
	value of g_strdupv() to an array. Fill the array manually with
	const strings instead (it is never freed anyway). Fixes the
	build. Also fixed indentation.


svn path=/trunk/; revision=7501
2008-09-16 11:36:52 +00:00
Wouter Bolsterlee
1d627b703f Fix trivial typo to unbreak the build (there was a colon instead of a
2008-09-16  Wouter Bolsterlee  <wbolster@svn.gnome.org>

	* gdesktopappinfo.c (g_desktop_app_info_new_from_keyfile):
	Fix trivial typo to unbreak the build (there was a colon
	instead of a semicolon at the end of a statement).


svn path=/trunk/; revision=7500
2008-09-16 09:13:19 +00:00
Matthias Clasen
cdded60e29 Ignore an empty Path value
svn path=/trunk/; revision=7492
2008-09-15 16:26:38 +00:00
Matthias Clasen
f634171ec5 Bug 551681 – g_content_type_guess() too naive with filenames
* gcontenttype.c (g_content_type_guess): Check whether there's a '/'
        at the end of the filename, and declare it a directory.
        Patch by Bastien Nocera


svn path=/trunk/; revision=7491
2008-09-15 16:06:05 +00:00
Cosimo Cecchi
6e3f927901 Bug 551887 – Docs for g_desktop_app_info_new_from_filename () aren't
2008-09-14  Cosimo Cecchi  <cosimoc@gnome.org>

	Bug 551887 – Docs for g_desktop_app_info_new_from_filename ()
	aren't clear.

	* gdesktopappinfo.c: add a note in the docs clarifying what the
	"filename" parameter really is.

svn path=/trunk/; revision=7481
2008-09-13 23:47:41 +00:00
Tor Lillqvist
654822b9be Don't call FormatMessage() etc here. Call g_win32_error_message() instead
2008-09-12  Tor Lillqvist  <tml@novell.com>

	* gwin32appinfo.c (g_win32_app_info_launch): Don't call
	FormatMessage() etc here. Call g_win32_error_message() instead
	which already does all that. Besides, the code was broken as it
	called the default "A" version of FormatMessage() but still
	thought it produced a wide string.


svn path=/trunk/; revision=7472
2008-09-12 00:54:14 +00:00
Michael Natterer
b6d834a588 remove dangling 's' in the documentation.
2008-09-12  Michael Natterer  <mitch@imendio.com>

	* gfileinfo.c (g_file_info_get_content_type): remove dangling 's'
	in the documentation.


svn path=/trunk/; revision=7471
2008-09-11 22:05:09 +00:00
Christian Neumair
b9c69790a8 (gio)
2008-09-08  Christian Neumair  <cneumair@gnome.org>

	* gunixmount.c (eject_unmount_read_error), (eject_unmount_do):
	* gunixvolume.c (eject_mount_read_error), (eject_mount_do):
	Use non-blocking pipe for mount helper I/O. Fixes #550647.

svn path=/trunk/; revision=7444
2008-09-08 12:44:07 +00:00
Matthias Clasen
80e11e1d4f Bug 551149 – xdgmime mem leak
2008-09-06  Matthias Clasen  <mclasen@redhat.com>

        Bug 551149 – xdgmime mem leak

        * xdgmime/xdgmime.c (xdg_mime_init_from_directory): Plug
        a memory leak. Patch by Christian Persch


svn path=/trunk/; revision=7441
2008-09-07 03:28:56 +00:00
Tor Lillqvist
f709eda798 Don't unref icon if NULL.
2008-09-04  Tor Lillqvist  <tml@novell.com>

	* gwin32mount.c (g_win32_mount_finalize): Don't unref icon if
	NULL.


svn path=/trunk/; revision=7439
2008-09-04 20:41:50 +00:00
Matthias Clasen
e43de8e0e6 2.18.0
svn path=/trunk/; revision=7434
2008-09-02 20:09:55 +00:00
Michael Natterer
f2a2d6c9ac big header formatting cleanup: indentation, vtable formatting, consistent
2008-09-02  Michael Natterer  <mitch@imendio.com>

	* *.h: big header formatting cleanup: indentation, vtable
	formatting, consistent spacing in (* vfunc), trailing whitespace
	removal. Formatting should be pretty consistent in all GIO headers
	now.


svn path=/trunk/; revision=7433
2008-09-02 19:05:58 +00:00
Ryan Lortie
920f3bffb3 Bug 549771 – improved .gitignore for glib
2007-09-02  Ryan Lortie  <desrt@desrt.ca>

        Bug 549771 – improved .gitignore for glib

        * docs/reference/.gitignore:
        * docs/reference/gio/.gitignore:
        * docs/reference/gobject/tmpl/.gitignore:
        * gio/.gitignore:
        * gio/tests/.gitignore:
        * glib/.gitignore:
        * glib/libcharset/.gitignore:
        * glib/tests/.gitignore:
        * gmodule/.gitignore:
        * gobject/.gitignore:
        * gobject/tests/.gitignore:
        * po/.gitignore:
        * tests/.gitignore: new files
        * .gitignore: remove 'build' (since it's part of glib now), add more
        useful things.


svn path=/trunk/; revision=7432
2008-09-02 18:40:39 +00:00
Matthias Clasen
4f1e575f30 Document guess_content_type_sync
svn path=/trunk/; revision=7428
2008-09-02 17:37:51 +00:00
Michael Natterer
4c2ca6d3f4 fix parent_class member to be GFilterOutputStreamClass (not
2008-09-02  Michael Natterer  <mitch@imendio.com>

	* gbufferedoutputstream.h (struct _GBufferedOutputStreamClass):
	fix parent_class member to be GFilterOutputStreamClass (not
	GOutputStreamClass). Drop three pointers of padding, which is
	exactly what GFilterOutputStreamClass adds to GOutputStreamClass,
	so the class struct size stays the same.


svn path=/trunk/; revision=7427
2008-09-02 17:30:02 +00:00
Matthias Clasen
291eb30803 Fix docs
svn path=/trunk/; revision=7425
2008-09-02 16:57:59 +00:00
Tor Lillqvist
a6fe58233d Clarification.
svn path=/trunk/; revision=7389
2008-08-23 01:10:03 +00:00
Tor Lillqvist
02d9af3562 Bug 548988 - g_file_replace fails on Windows when the target file exists
2008-08-23  Tor Lillqvist  <tml@novell.com>

	Bug 548988 - g_file_replace fails on Windows when the target file
	exists already

	* glocalfileoutputstream.c (g_local_file_output_stream_close): On
	Windows, close the file before renaming it (in case we have been
	writing to a file with a temporary name).

	(g_local_file_output_stream_close, handle_overwrite_open): Use
	GLocalFileStat instead of plain struct stat, for passing to
	_g_local_file_info_create_etag(). Thus also use _fstati64()
	instead of plain fstat() on Windows.


svn path=/trunk/; revision=7388
2008-08-23 01:09:08 +00:00
Matthias Clasen
e17c805ce4 2.17.7
svn path=/trunk/; revision=7367
2008-08-18 13:17:39 +00:00
Padraig O'Briain
4cafadc955 Add zfs to ignore_fs array in guess_system_internal: Fix for #542156.
2008-08-15  Padraig O'Briain  <padraig.obriain@sun.com>

	* gunixmounts.c: Add zfs to ignore_fs array in guess_system_internal:
	Fix for #542156.


svn path=/trunk/; revision=7357
2008-08-15 08:27:55 +00:00
Tor Lillqvist
d5863830ad win32/gwinhttpvfs.c win32/gwinhttpvfs.h win32/gwinhttpfile.c
2008-08-13  Tor Lillqvist  <tml@novell.com>

	* win32/gwinhttpvfs.c
	* win32/gwinhttpvfs.h
	* win32/gwinhttpfile.c
	* win32/gwinhttpfileinputstream.c
	* win32/gwinhttpfileoutputstream.c: Refactor some common code
	snippets into helper functions. Check HTTP response status
	codes. Implement g_winhttp_file_query_info(), looking at
	Content-Length, Content-Type and Last-Modified.

	* win32/winhttp.h: Add some symbolic constants that are not
	publicly documented. Just a handful, so it should be OK to use
	information from the Windows SDK's headers.


svn path=/trunk/; revision=7350
2008-08-13 19:39:49 +00:00
Tor Lillqvist
7ffb2b3366 Bug 546582 - Callbacks from GFileMonitor present a GFile in the wrong
2008-08-13  Tor Lillqvist  <tml@novell.com>

	Bug 546582 - Callbacks from GFileMonitor present a GFile in the
	wrong folder

	* win32/gwin32directorymonitor.c
	(g_win32_directory_monitor_callback): Patch by Erik van Pienbroek.


svn path=/trunk/; revision=7347
2008-08-13 06:56:31 +00:00
Matthias Clasen
cec561c2cd Add docs
svn path=/trunk/; revision=7346
2008-08-13 05:35:10 +00:00
Tor Lillqvist
af8ebc9e55 Don't write the Content-Length header ourselves, WinHttpSendRequest()
2008-08-13  Tor Lillqvist  <tml@novell.com>

	* win32/gwinhttpfileoutputstream.c
	(g_winhttp_file_output_stream_write): Don't write the
	Content-Length header ourselves, WinHttpSendRequest() takes care
	of that when the dwTotalLength parameter is non-zero. Increment
	offset by the number of actual bytes sent, although I wonder if
	such a scenario is possible where less than requested would be
	sent and accepted by the server without errors.


svn path=/trunk/; revision=7345
2008-08-12 23:40:39 +00:00
Tor Lillqvist
7261372b45 win32/gwinhttpvfs.c win32/gwinhttpvfs.h win32/gwinhttpfile.c
2008-08-13  Tor Lillqvist  <tml@novell.com>

	* win32/gwinhttpvfs.c
	* win32/gwinhttpvfs.h
	* win32/gwinhttpfile.c
	* win32/gwinhttpfile.h
	* win32/gwinhttpfileinputstream.c
	* win32/gwinhttpfileinputstream.h
	* win32/gwinhttpfileoutputstream.c
	* win32/gwinhttpfileoutputstream.h: New files implementing
	GWinHttpVfs and related classes, a GVfs for HTTP and HTTPS URIs on
	Windows. The implementation uses the WinHttp API. Both reading and
	writing are supported, i.e. GET and PUT requests. When writing,
	each write call is done using a separate PUT request with a
	Content-Range header. Requests for file URIs and plain pathnames
	are forwarded to GLocalVfs.

	* win32/winhttp.h: Reverse engineered <winhttp.h>, borrowed from
	WINE. Used as there is no <winhttp.h> bundled with mingw, and
	requiring people to download the Windows SDK just for this one
	header is not reasonable.

	* win32/Makefile.am: Add above files.

	* giomodule.c: Call _g_winhttp_vfs_get_type() on Windows to set up
	the plumbing for the above.


svn path=/trunk/; revision=7344
2008-08-12 23:09:04 +00:00
Sven Neumann
8d37a7964d gfilenamecompleter.c glocaldirectorymonitor.c gmountoperation.c
2008-08-11  Sven Neumann  <sven@gimp.org>

	* gfilenamecompleter.c
	* glocaldirectorymonitor.c
	* gmountoperation.c
	* gunionvolumemonitor.c
	* gunixmount.c
	* gunixmounts.c
	* gunixvolume.c
	* gunixvolumemonitor.c
	* gvolumemonitor.c
	* gwin32mount.c
	* gwin32volumemonitor.c: use canonical signal names.


svn path=/trunk/; revision=7339
2008-08-11 19:45:08 +00:00
Tor Lillqvist
3c9cfe7fb5 Put a list of the platform-dependent .la files in the subdirectories in
2008-08-11  Tor Lillqvist  <tml@novell.com>

	* Makefile.am: Put a list of the platform-dependent .la files in
	the subdirectories in the platform_deps Make variable, and make
	libgio-2.0.la depend on that, so that it gets relinked if one of
	the dependent libraries has changed.


svn path=/trunk/; revision=7336
2008-08-11 12:35:09 +00:00
Tor Lillqvist
c7ba2969d1 Remove -lwininet which had been added by mistake. We will probably
2008-08-11  Tor Lillqvist  <tml@novell.com>

	* Makefile.am (platform_libadd): Remove -lwininet which had been
	added by mistake. We will probably eventually be using WinHTTP,
	not the older WinInet anyway. (Actually I am working on it.)


svn path=/trunk/; revision=7335
2008-08-10 22:01:36 +00:00
Felix Riemann
26f2a3b93c Bug 547080 – g_file_copy leaks expected errors
2008-08-10  Felix Riemann  <friemann@svn.gnome.org>

	Bug 547080 – g_file_copy leaks expected errors

	* gfile.c: (g_file_copy): Clear G_IO_ERROR_NOT_SUPPORTED errors
	before trying the next fallback routine.

svn path=/trunk/; revision=7331
2008-08-10 10:55:57 +00:00
Loïc Minier
15f92bfc3d Bug 535124 – umask 002 not being applied for new directories, new files
2008-08-09  Loïc Minier  <lool@dooz.org>

	Bug 535124 – umask 002 not being applied for new directories, new
	files get the correct umask

	* gfile.c (g_file_make_directory)
	(g_file_make_directory_with_parents): Document ownership and
	permissions of newly created directories as being the default
	ones of the process.

svn path=/trunk/; revision=7330
2008-08-09 08:41:43 +00:00
Loïc Minier
83e4fb4f9b Bug 535124 – umask 002 not being applied for new directories, new files
2008-08-08  Loïc Minier  <lool@dooz.org>

	Bug 535124 – umask 002 not being applied for new directories, new
	files get the correct umask

	* glocalfile.c: (g_local_file_make_directory): Use 0777 instead of
	0755 as umask

svn path=/trunk/; revision=7323
2008-08-08 09:26:51 +00:00
Tor Lillqvist
d4fd1ea15d Remove unused code. Whitespace cleanup.
2008-08-08  Tor Lillqvist  <tml@novell.com>

	* gwin32mount.c: Remove unused code. Whitespace cleanup.


svn path=/trunk/; revision=7322
2008-08-08 06:38:05 +00:00
Tor Lillqvist
671ac311d5 Put questionable code that didn't actually do anything inside #if 0, and
2008-08-08  Tor Lillqvist  <tml@novell.com>

	* gwin32volumemonitor.c (get_connected_drives): Put questionable
	code that didn't actually do anything inside #if 0, and add a
	comment wondering what the code was supposed to do. This also gets
	rid of a leftover debugging printout.


svn path=/trunk/; revision=7321
2008-08-08 05:36:56 +00:00
Paul Pogonyshev
3512e4f63d New functions. (g_file_icon_class_init): Hook them up. Install
2008-08-07  Paul Pogonyshev  <pogonyshev@gmx.net>

	* gfileicon.c (g_file_icon_get_property)
	(g_file_icon_set_property): New functions.
	(g_file_icon_class_init): Hook them up.  Install `GFileIcon:file'
	property.
	(g_file_icon_new): Use the property (bug #546132).

svn path=/trunk/; revision=7318
2008-08-07 19:44:53 +00:00
Paul Pogonyshev
4bd7cc6ad7 Also handle `PROP_USE_DEFAULT_FALLBACKS'. (g_themed_icon_class_init): Make
2008-08-06  Paul Pogonyshev  <pogonyshev@gmx.net>

	* gthemedicon.c (g_themed_icon_get_property): Also handle
	`PROP_USE_DEFAULT_FALLBACKS'.
	(g_themed_icon_class_init): Make
	`GThemedIcon:use-default-fallbacks' read-write (bug #546483).

svn path=/trunk/; revision=7316
2008-08-06 19:43:31 +00:00
Behdad Esfahbod
f50f67addf Bug 546371 – Improve docs re g_file_monitor
2008-08-05  Behdad Esfahbod  <behdad@gnome.org>

        Bug 546371 – Improve docs re g_file_monitor

        * gfilemonitor.c: Mention g_file_monitor() in the docs.


svn path=/trunk/; revision=7314
2008-08-05 17:51:13 +00:00
Matthias Clasen
26c1be0d51 2.13.6
svn path=/trunk/; revision=7301
2008-08-04 17:58:13 +00:00
Matthias Clasen
001bb527b6 Forgotten commit
svn path=/trunk/; revision=7300
2008-08-04 17:19:30 +00:00
Matthias Clasen
ab0f863606 2.17.5
svn path=/trunk/; revision=7297
2008-08-04 17:01:23 +00:00
Matthias Clasen
8fbbb4d9cb Bug 546017 – Don't copy attributes when copying a symlink
2008-08-04  Matthias Clasen  <mclasen@redhat.com>

        Bug 546017 – Don't copy attributes when copying a symlink

        * gfile.c (g_file_copy_attributes): Specify
        G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in the call to
        g_file_set_attributes_from_info. Patch by Christian Kellner


svn path=/trunk/; revision=7294
2008-08-04 15:58:25 +00:00
Carlos Garcia Campos
f5edeb8c0f Bug 546079 – leak in xdgmime
2008-08-03  Carlos Garcia Campos  <carlosgc@gnome.org>

	Bug 546079 – leak in xdgmime
	
	* xdgmime/xdgmime.c (xdg_mime_shutdown): Fix memory leak.


svn path=/trunk/; revision=7292
2008-08-03 18:49:12 +00:00
Tor Lillqvist
506eed4ebd win32/gwin32directorymonitor.h Whitespace cleanup to match GLib style.
2008-08-03  Tor Lillqvist  <tml@novell.com>

	* win32/gwin32directorymonitor.h
	* win32/gwin32directorymonitor.c: Whitespace cleanup to match GLib
	style.


svn path=/trunk/; revision=7291
2008-08-03 00:17:39 +00:00
Tor Lillqvist
3bf84fb1cc Make prototype match LPOVERLAPPED_COMPLETION_ROUTINE to avoid warning.
2008-08-03  Tor Lillqvist  <tml@novell.com>

	* win32/gwin32directorymonitor.c
	(g_win32_directory_monitor_callback): Make prototype match
	LPOVERLAPPED_COMPLETION_ROUTINE to avoid warning. Cast
	LPOVERLAPPED parameter to local GWin32DirectoryMonitorPrivate
	pointer.

	(g_win32_directory_monitor_constructor):
	GLocalDirectoryMonitor::dirname is in UTF-8 like all other file
	names in the GLib API on Windows, so convert to UTF-16 and open
	with CreateFileW().


svn path=/trunk/; revision=7290
2008-08-03 00:06:39 +00:00
Tor Lillqvist
8258d6863b Bug 541036 - Gnumeric crashes when trying to open Desktop or user's folder
2008-08-03  Tor Lillqvist  <tml@novell.com>

	Bug 541036 - Gnumeric crashes when trying to open Desktop or
	user's folder under Windows

	* win32/gwin32directorymonitor.c
	(g_win32_directory_monitor_constructor): Ignore error from
	CreateFile() when opening directory. Instead of asserting, just
	store INVALID_HANDLE_VALUE then in
	GWin32DirectoryMonitorPrivate::hDirectory. Also ignore error from
	ReadDirectoryChangesW().
	(g_win32_directory_monitor_cancel): Don't attempt to close
	directory handle if it is INVALID_HANDLE_VALUE.


svn path=/trunk/; revision=7289
2008-08-02 23:51:51 +00:00
Matthias Clasen
3d5a13121d Remove debug spew
svn path=/trunk/; revision=7282
2008-08-01 21:18:02 +00:00
Hans Breuer
792bc0c61f add gemblembedicon
2008-08-01  Hans Breuer  <hans@breuer.org>

	* makefile.msc : add gemblembedicon

svn path=/trunk/; revision=7276
2008-08-01 14:15:02 +00:00
Matthias Clasen
4d23d2647a Bug 545457 – gdmsetup crashed with SIGSEGV in
2008-07-30  Matthias Clasen  <mclasen@redhat.com>

        Bug 545457 – gdmsetup crashed with SIGSEGV in
        g_unix_mount_guess_should_display()

        * gunixvolumemonitor.c (get_mount_for_mount_path): Don't
        crash if no mount is found.


svn path=/trunk/; revision=7274
2008-07-30 16:45:46 +00:00
Matthias Clasen
855a4c1cca Bug 545203 – gfile.c: argument is different type.
2008-07-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 545203 – gfile.c: argument is different type.

        * gfile.c (open_read_async_thread): Pass a GError **
        to g_file_set_error_literal.
        Reported by Kazuki Iwamoto


svn path=/trunk/; revision=7269
2008-07-28 19:12:19 +00:00
Matthias Clasen
b51d77011c Bug 545157 – wrong/no list of "open with" applications for .cc and .cpp
2008-07-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 545157 – wrong/no list of "open with" applications for .cc and
        .cpp files

        * gdesktopappinfo.c (get_all_desktop_entries_for_mime_type):
        Collect all ancestors, not just direct parents. Pointed
        out by Bastien Nocera


svn path=/trunk/; revision=7268
2008-07-28 18:58:34 +00:00
Matthias Clasen
0e33683e64 Install gemblemedicon.h
svn path=/trunk/; revision=7266
2008-07-28 18:25:49 +00:00
Matthias Clasen
01832faf20 Forgotten entry
svn path=/trunk/; revision=7264
2008-07-28 15:53:43 +00:00
Matthias Clasen
a2b61b1e46 Add a GIcon implementation that can add an emblem to another icon.
2008-07-28  Matthias Clasen  <mclasen@redhat.com>

        * gemblemedicon.[hc]: Add a GIcon implementation that can
        add an emblem to another icon.

        * gio.h:
        * Makefile.am:
        * gio.symbols: Glue

        * gloadableicon.c:
        * gfileicon.c: Small documenatation additions.


svn path=/trunk/; revision=7263
2008-07-28 15:35:07 +00:00
Tor Lillqvist
4437940fe1 Correct return type.
2008-07-28  Tor Lillqvist  <tml@novell.com>

	* gwin32appinfo.c (g_win32_app_info_get_icon): Correct return
	type.


svn path=/trunk/; revision=7261
2008-07-28 00:26:09 +00:00
Tor Lillqvist
a076a30457 Set LIB_EXE_MACHINE_FLAG to either X86 or X64 on Windows. AC_SUBST it.
2008-07-27  Tor Lillqvist  <tml@novell.com>

	* configure.in: Set LIB_EXE_MACHINE_FLAG to either X86 or X64 on
	Windows. AC_SUBST it.

	* */Makefile.am: Correspondingly, pass appropriate -machine
	flag to lib.exe when producing the import library for the MS
	toolchain.


svn path=/trunk/; revision=7255
2008-07-27 15:54:15 +00:00
David Zeuthen
64c1eba197 Also export a g_mount_guess_content_type_sync() function.
2008-07-24  David Zeuthen  <davidz@redhat.com>

        * gmount.[ch]:
        * gio.symbols:
        Also export a g_mount_guess_content_type_sync() function.


svn path=/trunk/; revision=7252
2008-07-24 21:21:22 +00:00
Matthias Clasen
ed86835786 Support setting selinux attributes
svn path=/trunk/; revision=7241
2008-07-23 04:11:02 +00:00
Priit Laes
f656ca06de Bug 544140 - fam-helper 64-bit issue?
2008-07-22  Priit Laes <plaes@plaes.org>

	Bug 544140 - fam-helper 64-bit issue?

	* fam/fam-helper.c: Added missing include so compiler doesn't complain.

svn path=/trunk/; revision=7239
2008-07-22 14:56:31 +00:00
Matthias Clasen
282805b1d4 2.17.4
svn path=/trunk/; revision=7234
2008-07-21 17:56:17 +00:00
Matthias Clasen
c723669198 doc fixes
svn path=/trunk/; revision=7226
2008-07-21 02:53:30 +00:00
Matthias Clasen
d420020715 More doc fixes
svn path=/trunk/; revision=7225
2008-07-21 02:46:54 +00:00
Matthias Clasen
c0aacc7c4c More doc fixes
svn path=/trunk/; revision=7224
2008-07-21 02:32:14 +00:00
Matthias Clasen
3bdbb2b329 Doc fixes
svn path=/trunk/; revision=7223
2008-07-21 02:19:56 +00:00
Matthias Clasen
acb7f6449a 543504 – crash in Epiphany Web Browser: Opening local file
2008-07-19  Matthias Clasen  <mclasen@redhat.com>

        543504 – crash in Epiphany Web Browser: Opening local file

        * gappinfo.c:
        * gasyncresult.c:
        * gdesktopappinfo.c:
        * gdrive.c:
        * gfile.c:
        * gicon.c:
        * gloadableicon.c:
        * gmount.c:
        * gseekable.c:
        * gvolume.c: Register types thread-safely.
        Patch by Christian Persch


svn path=/trunk/; revision=7208
2008-07-20 00:34:58 +00:00
Matthias Clasen
48867a895c Remove debug spew
svn path=/trunk/; revision=7206
2008-07-19 01:15:12 +00:00
Matthias Clasen
f27ab8977b Remove a warning
svn path=/trunk/; revision=7203
2008-07-18 18:22:48 +00:00
Matthias Clasen
3cb92eb95e Fix a segfault
svn path=/trunk/; revision=7200
2008-07-18 17:48:30 +00:00
Matthias Clasen
38d4e3fd48 Add g_content_type_guess_for_tree
svn path=/trunk/; revision=7199
2008-07-18 15:33:22 +00:00
Matthias Clasen
981f9ed840 Avoid a filename conflict
svn path=/trunk/; revision=7192
2008-07-16 06:30:12 +00:00
Matthias Clasen
6dba7df4b1 Plug a leak
svn path=/trunk/; revision=7191
2008-07-16 06:13:41 +00:00
Matthias Clasen
d17b52cbdb More documentation fixes
svn path=/trunk/; revision=7190
2008-07-16 05:49:16 +00:00
Matthias Clasen
9f3f5f0905 Small documentation fixes
svn path=/trunk/; revision=7187
2008-07-16 04:21:50 +00:00
Matthias Clasen
20174898b5 Use g_strcmp0 instead of rolling our own
svn path=/trunk/; revision=7183
2008-07-15 05:42:11 +00:00
Matthias Clasen
0a20d4cbe4 Doc improvement
svn path=/trunk/; revision=7173
2008-07-09 04:26:47 +00:00
Matthias Clasen
07d4c14f8d Documentation improvements.
svn path=/trunk/; revision=7172
2008-07-09 04:18:45 +00:00
Matthias Clasen
d6e4fe5ae9 Add g_mount_guess_content_type
svn path=/trunk/; revision=7171
2008-07-08 16:02:08 +00:00
Matthias Clasen
c8c5188fd5 Minor doc edits
svn path=/trunk/; revision=7170
2008-07-08 06:01:04 +00:00
David Zeuthen
2b714b5f20 Add new method g_volume_get_activation_root(). This is needed for easily
2008-07-06  David Zeuthen  <davidz@redhat.com>

	* gio.symbols:
	* gvolume.[ch]: Add new method g_volume_get_activation_root(). This
	is needed for easily handling adoption of foreign volumes by
	out-of-process volume monitors (#541793)


svn path=/trunk/; revision=7169
2008-07-07 15:38:38 +00:00
David Zeuthen
7a5a2be92b Export the eject-button signal on the volume monitor class (#541794).
2008-07-06  David Zeuthen  <davidz@redhat.com>

        * gvolumemonitor.[ch]:
        * gunionvolumemonitor.c: Export the eject-button signal on the
        volume monitor class (#541794).


svn path=/trunk/; revision=7168
2008-07-07 02:23:52 +00:00
Matthias Clasen
532e476d62 More doc tweaks
svn path=/trunk/; revision=7167
2008-07-06 22:11:58 +00:00
Matthias Clasen
c7a067e211 Clarify some docs
svn path=/trunk/; revision=7162
2008-07-06 00:07:50 +00:00
Matthias Clasen
548b2bd02b Fix a stupid crash
svn path=/trunk/; revision=7155
2008-07-03 22:57:55 +00:00
Matthias Clasen
7a5b6f0057 2.17.3
svn path=/trunk/; revision=7152
2008-07-03 00:28:00 +00:00
Matthias Clasen
0227089563 Fix the build
svn path=/trunk/; revision=7151
2008-07-02 22:05:32 +00:00
Colin Walters
eb4ce9620a Use UNLOCK to unlock, not LOCK.
2008-07-02  Colin Walters  <walters@redhat.com>

	* gio/gcontenttype.c: Use UNLOCK to unlock, not LOCK.


svn path=/trunk/; revision=7146
2008-07-02 19:06:08 +00:00
Matthias Clasen
d19e08a40c Add g_file_monitor
svn path=/trunk/; revision=7145
2008-07-02 17:19:16 +00:00
Matthias Clasen
563eb12748 Use a configure check for structfs.f_bavail.
* glocalfile.c: Use a configure check for structfs.f_bavail.


svn path=/trunk/; revision=7144
2008-07-02 16:49:04 +00:00
Matthias Clasen
9d82224015 Add a function to create a GDesktopAppInfo from a GKeyFile. Proposed by
* gio.symbols:
        * gdesktopappinfo.[hc]: Add a function to create a
        GDesktopAppInfo from a GKeyFile. Proposed by Josselin Mouette.


svn path=/trunk/; revision=7143
2008-07-02 16:23:23 +00:00
Wouter Bolsterlee
952923ca11 Fix ulink in doc to make gtk-doc happy.
2008-07-02  Wouter Bolsterlee  <wbolster@svn.gnome.org>

	* gappinfo.c: Fix ulink in doc to make gtk-doc happy.


svn path=/trunk/; revision=7138
2008-07-02 13:17:23 +00:00
Matthias Clasen
ee96535cec Fix a doc typo
svn path=/trunk/; revision=7136
2008-07-02 03:41:58 +00:00
Cody Russell
a6a4779108 Fixed some more includes
svn path=/trunk/; revision=7131
2008-07-02 01:54:16 +00:00
Cody Russell
43d6efbb46 Fixed some include problems.
2008-07-01  Cody Russell  <bratsche@gnome.org>

        * gio/gwin32appinfo.c:
        * gio/gwin32mount.c: Fixed some include problems.


svn path=/trunk/; revision=7130
2008-07-02 01:52:37 +00:00
Cody Russell
868d0cef12 Move my ChangeLog entry to the right place
svn path=/trunk/; revision=7129
2008-07-01 15:18:14 +00:00
Cody Russell
3d93bf6968 Moved all relevant typedefs into these files.
2008-07-01  Cody Russell  <bratsche@gnome.org>

        * gio/gioenums.h:
        * gio/giotypes.h:
	Moved all relevant typedefs into these	files.

        * gio/*.[ch]:
	Updated wrt added files.

        Split types into separate file	for easier maintainership. (#538564)


svn path=/trunk/; revision=7127
2008-07-01 06:32:35 +00:00
Matthias Clasen
64770f4b0e Clarify docs. Patch by Jared Moore
* gfile.c (g_file_append_to): Clarify docs.
        Patch by Jared Moore

svn path=/trunk/; revision=7110
2008-06-30 05:02:06 +00:00
Matthias Clasen
9b89825af0 Unalias. Patch by Markus Bergman
* gcontentype.c (g_content_type_from_mime_type): Unalias.
        Patch by Markus Bergman


svn path=/trunk/; revision=7109
2008-06-30 04:59:40 +00:00
Matthias Clasen
9df3b94a0d Allow g_atomic_pointer_get
svn path=/trunk/; revision=7108
2008-06-30 04:55:27 +00:00
Matthias Clasen
e3313b2651 Add some tests for GMemoryOutputStream.
2008-06-29  Matthias Clasen  <mclasen@redhat.com>

        * tests/Makefile.am:
        * tests/memory-output-stream.c: Add some tests for
        GMemoryOutputStream.

2008-06-29  Matthias Clasen  <mclasen@redhat.com>

        Bug 540423 – unrecoverable error after g_seekable_truncate(seekable,
        0, ...)

        * gmemoryoutputstream.c (array_resize): Handle truncation to
        zero correctly. Reported by Akira Tagoh



svn path=/trunk/; revision=7106
2008-06-30 03:47:27 +00:00
Matthias Clasen
19bf6826f0 Trivial doc fixes
svn path=/trunk/; revision=7104
2008-06-30 02:55:39 +00:00
Matthias Clasen
0741dea88f Don't g_list_prepend one list to another. Pointed out by Jan Arne Petersen
* giomodule.c (_g_io_modules_ensure_loaded): Don't g_list_prepend
        one list to another. Pointed out by Jan Arne Petersen


svn path=/trunk/; revision=7103
2008-06-30 02:44:52 +00:00
Michael Natterer
9dc8ea91a2 remove semicolons from G_IMPLEMENT_INTERFACE().
2008-06-28  Michael Natterer  <mitch@imendio.com>

	* gfileicon.c: remove semicolons from G_IMPLEMENT_INTERFACE().


svn path=/trunk/; revision=7101
2008-06-28 20:53:02 +00:00
Kristian Rietveld
1289b6d165 introduce an ENUMPREFIX substitution.
2008-06-23  Kristian Rietveld  <kris@imendio.com>

	* gobject/glib-mkenums.in: introduce an ENUMPREFIX substitution.

	* gio/gioenumtypes.h.template: use @ENUMPREFIX@ instead of
	hard coding "G" as prefix.


svn path=/trunk/; revision=7096
2008-06-23 12:06:39 +00:00
Johan Dahlin
761424465a Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch


svn path=/trunk/; revision=7092
2008-06-22 15:10:51 +00:00
Matthias Clasen
f6da8a493c Don't do fallback for user-home and user-desktop to avoid problems with
* glocalfileinfo.c: Don't do fallback for user-home and user-desktop
        to avoid problems with partial icon themes.



svn path=/trunk/; revision=7056
2008-06-19 03:30:17 +00:00
Hans Breuer
b696a978ea bits and pieces from gtk-2-12 and gunix*.[hc] to make the file chooser
2008-06-17  Hans Breuer  <hans@breuer.org>

        * gwin32mount.[ch] gwin32volumemonitor.[ch] : bits and pieces from 
        gtk-2-12 and gunix*.[hc] to make the file chooser show drive letter
	access again on win32, see bug #538127
        * giomodule.c : ensure GWin32VolumeMonitor is registered
        * glocaldireoctorymonitor.c : initial state on win32 is_mounted=TRUE
        * Makefile.am makefile.msc : updated

svn path=/trunk/; revision=7055
2008-06-17 21:40:04 +00:00
Hans Breuer
203ac61027 fixed the date
svn path=/trunk/; revision=7053
2008-06-16 20:35:48 +00:00
Hans Breuer
890d13b40e declaration and initialization in one step avoids c99ism
2008-05-19  Hans Breuer  <hans@breuer.org>

	* glocalfileenumerator.c(_g_local_file_enumerator_new) : declaration 
	and initialization in one step avoids c99ism

svn path=/trunk/; revision=7052
2008-06-16 20:34:42 +00:00
Christian Persch
9c17697b56 Use g_set_error_literal where appropriate. Patch from bug #535947.
svn path=/trunk/; revision=7051
2008-06-16 16:53:58 +00:00
Tor Lillqvist
cc8adfaeb8 Bug 538362 - Get Win32 icons back in the file chooser
2008-06-16  Tor Lillqvist  <tml@novell.com>

	Bug 538362 - Get Win32 icons back in the file chooser

	* gcontenttype.c (g_content_type_get_icon): Look up the icon
	corresponding to a file extension in the Registry. Patch by Hans
	Breuer.
	(get_registry_classes_key): Handle also REG_EXPAND_SZ type values.
	
2008-06-16  Tor Lillqvist  <tml@novell.com>

	Patches by Hans Breuer:

	* glocalfile.c (is_xp_or_later): Handle compiling against older
	SDK headers with missing VerifyVersionInfo().  Conditioned on
	_MSC_VER, but should probably use some better test.
	* glocalfile.c (g_local_file_query_filesystem_info): Don't test
	uninitialised statfs_result variable on Win32.



svn path=/trunk/; revision=7049
2008-06-16 13:23:14 +00:00
Michael Natterer
a4427bfff5 chain up unconditionally in finalize() and dispose(). Also don't
2008-06-16  Michael Natterer  <mitch@imendio.com>

	* *.c: chain up unconditionally in finalize() and dispose(). Also
	don't dereference these function pointers when calling them since
	that has no meaning at all.


svn path=/trunk/; revision=7048
2008-06-16 09:54:04 +00:00
Ross Burton
b207146976 Put my changelog entries in the right changelog, whoops
svn path=/trunk/; revision=7047
2008-06-16 09:31:20 +00:00
Ross Burton
17ac5f4dfb Remove check for dispose implementation as it annoys Emmanuele.
2008-06-16  Ross Burton  <ross@burtonini.com>

	* gio/gfileenumerator.c:
	Remove check for dispose implementation as it annoys Emmanuele.

svn path=/trunk/; revision=7045
2008-06-16 09:16:25 +00:00
Ross Burton
3480685d4e Bug 536252 – GFileEnumerator should allow access to the containing GFile
2008-06-16  Ross Burton  <ross@burtonini.com>

	Bug 536252 – GFileEnumerator should allow access to the containing
	GFile
	
	* gio/gfileenumerator.c:
	* gio/gfileenumerator.h:
	* gio/gfile.h:
	Add g_file_enumerator_get_container() and a container writeable
	construct-only property.  Also shuffle around typedefs to make it
	compile.
	
	* gio/glocalfileenumerator.c:
	* gio/glocalfileenumerator.h:
	* gio/glocalfile.c:
	Instead of a string filename take a GFile in the constructor and
	use it to set the container property.
	
	* gio/gio.symbols:
	* docs/reference/gio/gio-sections.txt:
	Update with new API.

svn path=/trunk/; revision=7044
2008-06-16 08:49:08 +00:00
Matthias Clasen
dd24f9957c Make includes more uniform
svn path=/trunk/; revision=7043
2008-06-16 04:36:03 +00:00
Hans Breuer
43eeb244ac to get the default translation target on win32 use g_win32_get_locale()
2008-06-13  Hans Breuer  <hans@breuer.org>

	* glib/gstrfuncs.c : to get the default translation target on
	win32 use g_win32_get_locale() instead of setlocale(LS_MESSAGES,NULL)
	Fixes bug #538044

	* glib/makefile.msc.in gio/makefile.msc : updated

svn path=/trunk/; revision=7036
2008-06-13 08:05:33 +00:00
Yevgen Muntyan
e5347891fe Use less fancy unicode filenames, so the test doesn't fail on Mac OS X
2008-06-12  Yevgen Muntyan  <muntyan@tamu.edu>

	* tests/live-g-file.c (sample_struct):
        Use less fancy unicode filenames, so the test doesn't fail
        on Mac OS X (#531476).


svn path=/trunk/; revision=7035
2008-06-13 03:56:26 +00:00
Matthias Clasen
135bb794fd 2.17.2
svn path=/trunk/; revision=7032
2008-06-12 18:37:44 +00:00
Matthias Clasen
6427d30d1f 2.17.1
svn path=/trunk/; revision=7029
2008-06-12 17:21:49 +00:00
A. Walton
52a03b97c6 Fix broken test case.
2008-06-11  A. Walton  <awalton@gnome.org>

	* tests/g-file.c (test_g_file_new_null):
	Fix broken test case.


svn path=/trunk/; revision=7016
2008-06-11 20:02:31 +00:00
Matthias Clasen
4f2c99af79 Allow PLT entry for g_clear_error
svn path=/trunk/; revision=7013
2008-06-11 18:50:17 +00:00
Ross Burton
7653f50019 Bug 511367 - add g_file_make_directory_with_parents.
2008-06-11  Ross Burton  <ross@burtonini.com>

	Bug 511367 - add g_file_make_directory_with_parents.
	
	* gio/gfile.c:
	* gio/gfile.h:
	* gio/gio.symbols: Add g_file_make_directory_with_parents.

svn path=/trunk/; revision=7001
2008-06-11 15:48:06 +00:00
Matthias Clasen
bb5bfd3546 revert unintended change
svn path=/trunk/; revision=6998
2008-06-11 14:25:18 +00:00
Matthias Clasen
9aad44c339 Don't unref before last use
svn path=/trunk/; revision=6997
2008-06-11 14:05:45 +00:00
Matthias Clasen
0e51f02ccb Bug 537546 – 'desktop' shortcut in file chooser looks like a generic
folder

        * glocalfileinfo.c (_g_local_file_info_get): Return user-desktop
        as icon for the desktop directory, also make user-home and
        user-desktop the preferred icons.


svn path=/trunk/; revision=6992
2008-06-10 16:56:25 +00:00
Matthias Clasen
0f370f9a04 Add g_themed_icon_prepend_name
svn path=/trunk/; revision=6991
2008-06-10 16:45:54 +00:00
Matthias Clasen
e12152159f Bug 537392 – Additional colon in xattr name
* glocalfileinfo.c (set_xattr): Skip the second colon of the prefix,
        too. Reported by  Alessandro Morandi


svn path=/trunk/; revision=6990
2008-06-10 15:55:31 +00:00
Matthias Clasen
972a981f30 Fix attribution
svn path=/trunk/; revision=6989
2008-06-10 15:38:42 +00:00
Matthias Clasen
a0c45852e1 Bug 536641 – Filesystem querying in gio does not list AFS and autofs
file systems

        * glocalfile.c (get_fs_type): Add afs and autofs.
        Patch by Danny Baumann.


svn path=/trunk/; revision=6988
2008-06-10 15:37:41 +00:00
Matthias Clasen
946b78006b Bug 528600 – g_dummy_file_get_parent("scheme://example.com/")
* gdummyfile.c (g_dummy_file_get_parent): Return NULL if there
        is no parent.  (Owen Taylor, patch by Christian Persch)


svn path=/trunk/; revision=6987
2008-06-10 15:27:39 +00:00
Paolo Borelli
9944e93fda do not leak the output stream.
2008-06-10  Paolo Borelli  <pborelli@katamail.com>

	* gfile.c (g_file_replace_contents): do not leak the output stream.


svn path=/trunk/; revision=6984
2008-06-10 11:40:45 +00:00
Michael Natterer
b15a223a8a fix SEGV by not using uninitialized memory as array index.
2008-06-10  Michael Natterer  <mitch@imendio.com>

	* gcontenttype.c (g_content_type_get_icon): fix SEGV by not using
	uninitialized memory as array index.


svn path=/trunk/; revision=6981
2008-06-10 10:51:29 +00:00
Tor Lillqvist
8b5ad297da Add TODO comments.
2008-06-10  Tor Lillqvist  <tml@novell.com>

	* gcontenttype.c (g_content_type_get_icon) [Win32]:
	Add TODO comments.


svn path=/trunk/; revision=6980
2008-06-10 10:35:20 +00:00
Tor Lillqvist
c7b21acd7b Add TODO comment.
2008-06-10  Tor Lillqvist  <tml@novell.com>

	* gcontenttype.c (g_content_type_can_be_executable) [Win32]: Add
	TODO comment.


svn path=/trunk/; revision=6979
2008-06-10 10:34:02 +00:00
Matthias Clasen
9331b3f1ce Fix the build
svn path=/trunk/; revision=6977
2008-06-09 21:38:35 +00:00
Matthias Clasen
c82988e262 Use icons from the shared mime database, if available.
svn path=/trunk/; revision=6976
2008-06-09 17:33:43 +00:00
Matthias Clasen
2bd31c9e6c Sync with upstream
svn path=/trunk/; revision=6975
2008-06-09 16:45:19 +00:00
Michael Natterer
03a5797a62 don't define G_DISABLE_SINGLE_INCLUDES, it's in the global CPPFLAGS now.
2008-05-28  Michael Natterer  <mitch@imendio.com>

	* Makefile.am: don't define G_DISABLE_SINGLE_INCLUDES, it's in
	the global CPPFLAGS now.

	* tests/data-input-stream.c
	* tests/data-output-stream.c
	* tests/g-file-info.c
	* tests/g-file.c
	* tests/live-g-file.c
	* tests/memory-input-stream.c: don't include <glib/gtestutils.h>


svn path=/trunk/; revision=6954
2008-05-28 16:17:45 +00:00
Matthias Clasen
e14f918de9 2.17.0
svn path=/trunk/; revision=6948
2008-05-27 21:22:45 +00:00
Matthias Clasen
689a9e4b1a Revert the patch for bug 527214 and related changes. GTimer
is supposed to work without threads.


svn path=/trunk/; revision=6943
2008-05-27 16:00:51 +00:00
simon.zheng
58e4b46343 Fix #533369. Check whether memeber statvfs.f_basetype available or not.
2008-05-27  simon.zheng  <simon.zheng@sun.com>

	* configure.in: Fix #533369. Check whether memeber statvfs.f_basetype 
        available or not.
	* gio/glocalfile.c: (g_local_file_query_filesystem_info):
        Fix #533369. Make G_FILE_ATTRIBUTE_FILESYSTEM_TYPE work on Solaris.


svn path=/trunk/; revision=6939
2008-05-27 07:51:13 +00:00
Michael Natterer
c9db84f9f2 declare g_memory_output_stream_get_data_size().
2008-05-26  Michael Natterer  <mitch@imendio.com>

	* gmemoryoutputstream.h: declare
	g_memory_output_stream_get_data_size().


svn path=/trunk/; revision=6936
2008-05-26 11:52:24 +00:00
Matthias Clasen
cdc2910103 Make tests work
svn path=/trunk/; revision=6935
2008-05-26 05:57:09 +00:00
Matthias Clasen
eb5889df59 Add a new symbol
svn path=/trunk/; revision=6934
2008-05-26 05:56:08 +00:00
Ross Burton
8b6fdb362f Fix typo in error message (#534764).
2008-05-25  Ross Burton  <ross@burtonini.com>

	* glocalfile.c:
	Fix typo in error message (#534764).

svn path=/trunk/; revision=6928
2008-05-25 18:31:42 +00:00
Ross Burton
75a558f900 Fix circular dependency loop for gioenumtypes.h (#534759).
2008-05-25  Ross Burton  <ross@burtonini.com>

	* Makefile.am:
	Fix circular dependency loop for gioenumtypes.h (#534759).

svn path=/trunk/; revision=6927
2008-05-25 15:49:27 +00:00
Hans Breuer
fd86d833b3 EXTRA_DIST += makefile.msc
2008-05-19  Hans Breuer  <hans@breuer.org>

	* Makefile.am : EXTRA_DIST += makefile.msc


svn path=/trunk/; revision=6912
2008-05-19 05:18:10 +00:00
Matthias Clasen
4f21fe18cb New function to create a content type from a mime type. (#527175, Milan
2008-05-17  Matthias Clasen  <mclasen@redhat.com>

        * gcontenttype.h:
        * gcontenttype.c: (g_content_type_from_mime_type):
        New function to create a content type from a mime type. (#527175,
        Milan Crha)


svn path=/trunk/; revision=6906
2008-05-18 02:50:48 +00:00
Matthias Clasen
a30f8df3c8 fix free space information for ncpfs
svn path=/trunk/; revision=6902
2008-05-17 06:08:08 +00:00
Matthias Clasen
67b2f9a99b Bug 530196 – _g_local_file_has_trash_dir() doesn't handle st_dev == 0
* glocalfile.c (_g_local_file_has_trash_dir): Handle the case that
        st_dev might be zero.



svn path=/trunk/; revision=6901
2008-05-17 06:01:43 +00:00
Tor Lillqvist
a6cd26d656 #define _WIN32_WINNT 0x0400 to get declaration of ReadDirectoryChangesW()
2008-05-16  Tor Lillqvist  <tml@novell.com>

	* win32/gwin32directorymonitor.c: #define _WIN32_WINNT 0x0400 to
	get declaration of ReadDirectoryChangesW() from Platform SDK headers.


svn path=/trunk/; revision=6893
2008-05-16 17:16:37 +00:00
Bastien Nocera
a495d32f36 A URI scheme must start with a letter, even if later more characters are
2008-05-13  Bastien Nocera  <hadess@hadess.net>

	* gfile.c (has_valid_scheme): A URI scheme must start with a
	letter, even if later more characters are allowed (#532852)


svn path=/trunk/; revision=6887
2008-05-13 12:42:40 +00:00
Michael Natterer
d922bf632a Makefile.am. build with G_DISABLE_SINGLE_INCLUDES to prevent code from
2008-05-05  Michael Natterer  <mitch@imendio.com>

	* Makefile.am. build with G_DISABLE_SINGLE_INCLUDES to prevent
	code from being checked in that breaks the build of applications
	which use G_DISABLE_SINGLE_INCLUDES.

	* makegioalias.pl: make the alias file include "glib.h" instead of
	"glibconfig.h".

	* gio.symbols: whitespace change to force regeneration of the
	alias file after above script change.

	* gfileinfo.h: remove inlcusion of <glib/gfileutils.h>.

	* gfilenamecompleter.c: remove inclusion of "gurifuncs.h".

	* gioerror.h: #include <glib.h> instead of <glib/gerror.h>.

	* glocalfileinfo.c: remove inclusion of <glib/gchecksum>.


svn path=/trunk/; revision=6879
2008-05-05 15:12:13 +00:00
David Zeuthen
27dba4c28b Avoid displaying mounts in a subdirectory not accessible to the user
2008-04-28  David Zeuthen  <davidz@redhat.com>

        * gunixmounts.c (g_unix_mount_guess_should_display): Avoid
        displaying mounts in a subdirectory not accessible to the
        user (#526320).


svn path=/trunk/; revision=6872
2008-04-28 22:38:49 +00:00
Michael Natterer
13567ad757 fix library versioning (it was 0.0.0).
2008-04-22  Michael Natterer  <mitch@imendio.com>

	* Makefile.am: fix library versioning (it was 0.0.0).


svn path=/trunk/; revision=6870
2008-04-22 13:51:37 +00:00
Tor Lillqvist
336cc8436b configure.in More work on enabling static building on Windows. When
2008-04-21  Tor Lillqvist  <tml@novell.com>

	* configure.in
	* */Makefile.am: More work on enabling static building on
	Windows. When building statically: Also define
	GOBJECT_STATIC_COMPILATION in glibconfig.h so that also the
	variables in gparamspecs.h get declared without any
	dllimport/dllexport decorations. Don't install .def files which
	obviously have no meaning for static libraries. Don't create MS
	import libraries. Don't do any resource object files.


svn path=/trunk/; revision=6866
2008-04-21 08:38:36 +00:00
Lin Ma
6965703ad2 Default disable all loggings. Fixed two macro nits.
2008-04-21  Lin Ma  <Lin.Ma@Sun.COM>

	* fen/fen-data.c, fen/fen-helper.c, fen/fen-missing.c, fen/fen-node.c:
	Default disable all loggings.
	* fen/fen-kernel.c: (printevent), (port_add_kevent),
	(port_fetch_event_cb): Fixed two macro nits.


svn path=/trunk/; revision=6865
2008-04-21 02:40:40 +00:00
Matthias Clasen
9fd295d285 Rework the timestamp checking code to protect against duplicate
2008-04-16  Matthias Clasen  <mclasen@redhat.com>

        * xdgmime/xdgmime.c: Rework the timestamp checking code
        to protect against duplicate directories in XDG_DATA_DIRS.
        Fixes fd.o bug 12513, reported by Joe Shaw.



svn path=/trunk/; revision=6859
2008-04-16 21:55:32 +00:00
Matthias Clasen
07ad3555ed Partically revert the last commit after realizing that
2008-04-16  Matthias Clasen  <mclasen@redhat.com>

        Partically revert the last commit after realizing that
        xdg_mime_media_type_equal doesn't have to init at all.

        * xdgmime/xdgmime.h:
        * xdgmime/xdgmime.c: Get rid of _xdg_mime_media_type_equal

        * xdgmime/xdgmimecache.c: Use xdg_mime_media_type_equal

svn path=/trunk/; revision=6857
2008-04-16 17:13:19 +00:00
Matthias Clasen
101521f6e4 Avoid possible memory corruption in xdgmime, fd.o bug 12512, reported by
2008-04-16  Matthias Clasen  <mclasen@redhat.com>

        Avoid possible memory corruption in xdgmime, fd.o bug 12512,
        reported by Joe Shaw and Federico Mena Quintero.

        * xdgmime/xdgmime.c(_xdg_mime_media_type_equal): Implement.
        (xdg_mime_media_type_equal): Turn into a wrapper around the
        _-prefixed version.

        * xdgmime/xdgmimecache.c: Use the _-prefixed versions of comparison
        functions throughout.


svn path=/trunk/; revision=6854
2008-04-16 16:54:44 +00:00
Michael Meeks
8e964bf99a tolerate an empty TryExec= line without failing; nautilus used to create
2008-04-16  Michael Meeks  <michael.meeks@novell.com>

        * gdesktopappinfo.c (g_desktop_app_info_new_from_filename): 
        tolerate an empty TryExec= line without failing; nautilus used
        to create launchers with these in previous versions. Fixes #528433


svn path=/trunk/; revision=6853
2008-04-16 16:48:23 +00:00
Mukund Sivaraman
414075c64c Fixed typos in gtk-doc comments.
2008-04-15  Mukund Sivaraman  <muks@mukund.org>

        * gio/gfile.c: Fixed typos in gtk-doc comments.


svn path=/trunk/; revision=6850
2008-04-15 14:32:58 +00:00
Padraig O'Briain
105dc15a03 In g_app_info_create_from_commandline set comment after name. Fixes
2008-04-09  Padraig O'Briain  <padraig.obriain@sun.com>

	* gdesktopappinfo.c: In g_app_info_create_from_commandline set comment
	after name. Fixes #527132.


svn path=/trunk/; revision=6844
2008-04-09 14:53:05 +00:00
Tomas Bzatek
4bf8977b89 Doc update
2008-04-08  Tomas Bzatek  <tbzatek@redhat.com> 

        * gfile.c: (g_file_replace):
        Doc update


svn path=/trunk/; revision=6841
2008-04-08 15:56:42 +00:00
Matthias Clasen
f0ba12f19f Bug 526796 – Wrong order of arguments in g_file_copy's fallback
* gfile.c (file_copy_fallback): Fix the argument order. Patch
        by Christian Kellner.

svn path=/trunk/; revision=6830
2008-04-08 01:59:47 +00:00
Sebastien Bacher
087bf32df3 Don't list the user directory as a mount, fix potential issue when other
2008-04-04  Sebastien Bacher  <seb128@ubuntu.com>

	* gunixmounts.c: (g_unix_mount_guess_should_display):
	Don't list the user directory as a mount, fix potential issue
	when other users have a similar naming and don't special case the
	gvfs mounts there since that's not required (#525866)


svn path=/trunk/; revision=6825
2008-04-04 07:37:34 +00:00
Alexander Larsson
fe68fc7496 Don't leak parent.
2008-03-31  Alexander Larsson  <alexl@redhat.com>

	* glocalfile.c (get_parent):
	Don't leak parent.
	


svn path=/trunk/; revision=6801
2008-03-31 20:04:24 +00:00
A. Walton
5d17169953 Always return a GFileType enum value (#520715).
2008-03-31  A. Walton  <awalton@svn.gnome.org>

	* gfile.c (g_file_query_file_type):
	Always return a GFileType enum value (#520715).


svn path=/trunk/; revision=6799
2008-03-31 19:32:58 +00:00
Alexander Larsson
a2609fc3f1 Fix typo in changelog
svn path=/trunk/; revision=6797
2008-03-31 19:21:19 +00:00
Alexander Larsson
f90af78bd6 Read readdir() info chunks (of 1000) and sort the chunks by inode before
2008-03-31  Alexander Larsson  <alexl@redhat.com>

        * glocalfileenumerator.c:
	Read readdir() info chunks (of 1000) and sort
	the chunks by inode before stat:ing.
	This is a 20% performance increase in testing
	gvfs-ls on /usr/bin with cold cache.


svn path=/trunk/; revision=6796
2008-03-31 19:18:46 +00:00
Alexander Larsson
befae6688e Clarify docs for g_memory_output_stream_get_size. Add
2008-03-31  Alexander Larsson  <alexl@redhat.com>

        * gmemoryoutputstream.c:
	Clarify docs for g_memory_output_stream_get_size.
	Add g_memory_output_stream_get_data_size.



svn path=/trunk/; revision=6792
2008-03-31 13:49:46 +00:00
Matthias Clasen
a07b747200 Add g_file_query_file_type convenience function to query the type of a
2008-03-30  Matthias Clasen  <mclasen@redhat.com>

        * gio.symbols:
        * gfile.c:
        * gfile.h: Add g_file_query_file_type convenience function
        to query the type of a file.  (#520715, Mikkel Kamstrup Erlandsen)



svn path=/trunk/; revision=6784
2008-03-31 04:46:22 +00:00
Matthias Clasen
a4a5f33f47 Fix some documentation typos. (#524950, Rob Bradford)
2008-03-30  Matthias Clasen  <mclasen@redhat.com>

        * gfileenumerator.c:
        * gfile.c: Fix some documentation typos.  (#524950, Rob Bradford)



svn path=/trunk/; revision=6773
2008-03-31 03:30:48 +00:00
A. Walton
096201834d Adds GIO_EXTRA_MODULES environment variable support, closing bug #523039.
2008-03-28  A. Walton  <awalton@svn.gnome.org>

	* giomodule.c (_g_io_modules_ensure_loaded):
	Adds GIO_EXTRA_MODULES environment variable support, closing bug 
	#523039.


svn path=/trunk/; revision=6768
2008-03-28 14:31:09 +00:00
Alexander Larsson
4824b7dbb0 Fix up last commit.
2008-03-28  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
        (copy_stream_with_progress):
	Fix up last commit.
	


svn path=/trunk/; revision=6766
2008-03-28 13:57:29 +00:00
Alexander Larsson
baa973e54c Fix ChangeLog entry
svn path=/trunk/; revision=6765
2008-03-28 12:44:37 +00:00
Alexander Larsson
941513cdca Fallback to g_file_query_info for source size if
2008-03-28  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
        (copy_stream_with_progress):
        (file_copy_fallback):
	Fallback to g_file_query_info for source size
	if g_file_input_stream_query_info fails. (#524579)


svn path=/trunk/; revision=6763
2008-03-28 12:43:11 +00:00
Alexander Larsson
b4e4bbd594 Reuse old string instead of adding new one.
2008-03-28  Alexander Larsson  <alexl@redhat.com>

	* glocalfile.c (g_local_file_move):
	Reuse old string instead of adding new one.



svn path=/trunk/; revision=6762
2008-03-28 11:44:04 +00:00
Lin Ma
778488d993 still copyright issue. I hate copyright.
2008-03-28  Lin Ma  <Lin.Ma@Sun.COM>

	* fen/*.[hc]: still copyright issue. I hate copyright.



svn path=/trunk/; revision=6760
2008-03-28 09:30:52 +00:00
Alexander Larsson
9dfce3a26a Return G_IO_ERROR_IS_DIRECTORY, not G_IO_ERROR_WOULD_MERGE when moving
2008-03-27  Alexander Larsson  <alexl@redhat.com>

	* glocalfile.c (g_local_file_move):
	Return G_IO_ERROR_IS_DIRECTORY, not G_IO_ERROR_WOULD_MERGE when moving
	file over directory. This is according to the docs and what the move via
	copy+remove fallback does.



svn path=/trunk/; revision=6758
2008-03-27 20:13:00 +00:00
Lin Ma
d7d4211cb0 Updated copyright.
2008-03-27  Lin Ma  <Lin.Ma@Sun.COM>

	* fen/*.[hc]: Updated copyright.


svn path=/trunk/; revision=6757
2008-03-27 09:14:54 +00:00
Lin Ma
6aae6cc13e Removed a bad formatted msg.
2008-03-20  Lin Ma  <Lin.Ma@Sun.COM>

	* fen/fen-data.c: (fdata_adjust_changed): Removed a bad formatted msg.


svn path=/trunk/; revision=6744
2008-03-20 09:49:41 +00:00
Lin Ma
50556ee0a5 Fixed FEN does not emit attribute changed events when optimizing changed
2008-03-20  Lin Ma  <Lin.Ma@Sun.COM>

        * fen/fen-data.c: (process_events), (fdata_add_event): Fixed FEN does
        not emit attribute changed events when optimizing changed events.
        * fen/fen-helper.c, fen/fen-kernel.c: Added ifdef to default disable
	warning messages.


svn path=/trunk/; revision=6743
2008-03-20 09:40:28 +00:00
Matthias Clasen
43db4fb1dd Doc additions
svn path=/trunk/; revision=6740
2008-03-19 20:54:49 +00:00
Sebastien Bacher
864b0d690e consider nfs4 mounts as G_UNIX_MOUNT_TYPE_NFS (Closes: #523338)
2008-03-19  Sebastien Bacher  <seb128@ubuntu.com>

	* gunixmounts.c: (guess_mount_type): 
	consider nfs4 mounts as G_UNIX_MOUNT_TYPE_NFS (Closes: #523338)

svn path=/trunk/; revision=6737
2008-03-19 14:07:00 +00:00
Alexander Larsson
53f36510be Bump block side for copy to 64k to minimize overhead for low latency
2008-03-19  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
        (copy_stream_with_progress):
	Bump block side for copy to 64k to minimize
	overhead for low latency links. (#523015)



svn path=/trunk/; revision=6735
2008-03-19 12:16:20 +00:00
Tor Lillqvist
ff69c53da9 Make libgio-2.0.la depend on gio.def on Windows.
2008-03-16  Tor Lillqvist  <tml@novell.com>

	* Makefile.am (libgio_2_0_la_DEPENDENCIES): Make libgio-2.0.la
	depend on gio.def on Windows.


svn path=/trunk/; revision=6721
2008-03-16 09:30:21 +00:00
David Zeuthen
51d7fc9e96 Add g_unix_mount_monitor_set_rate_limit() function (#521946)
2008-03-12  David Zeuthen  <davidz@redhat.com>

	* gio.symbols:
	* gunixmounts.[ch]:
	Add g_unix_mount_monitor_set_rate_limit() function (#521946)



svn path=/trunk/; revision=6711
2008-03-14 11:18:59 +00:00
Alexander Larsson
240ba02786 Avoid redudant tests (#521851) Patch from Josselin Mouette
2008-03-14  Alexander Larsson  <alexl@redhat.com>

        * gunixmounts.c:
        (guess_mount_type):
	Avoid redudant tests (#521851)
	Patch from Josselin Mouette


svn path=/trunk/; revision=6710
2008-03-14 11:15:49 +00:00
Alexander Larsson
6088f22d26 Fix C89 issue (#521672) Patch from Jens Granseuer
2008-03-14  Alexander Larsson  <alexl@redhat.com>

        * gfilemonitor.c:
        (g_file_monitor_is_cancelled):
	Fix C89 issue (#521672)
	Patch from Jens Granseuer


svn path=/trunk/; revision=6708
2008-03-14 11:06:01 +00:00
Alexander Larsson
6fc66109a0 Shut down fam (including removing fam GSource) when module is unloaded
2008-03-14  Alexander Larsson  <alexl@redhat.com>

        * fam/fam-helper.[ch]:
        * fam/fam-module.c:
	Shut down fam (including removing fam GSource) when
	module is unloaded (#521513)
	Patch from Joe Marcus Clarke   


svn path=/trunk/; revision=6706
2008-03-14 11:02:42 +00:00
Alexander Larsson
9555a3a2ca Fix up FEN ifdefs
2008-03-14  Alexander Larsson  <alexl@redhat.com>

        * giomodule.c:
        (_g_io_modules_ensure_loaded):
	Fix up FEN ifdefs


svn path=/trunk/; revision=6705
2008-03-14 09:45:44 +00:00
Alexander Larsson
7437486b36 Use right define name for f_fstypename member check
2008-03-14  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        (g_local_file_query_filesystem_info):
	Use right define name for f_fstypename member check

2008-03-14  Alexander Larsson  <alexl@redhat.com>

        * configure.in:
	Add required includes for f_fstypename member check.
	

svn path=/trunk/; revision=6703
2008-03-14 09:19:09 +00:00
Alexander Larsson
7dc75d707c Added. Added. Added. Added. Added. Added. Added. Added. Added. Added.
2008-03-14  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * fen/Makefile.am: Added.
        * fen/fen-data.[ch]: Added.
        * fen/fen-dump.[ch]: Added.
        * fen/fen-helper.[ch]: Added.
        * fen/fen-kernel.[ch]: Added.
        * fen/fen-missing.[ch]: Added.
        * fen/fen-node.[ch]: Added.
        * fen/fen-sub.[ch]: Added.
        * fen/gfendirectorymonitor.[ch]: Added.
        * fen/gfenfilemonitor.[ch]: Added.
        * giomodule.c:
	Added Solaris FEN file notification backend.
	Patch from Lin Ma <Lin.Ma@Sun.COM>


svn path=/trunk/; revision=6702
2008-03-14 08:58:24 +00:00
Tor Lillqvist
b6c74b8739 Actually use the gio.def file when linking the library on Windows. Produce
2008-03-13  Tor Lillqvist  <tml@novell.com>

	* Makefile.am: Actually use the gio.def file when linking the
	library on Windows. Produce .lib library for Microsoft's toolchain
	when possible. Install the .lib and .def file like for the other
	libraries of GLib.


svn path=/trunk/; revision=6700
2008-03-13 17:10:04 +00:00
Tomas Bzatek
15e21178c6 Include live-g-file in standard set of tests, making a temporary directory
2008-03-13  Tomas Bzatek  <tbzatek@redhat.com>

        * tests/live-g-file.c:
        Include live-g-file in standard set of tests, making a temporary
        directory in source structure.

        Clean target directory before the tests (write mode only)


svn path=/trunk/; revision=6699
2008-03-13 16:32:31 +00:00
Tor Lillqvist
367d77233b Expand gio/win32/Makefile.
2008-03-12  Tor Lillqvist  <tml@novell.com>

	* configure.in: Expand gio/win32/Makefile.

2008-03-12  Tor Lillqvist  <tml@novell.com>

	Bug 517419 - gio win32 directory monitor
	Implementation by Vlad Grecescu.
	
	* win32/Makefile.am
	* win32/gwin32directorymonitor.h
	* win32/gwin32directorymonitor.c: New files.

	* giomodule.c: Set up the GWin32DirectoryMonitor plumbing.

	* Makefile.am: Add the win32 subdirectory.


svn path=/trunk/; revision=6698
2008-03-12 19:09:11 +00:00
Tor Lillqvist
1c6676396d Introduce a macro GLocalFileStat that is the normal struct stat on Unix
2008-03-12  Tor Lillqvist  <tml@novell.com>

	* glocalfileinfo.h: Introduce a macro GLocalFileStat that is the
	normal struct stat on Unix but struct _stati64 on Windows to have
	access to 64-bit file size information. Use that instead of struct
	stat in the functions declared here in this private header.

	* glocalfileinfo.c: Corresponding changes. Move some G_OS_WIN32,
	S_ISLNK and HAVE_UTIMES ifdefs and add some more to avoid compiler
	warnings about unused functions and variables. Don't set
	meaningless attributes like inode numbers on Windows.


svn path=/trunk/; revision=6697
2008-03-12 18:33:59 +00:00
Benjamin Otte
f2e20e5b2c trim whitespace so gtk-doc groks the function name
2008-03-12  Benjamin Otte  <otte@gnome.org>

	* gvfs.h:
	trim whitespace so gtk-doc groks the function name


svn path=/trunk/; revision=6695
2008-03-12 16:45:43 +00:00
Tor Lillqvist
5fe2e21960 Implement as empty, returning FALSE, on Win32.
2008-03-12  Tor Lillqvist  <tml@novell.com>

	* glocalfile.c (_g_local_file_has_trash_dir): Implement as empty,
	returning FALSE, on Win32.


svn path=/trunk/; revision=6689
2008-03-12 13:16:54 +00:00
Alexander Larsson
c5a10d2650 Correctly implement can_trash by actually looking for a trash dir, not
2008-03-11  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        * glocalfileinfo.[ch]:
	Correctly implement can_trash by actually
	looking for a trash dir, not just assuming
	one exists.


svn path=/trunk/; revision=6679
2008-03-11 14:48:28 +00:00
Matthias Clasen
7cff233d6e 2.16.1
svn path=/trunk/; revision=6671
2008-03-11 02:18:18 +00:00
Alexander Larsson
fd2e57c644 Fix crashes in new constructor and properties code
2008-03-11  Alexander Larsson  <alexl@redhat.com>

        * gthemedicon.c:
	Fix crashes in new constructor and properties code


svn path=/trunk/; revision=6666
2008-03-11 00:14:11 +00:00
Murray Cumming
1d77c0c7dd Minor spelling correction in documentation: existance -> existence.
2008-03-10  Murray Cumming  <murrayc@murrayc.com>

* gfile.c: Minor spelling correction in documentation:
existance -> existence.

svn path=/trunk/; revision=6663
2008-03-10 19:38:42 +00:00
Matthias Clasen
e2a4ed3287 2.16.0
svn path=/trunk/; revision=6661
2008-03-10 18:09:06 +00:00
Matthias Clasen
497387c5f3 Fix symbol list
svn path=/trunk/; revision=6659
2008-03-10 17:10:37 +00:00
Matthias Clasen
83ba7b5fba Add properties to make bindings happy. (#517676, Samuel Cormier-Iijima)
2008-03-10  Matthias Clasen <mclasen@redhat.com>

        * gthemedicon.c: Add properties to make bindings happy.  (#517676,
        Samuel Cormier-Iijima)


svn path=/trunk/; revision=6655
2008-03-10 16:08:41 +00:00
Tor Lillqvist
93bd705e78 Define FILE_READ_ONLY_VOLUME if it is missing from winnt.h. (#521145)
2008-03-08  Tor Lillqvist  <tml@novell.com>

	* glocalfile.c: Define FILE_READ_ONLY_VOLUME if it is missing from
	winnt.h. (#521145)


svn path=/trunk/; revision=6643
2008-03-08 16:06:00 +00:00
Alexander Larsson
3cacbe8178 Use struct statfs.f_fstypename if availible (e.g. on OpenBSD) Patch from
2008-03-07  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        (g_local_file_query_filesystem_info):
	Use struct statfs.f_fstypename if availible (e.g. on OpenBSD)
	Patch from Jasper Lievisse Adriaanse


svn path=/trunk/; revision=6638
2008-03-07 14:36:15 +00:00
Tor Lillqvist
7332eed6ff Correct milliseconds to microseconds in the doc comments for the *_USEC
2008-03-06  Tor Lillqvist  <tml@novell.com>

	* gfileinfo.h: Correct milliseconds to microseconds in the doc
	comments for the *_USEC attributes.


svn path=/trunk/; revision=6634
2008-03-06 13:10:06 +00:00
Alexander Larsson
79ad411eb5 Add g_return_val_if_fail check (#520700)
2008-03-06  Alexander Larsson  <alexl@redhat.com>

	* gfile.c (g_file_query_exists):
	Add g_return_val_if_fail check (#520700)


svn path=/trunk/; revision=6633
2008-03-06 10:04:24 +00:00
Alexander Larsson
5241d96b21 Fix sparse warnings (#519489)
2008-03-06  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
        * gfilemonitor.c:
        * gthemedicon.c:
        * gunionvolumemonitor.c:
        * gunixmounts.c:
        * tests/g-file.c:
        * tests/live-g-file.c:
        * xdgmime/xdgmimecache.c:
	Fix sparse warnings (#519489)


svn path=/trunk/; revision=6632
2008-03-06 09:53:35 +00:00
Alexander Larsson
602295158f Make cancellation threadsafe (i.e. guarantee its only done once, and
2008-03-05  Alexander Larsson  <alexl@redhat.com>

        * gfilemonitor.c:
	Make cancellation threadsafe (i.e.
	guarantee its only done once, and always
	done)
	
        * glocaldirectorymonitor.c:
	Make sure we the monitor lives while the
	mounts_changed callback is being called (#520484)


svn path=/trunk/; revision=6630
2008-03-05 11:50:27 +00:00
Wouter Bolsterlee
1d1ffab20d Fix typo in parameter documentation.
2008-03-04  Wouter Bolsterlee  <wbolster@svn.gnome.org>

	* gio/gbufferedinputstream.c: Fix typo in parameter
	documentation.

svn path=/trunk/; revision=6622
2008-03-04 15:21:31 +00:00
Alexander Larsson
cb3a49ca15 Remove deprecated symbols we kept for one release.
2008-03-04  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
	Remove deprecated symbols we kept for one release.

2008-03-04  Alexander Larsson  <alexl@redhat.com>

        * glib/gurifuncs.c:
	Remove deprecated symbols we kept for one release.
	

svn path=/trunk/; revision=6621
2008-03-04 14:51:34 +00:00
Murray Cumming
d9c036f06a Tiny documentation corrections.
2008-03-04  Murray Cumming  <murrayc@murrayc.com>

* ginputstream.c:
* goutputstream.c: Tiny documentation corrections.

svn path=/trunk/; revision=6620
2008-03-04 13:15:57 +00:00
Alexander Larsson
0cb86e3b8f Fix the adopt_orphan_mount vfunc to take a volume_monitor reference in an
2008-03-03  Alexander Larsson  <alexl@redhat.com>

        * gunionvolumemonitor.c:
        * gvolumemonitor.h:
	Fix the adopt_orphan_mount vfunc to take a
	volume_monitor reference in an ABI compat way.
	This change is not API compat, but the added
	arg is not used in the only user of this vfunc, so
	all we get is a harmless warning in gvfs (#520169)


svn path=/trunk/; revision=6618
2008-03-03 21:38:30 +00:00
Benjamin Otte
892a4d5b14 clarify docs for g_file_delete().
2008-03-01  Benjamin Otte  <otte@gnome.org>

	* gfile.c:
	clarify docs for g_file_delete().


svn path=/trunk/; revision=6608
2008-03-01 14:52:03 +00:00
Alexander Larsson
08c743202a Make sure empty files get text/plain type (#518720)
2008-02-29  Alexander Larsson  <alexl@redhat.com>

        * glocalfileinfo.c:
        (get_content_type):
	Make sure empty files get text/plain type (#518720)


svn path=/trunk/; revision=6605
2008-02-29 09:49:08 +00:00
Alexander Larsson
82046b6c97 Fix type warnings
2008-02-27  Alexander Larsson  <alexl@redhat.com>

        * gcontenttype.c:
	Fix type warnings
	
        * gunixvolume.c:
        (g_unix_volume_mount):
	Add missing GMountMountFlags argument


svn path=/trunk/; revision=6599
2008-02-27 11:23:35 +00:00
Alexander Larsson
f0e54fd328 Handle filesystems (like ntfs-3g) that return EEXIST instead of ENOTEMPTY
2008-02-26  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        (g_local_file_delete):
	Handle filesystems (like ntfs-3g) that return EEXIST instead
	of ENOTEMPTY (#518816)


svn path=/trunk/; revision=6598
2008-02-27 11:16:58 +00:00
Matthias Clasen
36de18e662 2.15.6
svn path=/trunk/; revision=6593
2008-02-25 19:32:42 +00:00
Wouter Bolsterlee
8b294f1f9d Fixup translator comments (#518578).
2008-02-25  Wouter Bolsterlee  <wbolster@svn.gnome.org>

	* gfile.c (g_file_find_enclosing_mount):
	* ginputstream.c (g_input_stream_set_pending):
	* glocalfile.c (g_local_file_find_enclosing_mount):
	* gmount.c (g_mount_unmount), (g_mount_eject), (g_mount_remount):
	* goutputstream.c (g_output_stream_set_pending):

	Fixup translator comments (#518578).

svn path=/trunk/; revision=6591
2008-02-25 14:31:19 +00:00
Wouter Bolsterlee
a9a0498007 Fix a few typos in translator comments and documentation.
2008-02-25  Wouter Bolsterlee  <wbolster@svn.gnome.org>

	* gfile.c (g_file_find_enclosing_mount):
	* giomodule.c:
	* glocalfile.c (g_local_file_find_enclosing_mount):
	* goutputstream.c:

	Fix a few typos in translator comments and documentation.

svn path=/trunk/; revision=6590
2008-02-25 14:04:38 +00:00
Alexander Larsson
9edb46455c Add translator comments (#518578)
2008-02-25  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
        * ginputstream.c:
        * glocalfile.c:
        * gmount.c:
        * goutputstream.c:
	Add translator comments (#518578)


svn path=/trunk/; revision=6589
2008-02-25 13:47:00 +00:00
Alexander Larsson
d8cd546812 Reintroduce g_file_contains_file, keep around for one unstable release
2008-02-25  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:	
        Reintroduce g_file_contains_file, keep around for one
	unstable release cycle to avoid crashing to many apps.
	Make sure to delete after release.


svn path=/trunk/; revision=6586
2008-02-25 13:24:56 +00:00
Alexander Larsson
5d1de3eed1 Remove deprecated g_file_contains_file.
2008-02-25  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
	Remove deprecated g_file_contains_file.


svn path=/trunk/; revision=6585
2008-02-25 13:19:58 +00:00
Alexander Larsson
ea678ee94c Emit actual change signals in an idle handler. This avoids reentrance and
2008-02-25  Alexander Larsson  <alexl@redhat.com>

        * gfilemonitor.c:
	Emit actual change signals in an idle handler.
	This avoids reentrance and locking problems in
	the file notification backends.


svn path=/trunk/; revision=6584
2008-02-25 12:34:30 +00:00
Alexander Larsson
4a1cf45793 Remove type guessing, instead just display mounts in /media and in ~/.
2008-02-25  Alexander Larsson  <alexl@redhat.com>

        * gunixmounts.c:
        (g_unix_mount_guess_should_display):
	Remove type guessing, instead just display
	mounts in /media and in ~/.


svn path=/trunk/; revision=6582
2008-02-25 11:15:06 +00:00
Alexander Larsson
493cbfa607 Make new strings reuse old ones.
2008-02-25  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
	Make new strings reuse old ones.


svn path=/trunk/; revision=6581
2008-02-25 09:11:09 +00:00
Alexander Larsson
1d568f35d1 Implement trashing and filesystem::readonly for win32 (#517235) Patch from
2008-02-25  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
	Implement trashing and filesystem::readonly for win32 (#517235)
	Patch from Yevgen Muntyan


svn path=/trunk/; revision=6578
2008-02-25 08:15:35 +00:00
Matthias Clasen
cd2bfb722e Add new symbols
svn path=/trunk/; revision=6565
2008-02-23 06:34:41 +00:00
Matthias Clasen
f8336c3fa8 Small doc fix
svn path=/trunk/; revision=6560
2008-02-23 05:05:39 +00:00
Alexander Larsson
5f6ccf9a3f Look at old-style gnome mime icon names too, as many have not moved to the
2008-02-22  Alexander Larsson  <alexl@redhat.com>

	* gcontenttype.c (g_content_type_get_icon):
	Look at old-style gnome mime icon names too, as many
	have not moved to the new style.


svn path=/trunk/; revision=6557
2008-02-22 14:56:50 +00:00
Matthias Clasen
f3144c7efe Doc fixes
svn path=/trunk/; revision=6554
2008-02-21 18:20:17 +00:00
David Zeuthen
bfda430eff Implement this function by moving bits from glocalfileinfo.c
2008-02-21  David Zeuthen  <davidz@redhat.com>

	* glocalfileinfo.c: (_g_local_file_info_get):
	* gcontenttype.c:
	(g_content_type_get_icon): Implement this function by
	moving bits from glocalfileinfo.c
	(g_content_type_get_description): Unalias before getting
	description (#517687)

	* gfile.c: (g_file_class_init),
	(g_file_query_filesystem_info_async),
	(g_file_query_filesystem_info_finish),
	(query_filesystem_info_data_free),
	(query_filesystem_info_async_thread),
	(g_file_real_query_filesystem_info_async),
	(g_file_real_query_filesystem_info_finish):
	* gfile.h: Implement async version of
	g_file_query_filesystem_info()

	* gfileinfo.h: Add new attributes for filesystem::use-preview

	* gio.symbols: Update

	* gthemedicon.c: (g_themed_icon_append_name):
	* gthemedicon.h: Add new new convenience function.

	* gunionvolumemonitor.c: (g_union_volume_monitor_dispose),
	(get_mounts), (get_volumes), (get_connected_drives),
	(get_volume_for_uuid), (get_mount_for_uuid),
	(g_union_volume_monitor_init), (populate_union_monitor),
	(g_volume_monitor_get), (_g_mount_get_for_mount_path),
	(g_volume_monitor_adopt_orphan_mount):
	* gvolumemonitor.c:
	* gvolumemonitor.h: Use recursive locks so it's safe for volume
	monitor implementations to call into the main volume monitor. Also
	separate object initialization and volume monitor initialization
	such that non-native volume monitors can properly adopt their
	mounts away.


svn path=/trunk/; revision=6550
2008-02-21 12:35:05 +00:00
Alexander Larsson
bed0b36546 Fix doc typo
2008-02-21  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
	Fix doc typo


svn path=/trunk/; revision=6549
2008-02-21 11:44:48 +00:00
Alexander Larsson
db2615807c Fix doc typo
2008-02-21  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
	Fix doc typo


svn path=/trunk/; revision=6548
2008-02-21 11:43:55 +00:00
Alexander Larsson
4fb597e5f9 Add more documentation about how GFiles work (from #517086)
2008-02-21  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
	Add more documentation about how GFiles work (from #517086)


svn path=/trunk/; revision=6547
2008-02-21 10:21:11 +00:00
Alexander Larsson
6dc9b7ee00 Add new g_file_has_prefix that does the same as g_file_contains_file.
2008-02-21  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        * gio.symbols:
	Add new g_file_has_prefix that does the same as g_file_contains_file.
	Deprecate g_file_contains_file and add a macro that converts
	it to g_file_has_prefix.
	The reason for this change is that the contains_file() name seems to
	imply that this does more work than what it does, but its really only
	a name match (from #517086)
	
        * gdummyfile.c:
        * glocalfile.c:
        * tests/g-file.c:
	Update to match the above change.


svn path=/trunk/; revision=6546
2008-02-21 09:09:59 +00:00
Benjamin Otte
03c51e95a7 even more cases of not returning in error path
2008-02-20  Benjamin Otte  <otte@gnome.org>

	* gfile.c: (g_file_mount_mountable), (g_file_unmount_mountable),
	(g_file_eject_mountable):
	even more cases of not returning in error path


svn path=/trunk/; revision=6545
2008-02-20 18:52:10 +00:00
Benjamin Otte
ea6cf346d6 return from function in error path.
2008-02-20  Benjamin Otte  <otte@gnome.org>

        * gfile.c: (g_file_mount_mountable):
	return from function in error path.

svn path=/trunk/; revision=6544
2008-02-20 18:45:18 +00:00
Sylvain Pasche
add0a2f496 Remove trailing coma in GMountMountFlags struct
2008-02-18  Sylvain Pasche <sylvain.pasche@gmail.com>

        * gfile.h:
	 Remove trailing coma in GMountMountFlags struct


svn path=/trunk/; revision=6536
2008-02-19 08:49:16 +00:00
Alexander Larsson
3b1b6a9722 Use g_unlink/g_rename instead of unlink/rename; do not pass raw filenames
2008-02-18  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        * glocalfileinfo.c:
        * glocalfileoutputstream.c:
	Use g_unlink/g_rename instead of unlink/rename;
	do not pass raw filenames to g_set_error. (#517239)
	Patch from Yevgen Muntyan.


svn path=/trunk/; revision=6533
2008-02-18 15:35:16 +00:00
Alexander Larsson
b221d1b36d Open files with O_BINARY on windows. (#517140)
2008-02-18  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        * glocalfileoutputstream.c:
	Open files with O_BINARY on windows. (#517140)


svn path=/trunk/; revision=6531
2008-02-18 10:10:58 +00:00
Alexander Larsson
66ca14e807 Correctly check for HAVE_FCHMOD and HAVE_FCHOWN
2008-02-14  Alexander Larsson  <alexl@redhat.com>

        * glocalfileoutputstream.c:
	Correctly check for HAVE_FCHMOD and HAVE_FCHOWN



svn path=/trunk/; revision=6518
2008-02-14 16:47:56 +00:00
Alexander Larsson
8a9c5b6d3c Copy permissions with file on copy (#514084) This is what cp does and
2008-02-14  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
	Copy permissions with file on copy (#514084)
	This is what cp does and makes sure e.g. the
	exec permissions are kept.
	Its kinda weird in that it keeps the permission bits
	the same while the uid and gid are different. However
	the new uid is the user so its not a security issue,
	and I've heard no complaints about cp on this issue.



svn path=/trunk/; revision=6514
2008-02-14 11:00:09 +00:00
Ryan Lortie
8cb3db68f0 add G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT
2008-02-13  Ryan Lortie  <desrt@desrt.ca>

        * docs/reference/gio/gio-sections.txt: add
        G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT

2008-02-13  Ryan Lortie  <desrt@desrt.ca>

        * gfileinfo.h: add G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT


svn path=/trunk/; revision=6511
2008-02-13 20:27:18 +00:00
Alexander Larsson
ab7e80d366 Define IN_ONLYDIR if not in header (#515346)
2008-02-13  Alexander Larsson  <alexl@redhat.com>

	* inotify/inotify-path.c:
	Define IN_ONLYDIR if not in header (#515346)



svn path=/trunk/; revision=6510
2008-02-13 13:33:57 +00:00
Alexander Larsson
767e18bf82 C89 fixes (#515892)
2008-02-12  Alexander Larsson  <alexl@redhat.com>

        * tests/live-g-file.c:
	C89 fixes (#515892)



svn path=/trunk/; revision=6506
2008-02-12 10:06:01 +00:00
Matthias Clasen
69cb5eda41 2.15.5
svn path=/trunk/; revision=6503
2008-02-11 22:30:35 +00:00
Matthias Clasen
ee263a1ba6 Add g_mount_mount_flags_get_type
svn path=/trunk/; revision=6501
2008-02-11 18:31:43 +00:00
Alexander Larsson
be85960df7 Correctly handle NULL GAttributeMatcher meaning matches nothing. (Fixes
2008-02-11  Alexander Larsson  <alexl@redhat.com>

        * gfileinfo.c:
        (g_file_info_set_attribute_mask):
        (g_file_attribute_matcher_matches_id):
	Correctly handle NULL GAttributeMatcher meaning
	matches nothing. (Fixes #513492)


svn path=/trunk/; revision=6498
2008-02-11 12:21:49 +00:00
Alexander Larsson
e3fdcd1fa7 Added GMountMountFlags enum and added a flags argument to all mount calls.
2008-02-11  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        * gmount.[ch]:
        * gvolume.[ch]:
	Added GMountMountFlags enum and added a flags
	argument to all mount calls.
	
	This is an API/ABI change for future extensibility,
	as I think we will need at least an
	inhibit-autorun flag (the panel needs this).
	There are no flags defined yet though.


svn path=/trunk/; revision=6497
2008-02-11 11:12:36 +00:00
Alexander Larsson
52e49aee35 Added new standard::description attribute. Requested by Vincent, and
2008-02-11  Alexander Larsson  <alexl@redhat.com>

	* gfileinfo.h:
	Added new standard::description attribute.
	Requested by Vincent, and useful for both
	panel and nautilus


svn path=/trunk/; revision=6496
2008-02-11 10:41:00 +00:00
Alexander Larsson
d07d500f0a Minor docs cleanup
2008-02-11  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
	Minor docs cleanup


svn path=/trunk/; revision=6495
2008-02-11 08:47:17 +00:00
Matthias Clasen
c8f43a1bb6 Add more docs
svn path=/trunk/; revision=6493
2008-02-11 07:17:48 +00:00
Matthias Clasen
826d8c5b41 Documentation additions
svn path=/trunk/; revision=6492
2008-02-11 07:12:56 +00:00
Matthias Clasen
0766a1ec39 Consistently use getmntent_r() and fall back to getmntent(). (#515492)
2008-02-09  Matthias Clasen <mclasen@redhat.com>

        * gunixmounts.c: Consistently use getmntent_r() and fall
        back to getmntent().  (#515492)



svn path=/trunk/; revision=6490
2008-02-10 05:20:00 +00:00
Matthias Clasen
8ad07dcf1c Fix a mismerge
svn path=/trunk/; revision=6489
2008-02-10 04:54:25 +00:00
Matthias Clasen
da0e7e81c1 /bin/ksh can't handle a for-loop with no arguments, so add a "." for when
2008-02-09  Matthias Clasen <mclasen@redhat.com>

        * Makefile.decl: /bin/ksh can't handle a for-loop with no
        arguments, so add a "." for when $(SUBDIRS) is empty.

        * glib/tests/option-context.c:
        * glib/tests/testing.c:
        * gthread/gthread-posix.c:
        * tets/testingbase64.c:
        * glib/gtester.c:
        * glib/gsequence.c: Portability fixes.  (#515154)



svn path=/trunk/; revision=6487
2008-02-10 04:41:25 +00:00
Alexander Larsson
61411a5fc2 Add g_volume_should_automount. Docs needed.
2008-02-08  Alexander Larsson  <alexl@redhat.com>

	* gio.symbols: 
        * gunixvolume.c:
        * gvolume.[ch]:
        Add g_volume_should_automount.
	Docs needed.


svn path=/trunk/; revision=6484
2008-02-08 16:12:55 +00:00
Tor Lillqvist
7077781cc3 live-g-file won't build on Windows, too Unix-specific.
2008-02-07  Tor Lillqvist  <tml@novell.com>

	* tests/Makefile.am (TEST_PROGS): live-g-file won't build on
	Windows, too Unix-specific.


svn path=/trunk/; revision=6478
2008-02-07 09:56:25 +00:00
Behdad Esfahbod
1096caf5ef Skip g_bit_*(). Inline functions may end up with a local plt if the
2008-02-06  Behdad Esfahbod  <behdad@gnome.org>

        * pltcheck.sh: Skip g_bit_*().  Inline functions may end up with
        a local plt if the compiler doesn't support what we want.  Bug #514702


svn path=/trunk/; revision=6469
2008-02-06 17:36:06 +00:00
Murray Cumming
0d7b605f06 Fixed some minor typos in documentation.
2008-02-06  Murray Cumming  <murrayc@murrayc.com>

* glib/gconvert.c:
* glib/pcre/pcre_internal.h: Fixed some minor typos in documentation.

svn path=/trunk/; revision=6467
2008-02-06 16:02:20 +00:00
Christian Persch
37ac644bd1 Save errno before calling other funcs that potentially alter it. Bug
* gio/gdesktopappinfo.c: (ensure_dir):
	* gio/glocalfile.c: (g_local_file_query_filesystem_info),
	(g_local_file_read), (g_local_file_delete), (g_local_file_trash),
	(g_local_file_move):
	* gio/glocalfileinfo.c: (set_xattr), (_g_local_file_info_get),
	(_g_local_file_info_get_from_fd), (set_unix_mode),
	(set_unix_uid_gid), (set_symlink), (set_mtime_atime):
	* gio/glocalfileinputstream.c: (g_local_file_input_stream_read),
	(g_local_file_input_stream_skip),
	(g_local_file_input_stream_close),
	(g_local_file_input_stream_seek):
	* gio/glocalfileoutputstream.c:
	(g_local_file_output_stream_write),
	(g_local_file_output_stream_close),
	(g_local_file_output_stream_seek),
	(g_local_file_output_stream_truncate), (copy_file_data),
	(handle_overwrite_open):
	* gio/gunixinputstream.c: (g_unix_input_stream_read),
	(g_unix_input_stream_close), (read_async_cb), (close_async_cb):
	* gio/gunixoutputstream.c: (g_unix_output_stream_write),
	(g_unix_output_stream_close), (write_async_cb), (close_async_cb):
	Save
	errno before calling other funcs that potentially alter it. Bug
	#514766.

svn path=/trunk/; revision=6466
2008-02-06 15:10:08 +00:00
Tomas Bzatek
d87c1c0af4 New GIO testing module working over real data
2008-02-06  Tomas Bzatek  <tbzatek@redhat.com> 

        * tests/Makefile.am:
        * tests/live-g-file.c: 
        * tests/live-g-file.txt:
        New GIO testing module working over real data


svn path=/trunk/; revision=6465
2008-02-06 13:52:07 +00:00
Tomas Bzatek
c907c2832e Fallback to rename() if link() is not available (when no support on target
2008-02-06  Tomas Bzatek  <tbzatek@redhat.com> 

        * glocalfileoutputstream.c (g_local_file_output_stream_close):
        Fallback to rename() if link() is not available
        (when no support on target filesystem)


svn path=/trunk/; revision=6464
2008-02-06 13:45:26 +00:00
Michael Natterer
2b02891ef7 replace "icon && G_IS_ICON (icon)" by simply "G_IS_ICON (icon)".
2008-02-06  Michael Natterer  <mitch@imendio.com>

	* gfileinfo.c (g_file_info_get_icon): replace
	"icon && G_IS_ICON (icon)" by simply "G_IS_ICON (icon)".


svn path=/trunk/; revision=6463
2008-02-06 13:22:57 +00:00
Tomas Bzatek
4e9a5de905 Documentation update of error codes
2008-02-06  Tomas Bzatek  <tbzatek@redhat.com>

        * gfile.c (g_file_create):
        Documentation update of error codes


svn path=/trunk/; revision=6462
2008-02-06 12:59:49 +00:00
Alexander Larsson
b4a7d48aad Update to use both mimeapps.list and defaults.list as discussed on xdg
2008-02-06  Alexander Larsson  <alexl@redhat.com>

	* gdesktopappinfo.c:
	Update to use both mimeapps.list and
	defaults.list as discussed on xdg list.



svn path=/trunk/; revision=6461
2008-02-06 10:57:27 +00:00
Benjamin Otte
f428a1b44a Fix some typos in the documentation.
2008-02-06  Benjamin Otte  <otte@gnome.org>

        * gasyncresult.c:
	* gfilenamecompleter.c:
	Fix some typos in the documentation.

svn path=/trunk/; revision=6460
2008-02-06 10:26:53 +00:00
Alexander Larsson
2185733235 Don't succeed with trash if newly created trash dir has the wrong owner.
2008-02-06  Alexander Larsson  <alexl@redhat.com>

	* glocalfile.c (g_local_file_trash):
	Don't succeed with trash if newly created
	trash dir has the wrong owner. (#514696)


svn path=/trunk/; revision=6459
2008-02-06 10:06:54 +00:00
Alexander Larsson
c6af0efb11 Don't spew warnings when destination is not a GLocalFile.
2008-02-05  Alexander Larsson  <alexl@redhat.com>

	* glocalfile.c (g_local_file_move):
	Don't spew warnings when destination is not
	a GLocalFile.


svn path=/trunk/; revision=6451
2008-02-05 10:11:12 +00:00
Jonathon Jongsma
2be52dd9c3 modify the new_sized() constructor to take a gsize param instead of guint
2008-02-02  Jonathon Jongsma  <jjongsma@gnome.org>

	* gio/gbufferedoutputstream.c:
	* gio/gbufferedoutputstream.h: modify the new_sized() constructor to take a
	gsize param instead of guint to match the GBufferedInputStream constructor.



svn path=/trunk/; revision=6448
2008-02-04 10:04:40 +00:00
Hans Breuer
01072d0c45 update
2008-02-03  Hans Breuer  <hans@breuer.org>

	* makefile.msc : update


svn path=/trunk/; revision=6444
2008-02-03 22:40:29 +00:00
Michael Natterer
573a73f391 assign the return value of xdg_mime_list_mime_parents() to a variable of
2008-02-01  Michael Natterer  <mitch@imendio.com>

	* gcontenttype.c (_g_unix_content_type_get_parents): assign the
	return value of xdg_mime_list_mime_parents() to a variable of the
	correct type.


svn path=/trunk/; revision=6441
2008-02-01 13:17:04 +00:00
Alexander Larsson
a7749bab36 Actually call the launch_uris method, not launch.
2008-02-01  Alexander Larsson  <alexl@redhat.com>

	* gappinfo.c (g_app_info_launch_uris):
	Actually call the launch_uris method, not
	launch.

2008-02-01  Alexander Larsson  <alexl@redhat.com>

	* gdesktopappinfo.c (g_desktop_app_info_equal):
	Ensure appinfos with no id but same pointer value
	compare equal



svn path=/trunk/; revision=6440
2008-02-01 12:02:52 +00:00
Alexander Larsson
d9b8be3b5c Don't leak appinfo.
2008-02-01  Alexander Larsson  <alexl@redhat.com>

	* gappinfo.c (g_app_info_launch_default_for_uri): 
	Don't leak appinfo.


svn path=/trunk/; revision=6439
2008-02-01 11:42:25 +00:00
Alexander Larsson
feb28ce3a7 Oops, fix last commit.
svn path=/trunk/; revision=6438
2008-02-01 11:30:37 +00:00
Alexander Larsson
a00c11f08a Add g_app_info_launch_default_for_uri utility function. (#513256)
2008-02-01  Alexander Larsson  <alexl@redhat.com>

        * gappinfo.[ch]:
        * gio.symbols:
        Add g_app_info_launch_default_for_uri utility
	function. (#513256)


svn path=/trunk/; revision=6437
2008-02-01 11:21:37 +00:00
Cosimo Cecchi
cebfe57343 Doc fix for g_app_info_get_default_for_uri_scheme () Bug #513483.
2008-02-01  Cosimo Cecchi  <cosimoc@svn.gnome.org>

	* gdesktopappinfo.c:
	Doc fix for g_app_info_get_default_for_uri_scheme ()
	Bug #513483.

svn path=/trunk/; revision=6436
2008-02-01 11:21:01 +00:00
Alexander Larsson
692e9086b4 Add doc comment about uris vs GFiles to g_app_info_launch()
2008-01-30  Alexander Larsson  <alexl@redhat.com>

        * gappinfo.c:
	Add doc comment about uris vs GFiles to
	g_app_info_launch()
	
        * gdesktopappinfo.c:
	Ensure uris passed to g_app_info_launch_uris()
	are not roundtriped through GFile (as that
	may be slightly destructive for e.g. mailto: links)



svn path=/trunk/; revision=6424
2008-01-30 11:27:02 +00:00
Alexander Larsson
fc93e63edd C89 fixes from Jens Granseuer (#512849)
2008-01-30  Alexander Larsson  <alexl@redhat.com>

        * tests/data-input-stream.c:
        * tests/data-output-stream.c:
	C89 fixes from Jens Granseuer (#512849)



svn path=/trunk/; revision=6423
2008-01-30 09:28:10 +00:00
Alexander Larsson
0234965965 Fix gamin/fam difference build issue. (#509419)
2008-01-30  Alexander Larsson  <alexl@redhat.com>

	* fam/fam-helper.c:
	Fix gamin/fam difference build issue. (#509419)


svn path=/trunk/; revision=6422
2008-01-30 09:14:58 +00:00
Alexander Larsson
6ff29c1dea Add G_APP_INFO_CREATE_SUPPORTS_URIS flag
2008-01-29  Alexander Larsson  <alexl@redhat.com>

        * gappinfo.h:
        * gdesktopappinfo.c:
	Add G_APP_INFO_CREATE_SUPPORTS_URIS flag


svn path=/trunk/; revision=6418
2008-01-29 15:47:27 +00:00
Alexander Larsson
e61e022333 giomodule-priv.h include moved to .c file.
2008-01-29  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
        * gdesktopappinfo.h:
	giomodule-priv.h include moved to .c file.



svn path=/trunk/; revision=6416
2008-01-29 15:11:54 +00:00
Alexander Larsson
a0283fa682 Remove unused prio/name fields.
2008-01-29  Alexander Larsson  <alexl@redhat.com>

	* gnativevolumemonitor.h (struct _GNativeVolumeMonitorClass):
	Remove unused prio/name fields.


svn path=/trunk/; revision=6415
2008-01-29 15:04:50 +00:00
Alexander Larsson
1efe9d9cd1 Don't treat whitespace as control chars.
2008-01-29  Alexander Larsson  <alexl@redhat.com>

	* gcontenttype.c (looks_like_text):
	Don't treat whitespace as control chars.


svn path=/trunk/; revision=6414
2008-01-29 14:19:46 +00:00
Alexander Larsson
3b78d8000b Lazily create the desktop files for appinfos created by
2008-01-29  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
	Lazily create the desktop files for appinfos created
	by g_app_info_create_from_commandline() when needed
	for mime associations. This allows run-time use
	of GAppInfo object without creating unnecessary
	files on disk.


svn path=/trunk/; revision=6412
2008-01-29 14:07:07 +00:00
Alexander Larsson
07d7c59931 Added new symbols to gio.symbols
2008-01-29  Alexander Larsson  <alexl@redhat.com>

        * gio.symbols:
	Added new symbols to gio.symbols



svn path=/trunk/; revision=6411
2008-01-29 12:27:45 +00:00
Alexander Larsson
75d6d024cd Add docs
svn path=/trunk/; revision=6410
2008-01-29 12:23:24 +00:00
Alexander Larsson
431fef8617 Add g_file_query_default_handler utility to easily look up the GAppInfo
2008-01-29  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        Add g_file_query_default_handler utility to easily look up
	the GAppInfo that handles a file.
	
        * gdesktopappinfo.[ch]:
        * giomodule.c:
	Set up an extension point for g_app_info_get_default_for_uri_scheme()
	
        * gvfs.c:
	Remove unused function



svn path=/trunk/; revision=6409
2008-01-29 12:18:48 +00:00
Alexander Larsson
1b0fce2dca Mention need to free returned value in g_file_enumerator_next_files_finish
2008-01-29  Alexander Larsson  <alexl@redhat.com>

        * gfileenumerator.c:
        Mention need to free returned value in
	g_file_enumerator_next_files_finish docs.
	Fix leak if g_file_enumerator_next_files_finish()
	not called.



svn path=/trunk/; revision=6408
2008-01-29 10:35:38 +00:00
Alexander Larsson
e064f28435 Use list_parents, not get_parents from xdgmime, because the later doesn't
2008-01-29  Alexander Larsson  <alexl@redhat.com>

        * gcontenttype.c:
        (_g_unix_content_type_get_parents):
	Use list_parents, not get_parents from xdgmime, because
	the later doesn't use the cache.
	
        * xdgmime/xdgmimecache.c:
        (_xdg_mime_cache_list_mime_parents):
	Don't list the same type as parent multiple times.


svn path=/trunk/; revision=6407
2008-01-29 10:20:49 +00:00
Matthias Clasen
fb5ddf6ecf 2.15.4
svn path=/trunk/; revision=6402
2008-01-29 00:00:31 +00:00
Alexander Larsson
7b432e9497 Register local vfs with prio 0.
2008-01-28  Alexander Larsson  <alexl@redhat.com>

        * glocalvfs.c:
	Register local vfs with prio 0.
	
        * gvfs.h:
	Remove old name and prio class members


svn path=/trunk/; revision=6401
2008-01-28 21:06:10 +00:00
Matthias Clasen
8cb30318e5 Disable some tests
svn path=/trunk/; revision=6400
2008-01-28 19:46:18 +00:00
Alexander Larsson
bff9ecedbb Add registration hooks for extension points. Register the gio extension
2008-01-28  Alexander Larsson  <alexl@redhat.com>

        * giomodule.[ch]:
        * gio.symbols:
	Add registration hooks for extension points.
	Register the gio extension points.
	
        * fam/gfamdirectorymonitor.c:
        * fam/gfamfilemonitor.c:
        * glocaldirectorymonitor.[ch]:
        * glocalfilemonitor.[ch]:
        * gnativevolumemonitor.h:
        * gunionvolumemonitor.c:
        * gunixvolumemonitor.c:
        * gvfs.[ch]:
        * gvolumemonitor.h:
        * inotify/ginotifydirectorymonitor.c:
        * inotify/ginotifyfilemonitor.c:
	Use the extension points registration instead
	of g_type_children().


svn path=/trunk/; revision=6399
2008-01-28 19:43:10 +00:00
Matthias Clasen
fce0485e2b Document new api
svn path=/trunk/; revision=6398
2008-01-28 17:26:45 +00:00
Matthias Clasen
e2ba37ceb3 Document new api
svn path=/trunk/; revision=6397
2008-01-28 17:21:34 +00:00
Matthias Clasen
76b565e8bd Fix docs
svn path=/trunk/; revision=6396
2008-01-28 17:09:26 +00:00
Matthias Clasen
7bfc60de2e Deprecate G_GNUC_(PRETTY)_FUNCTION.
2008-01-27  Matthias Clasen  <mclasen@redhat.com>

        * glib/gmacros.h: Deprecate G_GNUC_(PRETTY)_FUNCTION.



svn path=/trunk/; revision=6389
2008-01-27 23:42:33 +00:00
Matthias Clasen
c923700b3d Avoid trivial differences in translatable strings
svn path=/trunk/; revision=6386
2008-01-27 21:58:53 +00:00
Murray Cumming
7b4933fe02 Document that the new_etags output gchar* should be freed.
2008-01-27  Murray Cumming  <murrayc@murrayc.com>

* gio/gfile.c: (g_file_replace_contents),
(g_file_replace_contents_finish): Document that the new_etags output 
gchar* should be freed.

svn path=/trunk/; revision=6383
2008-01-27 07:25:29 +00:00
Matthias Clasen
d7a1dddbc7 Make this build with gcc 3.4 (#509419)
2008-01-25  Matthias Clasen  <mclasen@redhat.com>

        * fam/fam-helper.c (fam_event_to_file_monitor_event): Make this
        build with gcc 3.4  (#509419)



svn path=/trunk/; revision=6378
2008-01-25 17:50:49 +00:00
Matthias Clasen
1f331ffde8 Doc updates
svn path=/trunk/; revision=6376
2008-01-25 17:38:04 +00:00
Matthias Clasen
8228f7f94b Make GIOSchedulerJobFunc return boolean Keep calling io jobs until they
2008-01-25  Matthias Clasen  <mclasen@redhat.com>

        * gioscheduler.h: Make GIOSchedulerJobFunc return boolean
        * gioscheduler.c: Keep calling io jobs until they return FALSE;
        this allows big jobs to be executed in chunks, instead of blocking
        the main loop for a long time.

        * gsimpleasyncresult.c:
        * giofile.c: Adapt callers.

svn path=/trunk/; revision=6375
2008-01-25 14:40:54 +00:00
Alexander Larsson
06d957d95d Implement changes discussed on xdg list. Now we can add supported
2008-01-25  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
	Implement changes discussed on xdg list.
	Now we can add supported mimetypes by just using defaults.list
	We can also remove associations in defaults.list.


svn path=/trunk/; revision=6374
2008-01-25 12:06:14 +00:00
Alexander Larsson
331d373e9a Don't make local copy of desktop file for mimetype changes if the file
2008-01-25  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
	Don't make local copy of desktop file
	for mimetype changes if the file already
	supports the new mimetype.


svn path=/trunk/; revision=6372
2008-01-25 09:46:31 +00:00
Matthias Clasen
af7645a498 String fixes
svn path=/trunk/; revision=6370
2008-01-25 06:10:29 +00:00
Matthias Clasen
12a26c75a9 Expand docs
svn path=/trunk/; revision=6366
2008-01-25 01:44:08 +00:00
Alexander Larsson
753428dcf8 Add g_drive_get_identifier and g_drive_enumerate_identifiers
2008-01-24  Alexander Larsson  <alexl@redhat.com>

        * gdrive.[ch]:
	Add g_drive_get_identifier and
        g_drive_enumerate_identifiers

        * gvolume.[ch]:
        Add g_volume_get_identifier and
        g_volume_enumerate_identifiers
	
        * gio.symbols:
	Add symbols
	
        * gunixvolume.c:
	Implement identifiers for unix backend


svn path=/trunk/; revision=6364
2008-01-24 16:06:33 +00:00
Alexander Larsson
270df8d3c8 Add g_file_copy_async() (#511580) Based on patch from Carlos Garcia Campos
2008-01-24  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        * gfile.h:
        * gio.symbols:
	Add g_file_copy_async() (#511580)
	Based on patch from Carlos Garcia Campos


svn path=/trunk/; revision=6363
2008-01-24 11:04:05 +00:00
Matthias Clasen
3bb0a17bd5 Some doc additions
svn path=/trunk/; revision=6358
2008-01-23 05:46:43 +00:00
Alexander Larsson
61014f7e13 Don't leak basename.
2008-01-22  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
	(g_desktop_app_info_new):
	Don't leak basename.


svn path=/trunk/; revision=6356
2008-01-22 16:16:32 +00:00
Alexander Larsson
aa88b00475 Don't leak GKeyFile
2008-01-22  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
        (g_desktop_app_info_new_from_filename):
	Don't leak GKeyFile



svn path=/trunk/; revision=6355
2008-01-22 14:15:51 +00:00
Alexander Larsson
10cd55875a Fix leak of uri
2008-01-22  Alexander Larsson  <alexl@redhat.com>

	* glocalfileinfo.c (get_thumbnail_attributes):
	Fix leak of uri


svn path=/trunk/; revision=6354
2008-01-22 13:24:48 +00:00
Alexander Larsson
2544ae3cd6 Canonicalize paths that start with more than two slashes.
2008-01-22  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        (canonicalize_filename):
	Canonicalize paths that start with more than
	two slashes.
	
        * tests/g-file.c:
        (compare_two_files):
        (test_g_file_new_for_path):
	Test the above



svn path=/trunk/; revision=6353
2008-01-22 09:38:37 +00:00
Alexander Larsson
db5224fa85 Fix c++ comment
svn path=/trunk/; revision=6352
2008-01-22 09:19:58 +00:00
Alexander Larsson
b784923e9c Allow UTF-8 in file:// parse names.
2008-01-22  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
	Allow UTF-8 in file:// parse names.
	
        * tests/Makefile.am:
        * tests/data-input-stream.c:
        * tests/data-output-stream.c:
        * tests/g-file-info.c:
        * tests/g-file.c:
	Added a bunch of tests from Tomas Bzatek


svn path=/trunk/; revision=6351
2008-01-22 09:13:28 +00:00
Matthias Clasen
1b8bad5973 2.15.3
svn path=/trunk/; revision=6347
2008-01-21 18:07:13 +00:00
Alexander Larsson
eb4a1640a2 Remove duplicated GSeekable functions. (#509990) Just use the
2008-01-21  Alexander Larsson  <alexl@redhat.com>

        * gfileinputstream.[ch]:
        * gfileoutputstream.[ch]:
        * gio.symbols:
	Remove duplicated GSeekable functions. (#509990)
	Just use the g_seekable_xxx() calls instead.



svn path=/trunk/; revision=6342
2008-01-21 15:11:56 +00:00
Matthias Clasen
54300dde6d Whitespace cleanups.
2008-01-21  Matthias Clasen  <mclasen@redhat.com>

        * glocal*.c:
        * gvolumemanager.c: Whitespace cleanups.

        * glocalfileoutputsteam.c (_g_local_file_output_stream_create):
        Use the right mode when creating the file.



svn path=/trunk/; revision=6341
2008-01-21 14:02:19 +00:00
Murray Cumming
6aaab07e0f Documentation: Fixed minor typos and added more mentions of specific
2008-01-21  Murray Cumming,,,  <murrayc@murrayc.com>

* gfileenumerator.c:
* gfileinputstream.c:
* ginputstream.c:
* goutputstream.c: Documentation: Fixed minor typos 
and added more mentions of specific _finish() functions.

svn path=/trunk/; revision=6339
2008-01-21 13:08:23 +00:00
Alexander Larsson
d8473705b0 Removed. Removed. Removed the included copies of the inotify headers. We
2008-01-21  Alexander Larsson  <alexl@redhat.com>

        * inotify/Makefile.am:
        * inotify/inotify-helper.c:
        * inotify/inotify-kernel.c:
        * inotify/inotify-path.c:
        * inotify/local_inotify.h: Removed.
        * inotify/local_inotify_syscalls.h: Removed.
	Removed the included copies of the inotify
	headers. We now only use the <sys/inotify.h>
	header which exists on modern systems.
	This fixes problems on ARM and SH5 (#510448)
	but is also generally much cleaner and future
	safe. For instance, if other OSes add support
	for inotify it should "just work".



svn path=/trunk/; revision=6338
2008-01-21 10:35:44 +00:00
Matthias Clasen
a043325ec1 Coding style fixes
svn path=/trunk/; revision=6337
2008-01-21 05:12:16 +00:00
Matthias Clasen
d16037e0e7 Documentation updates
svn path=/trunk/; revision=6336
2008-01-21 03:49:20 +00:00
Murray Cumming
88266aae90 documentation: Fixed more minor typos.
2008-01-20  Murray Cumming  <murrayc@murrayc.com>

* gfile.c: documentation: Fixed more minor 
typos.

svn path=/trunk/; revision=6335
2008-01-20 17:42:35 +00:00
Murray Cumming
225501c71a documentation: Mention g_mount_remount_finish() instead of
2008-01-18  Murray Cumming  <murrayc@murrayc.com>

* gmount.c: (g_mount_remount): documentation: 
Mention g_mount_remount_finish() instead of 
g_mount_unmount_finish().

svn path=/trunk/; revision=6334
2008-01-18 18:16:28 +00:00
Murray Cumming
0108d39d02 Fixed some minor typos in the documentation.
2008-01-18  Murray Cumming  <murrayc@murrayc.com>

* gappinfo.c:
* gcancellable.c:
* gfile.c: Fixed some minor typos in the 
documentation. 

svn path=/trunk/; revision=6331
2008-01-18 09:41:09 +00:00
Murray Cumming
acf029139d Documentation: Clarify the ownership of the regurn GLists.
2008-01-18  Murray Cumming  <murrayc@murrayc.com>

* gio/gvolumemonitor.c: 
(g_volume_monitor_get_connected_drives): 
(g_volume_monitor_get_volumes): 
(g_volume_monitor_get_mounts): Documentation: 
Clarify the ownership of the regurn GLists.

svn path=/trunk/; revision=6330
2008-01-17 23:43:31 +00:00
Alexander Larsson
359339fe25 Add the async find_enclosing_mount version to the header file too.
2008-01-17  Alexander Larsson  <alexl@redhat.com>

        * gfile.h:
	Add the async find_enclosing_mount version
	to the header file too.



svn path=/trunk/; revision=6326
2008-01-17 14:30:07 +00:00
Alexander Larsson
35cf559e3d Add async version of find_enclosing_mount with default implementation.
2008-01-17  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
	Add async version of find_enclosing_mount
	with default implementation.



svn path=/trunk/; revision=6325
2008-01-17 14:22:13 +00:00
Alexander Larsson
0026537f37 Allow calls to implementation of copy and write even if the type of the
2008-01-17  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
        (g_file_copy):
        (g_file_move):
	Allow calls to implementation of copy and write
	even if the type of the file implementations is
	different. This can be used to implement native
	upload and download calls in a vfs.
	
        * glocalfile.c:
        (g_local_file_move):
	Protect against the case where move is called
	with one file not being local.
	
	Make sure we call the progress callback once
	in the native move operation so that the caller
	knows how many bytes were copied.


svn path=/trunk/; revision=6324
2008-01-17 10:57:48 +00:00
Murray Cumming
f0749cc896 Corrected some typos in the documentation: occured -> occurred. its ->
2008-01-16  Murray Cumming  <murrayc@murrayc.com>

* gappinfo.c:
* gdatainputstream.c:
* gfile.c:
* gfileoutputstream.c:
* ginputstream.c:
* gmount.c:
* goutputstream.c:
* gseekable.c:
* gunixmounts.c: Corrected some typos in the documentation:
occured -> occurred.
its -> it's (where appropriate).

svn path=/trunk/; revision=6322
2008-01-16 20:00:23 +00:00
Alexander Larsson
87cd883e8d Add g_file_query_exists (#508771)
2008-01-16  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        * gio.symbols:
        Add g_file_query_exists (#508771)


svn path=/trunk/; revision=6319
2008-01-16 10:11:26 +00:00
Murray Cumming
218827445d For async functions that have no non-async version, document that the
2008-01-15  Murray Cumming  <murrayc@murrayc.com>

* gdrive.c:
* gfile.c:
* gmount.c:
* gvolume.c: For async functions that have no non-async 
version, document that the GAsyncReadyCallback may be NULL.
Bug #509626.

svn path=/trunk/; revision=6318
2008-01-15 14:08:41 +00:00
Alexander Larsson
a1996e6518 Don't do pointer arithmetic on void * (#508602) Patch from Kazuki IWAMOTO
2008-01-15  Alexander Larsson  <alexl@redhat.com>

        * gmemoryinputstream.c:
        * gmemoryoutputstream.c:
	Don't do pointer arithmetic on void * (#508602)
	Patch from Kazuki IWAMOTO


svn path=/trunk/; revision=6316
2008-01-15 11:47:04 +00:00
Matthias Clasen
da7494c1e9 2.15.2
svn path=/trunk/; revision=6310
2008-01-14 16:43:59 +00:00
Alexander Larsson
fd6e388736 Don't set error here, since we fallback to polling monitor.
2008-01-14  Alexander Larsson  <alexl@redhat.com>

	* gfile.c (g_file_monitor_file):
	Don't set error here, since we fallback to polling monitor.


svn path=/trunk/; revision=6307
2008-01-14 15:04:25 +00:00
Alexander Larsson
3690cb75a6 Add GError to file monitor calls
2008-01-14  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        (g_file_monitor_directory):
        (g_file_monitor_file):
	Add GError to file monitor calls
	
        * glocaldirectorymonitor.c:
        * glocaldirectorymonitor.h:
        * glocalfile.c:
        * glocalfilemonitor.c:
        * glocalfilemonitor.h:
        * gunixmounts.c:
	Update for above change


svn path=/trunk/; revision=6306
2008-01-14 15:00:31 +00:00
Alexander Larsson
a80b1120f1 Handle root correctly in g_file_get_relative_path (#508719)
2008-01-14  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        (match_prefix):
	Handle root correctly in g_file_get_relative_path (#508719)


svn path=/trunk/; revision=6305
2008-01-14 14:55:27 +00:00
Alexander Larsson
2a5748310b Clean up docs and example for GAsyncResult (#508074)
2008-01-14  Alexander Larsson  <alexl@redhat.com>

        * gasyncresult.c:
	Clean up docs and example for GAsyncResult (#508074)



svn path=/trunk/; revision=6303
2008-01-14 14:12:48 +00:00
Murray Cumming
85fc6345db Clarify the sentence about GAsyncReadyCallback, and correct some spelling
2008-01-11  Murray Cumming  <murrayc@murrayc.com>

* gfile.c: Clarify the sentence about GAsyncReadyCallback, 
and correct some spelling mistakes. Bug #508108.

svn path=/trunk/; revision=6295
2008-01-11 16:23:30 +00:00
Matthias Clasen
ef613614c9 Add a comment
svn path=/trunk/; revision=6294
2008-01-11 14:36:31 +00:00
Murray Cumming
30d6124e8a GFileInfo description: Mention how to actually set attributes in a GFile
2008-01-10  Murray Cumming  <murrayc@murrayc.com>

        * gfileinfo.c: GFileInfo description: Mention 
        how to actually set attributes in a GFile and how to discover 
        which attributes are settable. Bug #508378.

svn path=/trunk/; revision=6293
2008-01-11 14:15:07 +00:00
A. Walton
d43b188954 Check for NULL content types.
2008-01-10  A. Walton  <awalton@svn.gnome.org>

	* gdesktopappinfo.c: (g_app_info_get_all_for_type),
	(g_app_info_get_default_for_type):
	Check for NULL content types.

svn path=/trunk/; revision=6290
2008-01-10 13:25:41 +00:00
Frederic Crozat
7fe31089ff add rpc_pipefs to systemfs list (#508309).
2008-01-10  Frederic Crozat  <fcrozat@mandriva.com>

        * gunixmounts.c: add rpc_pipefs to systemfs list (#508309).


svn path=/trunk/; revision=6289
2008-01-10 09:55:35 +00:00
Murray Cumming
1a45f5167d *_async() functions: Several small corrections to the documentation,
2008-01-09  Murray Cumming  <murrayc@murrayc.com>

* gfile.c: *_async() functions: Several small corrections 
to the documentation, mostly correcting copy/paste errors 
and improving some sentences.

svn path=/trunk/; revision=6287
2008-01-09 17:04:06 +00:00
Dan Winship
e4d018f1dd x86_64 fix
* glocalfile.c (get_unique_filename): x86_64 fix

svn path=/trunk/; revision=6286
2008-01-09 16:39:42 +00:00
Alexander Larsson
896ebed1a5 Add g_unix_mount_guess_should_display and use for unix volume monitor
2008-01-09  Alexander Larsson  <alexl@redhat.com>

        * gio.symbols:
        * gunixmount.c:
        * gunixmounts.[ch]:
	Add g_unix_mount_guess_should_display and use
	for unix volume monitor backend.
	This means we more or less show what the
	gnome-vfs backend did.
	Based on patch from Padraig O'Briain


svn path=/trunk/; revision=6285
2008-01-09 15:45:56 +00:00
Alexander Larsson
47b8809e17 Add g_themed_icon_new_with_default_fallbacks
2008-01-09  Alexander Larsson  <alexl@redhat.com>

        * gio.symbols:
        * gthemedicon.[ch]:
        Add g_themed_icon_new_with_default_fallbacks
	
        * gunixmounts.c:
	Use default fallbacks for icons



svn path=/trunk/; revision=6284
2008-01-09 15:20:49 +00:00
Alexander Larsson
e6ca690694 Change the API a bit so that unhandled methods get reported via the reply,
2008-01-09  Alexander Larsson  <alexl@redhat.com>

        * gio-marshal.list:
        * gmountoperation.[ch]:
	Change the API a bit so that unhandled methods
	get reported via the reply, rather than by
	the signal emission return value. This is because
	some handlers can't know this immediately without
	doing I/O, and this is an async operation that
	should not block.


svn path=/trunk/; revision=6282
2008-01-09 14:43:41 +00:00
Alexander Larsson
91d7fdc186 Fix double free crash (#508224) Patch from Joe Marcus Clarke
2008-01-09  Alexander Larsson  <alexl@redhat.com>

        * fam/fam-helper.c:
        * fam/gfamdirectorymonitor.c:
        * fam/gfamfilemonitor.c:
	Fix double free crash (#508224)
	Patch from Joe Marcus Clarke


svn path=/trunk/; revision=6281
2008-01-09 08:08:43 +00:00
Matthias Clasen
60c8bdfe8f 2.15.1
svn path=/trunk/; revision=6267
2008-01-07 16:47:36 +00:00
Alexander Larsson
6a3cdb7eb4 Fix warning (#507835)
2008-01-07  Alexander Larsson  <alexl@redhat.com>

	* gunixinputstream.c (g_unix_input_stream_skip_finish):
	Fix warning (#507835)


svn path=/trunk/; revision=6264
2008-01-07 13:58:37 +00:00
Alexander Larsson
361e0e9b1c Pass --internal to glib-genmarshal
2008-01-07  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
	Pass --internal to glib-genmarshal
	
        * gfilemonitor.c:
        * gmountoperation.c:
        * gio-marshal.list:
	Use better types for signal arguments (#507822)


svn path=/trunk/; revision=6263
2008-01-07 13:56:10 +00:00
Alexander Larsson
e23140cbb4 Build test subdir after . Remove gdirectorymonitor.[ch]
2008-01-07  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
	Build test subdir after .
	Remove gdirectorymonitor.[ch]
	
        * gdirectorymonitor.[ch]:
        * gfilemonitor.c:
        * gfile.[ch]:
        * gio.h:
	Remove GDirectoryMonitor and make
	GFileMonitor the baseclass for both file and
	directory monitors. Lift the more generic
	rate limiting code from GDirectoryMonitor
	into GFileMonitor.
	
        * fam/fam-helper.c:
        * fam/gfamdirectorymonitor.[ch]:
        * inotify/ginotifydirectorymonitor.[ch]:
        * inotify/inotify-helper.c:
        * glocaldirectorymonitor.[ch]:
        * glocalfile.c:
        * gvolumemonitor.c:
	Update for the removed GDirectoryMonitor.
	
        * gmemoryoutputstream.c:
	Remove ununsed variable


svn path=/trunk/; revision=6262
2008-01-07 13:42:08 +00:00
Alexander Larsson
3fe87f016a Translate error strings
2008-01-07  Alexander Larsson  <alexl@redhat.com>

        * gmemoryinputstream.c:
	Translate error strings
	
        * gio.symbols:
        * gmemoryoutputstream.[ch]:
	New implementation that avoids using GByteArray
	in implementation and API. (#506377)


svn path=/trunk/; revision=6260
2008-01-07 10:11:57 +00:00
Matthias Clasen
3cbcbee7a6 Add some tests
svn path=/trunk/; revision=6257
2008-01-07 06:14:40 +00:00
Matthias Clasen
3905f14528 Mark strings for translation.
svn path=/trunk/; revision=6256
2008-01-07 05:18:17 +00:00
Matthias Clasen
614f47792a Small doc addition
svn path=/trunk/; revision=6249
2008-01-06 08:06:52 +00:00
Matthias Clasen
ff068af417 Documentation additions
svn path=/trunk/; revision=6247
2008-01-06 08:04:39 +00:00
Alexander Larsson
b481ba7ced Use the right type (uint) for the ask_password signal.
2008-01-04  Alexander Larsson  <alexl@redhat.com>

        * gio-marshal.list:
        * gmountoperation.c:
	Use the right type (uint) for the ask_password signal.


svn path=/trunk/; revision=6244
2008-01-04 15:19:36 +00:00
Alexander Larsson
8af463f939 Add g_app_info_supports_files() Remove desktop arg from
2008-01-04  Alexander Larsson  <alexl@redhat.com>

        * gappinfo.[ch]:
        * gwin32appinfo.c:
        * gio.symbols:
	Add g_app_info_supports_files() 
        Remove desktop arg from g_app_info_should_show().
	
        * gdesktopappinfo.[ch]:
	Implement g_app_info_supports_files() and new should_show()
	Add g_desktop_app_info_set_desktop_env() to set the desktop
	for should_show(). (This will be set by gtk+ later)


svn path=/trunk/; revision=6242
2008-01-04 10:51:56 +00:00
Alexander Larsson
ce50248037 Improve API so that you can use multile chunks of memory and custom
2008-01-04  Alexander Larsson  <alexl@redhat.com>

        * gio.symbols:
        * gmemoryinputstream.[ch]:
	Improve API so that you can use multile chunks
	of memory and custom destroy functions. (#506374)



svn path=/trunk/; revision=6241
2008-01-04 10:17:57 +00:00
Alexander Larsson
491cccf63a Handle NULL attribute matchers safely, as we return this for empty
2008-01-03  Alexander Larsson  <alexl@redhat.com>

        * gfileinfo.c:
	Handle NULL attribute matchers safely, as we return this
	for empty attribute matcher strings.



svn path=/trunk/; revision=6238
2008-01-03 14:58:53 +00:00
Alexander Larsson
246e2e71a9 Add /usr/local to list of internal mountpoints
2008-01-03  Alexander Larsson  <alexl@redhat.com>

	* gunixmounts.c (g_unix_is_mount_path_system_internal):
	Add /usr/local to list of internal mountpoints


svn path=/trunk/; revision=6237
2008-01-03 10:29:29 +00:00
Alexander Larsson
e3fa723f99 Check for HAVE_LCHOWN (#505887)
2008-01-03  Alexander Larsson  <alexl@redhat.com>

        * glocalfileinfo.c:
	Check for HAVE_LCHOWN (#505887)


svn path=/trunk/; revision=6236
2008-01-03 09:13:39 +00:00
Alexander Larsson
7e6f37d00c Add define for selinux context attribute. Fix missing : -> :: namespace
2008-01-03  Alexander Larsson  <alexl@redhat.com>

        * gfileinfo.h:
        * glocalfileinfo.c:
	Add define for selinux context attribute.
	Fix missing : -> :: namespace separator change
	Fix missing _ -> - name change for xattr-sys.
	(#505058)


svn path=/trunk/; revision=6235
2008-01-03 09:01:00 +00:00
Alexander Larsson
a59fb762e6 Link to libglib and libgobject directly (#504879) Patch from Sebastien
2008-01-03  Alexander Larsson  <alexl@redhat.com>

        * fam/Makefile.am:
	Link to libglib and libgobject directly (#504879)
	Patch from Sebastien Bacher


svn path=/trunk/; revision=6234
2008-01-03 08:56:51 +00:00
Alvaro Lopez Ortega
f06829352b These void functions were trying to return a value. It was causing the
2008-01-02  Alvaro Lopez Ortega  <alvaro@sun.com>

        * gio/gunixmount.c (g_unix_mount_unmount, g_unix_mount_eject):
        These void functions were trying to return a value. It was causing
        the compilation to fail.


svn path=/trunk/; revision=6232
2008-01-02 16:22:25 +00:00
Wouter Bolsterlee
69b861ec5c Expanded the g_file_new_for_commandline_arg description a bit, based on
2008-01-01  Wouter Bolsterlee  <wbolster@svn.gnome.org>

	* gfile.c: Expanded the g_file_new_for_commandline_arg
	description a bit, based on the code and the docs of the
	other g_file_new_for_* functions.

svn path=/trunk/; revision=6229
2008-01-01 14:39:51 +00:00
Wouter Bolsterlee
123116a30c Fixed typo in docs.
2007-12-31  Wouter Bolsterlee  <wbolster@svn.gnome.org>

	* gfilemonitor.h: Fixed typo in docs.

svn path=/trunk/; revision=6225
2007-12-31 12:11:13 +00:00
Mathias Hasselmann
9002395011 Updates to GIO documentation. (#506395, Mikael Hermansson)
* gcontenttype.c: Describe memory management for return value of
g_content_types_get_registered(). Missing piece from #505815.
* gdrive.c, gmount.c, gvolumemonitor.c: Add more description to
GVolume, GDrive, GMounts, which hopefully gives the user less
confusions when using this API. Following explainations from
Alexander Larsson on gtk-devel-list.

svn path=/trunk/; revision=6222
2007-12-31 10:00:52 +00:00
Matthias Clasen
227ef243b1 Doc additions
svn path=/trunk/; revision=6220
2007-12-31 04:45:19 +00:00
Matthias Clasen
a2cea97a8d Fix build with --disable-visibility
svn path=/trunk/; revision=6219
2007-12-31 02:30:33 +00:00
Matthias Clasen
4ea56399b6 Don't include NULLs in the list of returned app infos.
2007-12-30  Matthias Clasen  <mclasen@redhat.com> 

        * gdesktopfileinfo.c (g_app_info_get_all): Don't include NULLs
        in the list of returned app infos.


svn path=/trunk/; revision=6218
2007-12-31 01:47:59 +00:00
Matthias Clasen
c009b04f42 Fix a cross-reference
svn path=/trunk/; revision=6217
2007-12-30 06:15:12 +00:00
Matthias Clasen
a3b0996156 More docs
svn path=/trunk/; revision=6216
2007-12-30 06:13:12 +00:00
Matthias Clasen
c7eee2ff00 Doc updates
svn path=/trunk/; revision=6215
2007-12-30 05:55:23 +00:00
Matthias Clasen
c014e5f8de More doc updates
svn path=/trunk/; revision=6213
2007-12-30 05:30:42 +00:00
Matthias Clasen
b0f4fcc272 More doc updates
svn path=/trunk/; revision=6212
2007-12-30 05:22:33 +00:00
Matthias Clasen
d285f28401 Documentation updates
svn path=/trunk/; revision=6211
2007-12-30 05:21:05 +00:00
Matthias Clasen
08ed5bc3aa Documentation updates
svn path=/trunk/; revision=6210
2007-12-30 05:12:15 +00:00
Matthias Clasen
38fa4bacd3 Documentation updates
svn path=/trunk/; revision=6209
2007-12-30 05:10:23 +00:00
Matthias Clasen
5f1c3a491a Include crt_externs.h. (#505730, Tommi Komulainen)
2007-12-26  Matthias Clasen  <mclasen@redhat.com> 

        * gdesktopappinfo.c: Include crt_externs.h.  (#505730,
        Tommi Komulainen)



svn path=/trunk/; revision=6206
2007-12-27 04:23:57 +00:00
Matthias Clasen
a06dd20aef Don't return freed memory (#505815, Mikael Hermansson)
2007-12-26  Matthias Clasen  <mclasen@redhat.com> 

        * gcontenttype.c (g_content_types_get_registered): Don't return
        freed memory (#505815, Mikael Hermansson)



svn path=/trunk/; revision=6205
2007-12-27 04:14:47 +00:00
Paolo Borelli
255c62b695 fix typo in the ifdef used to detect statbuf->st_blocks. (#505042)
2007-12-25  Paolo Borelli  <pborelli@katamail.com>

	* glocalfileinfo.c (set_info_from_stat): fix typo in the ifdef
	used to detect statbuf->st_blocks. (#505042)


svn path=/trunk/; revision=6202
2007-12-25 21:21:32 +00:00
Matthias Clasen
c58f339401 Fix the environment handling. (#504829, Cosimo Cecchi)
2007-12-24  Matthias Clasen  <mclasen@redhat.com>

        * gdesktopappinfo.c (g_desktop_app_info_launch): Fix the
        environment handling.  (#504829, Cosimo Cecchi)



svn path=/trunk/; revision=6200
2007-12-25 02:07:48 +00:00
Matthias Clasen
1daa618e05 Doc improvements
2007-12-22  Matthias Clasen  <mclasen@redhat.com>

        * gio/gappinfo.c: Doc improvements

        * gio/gdesktopappinfo.c (g_app_info_get_all): Return app infos,
        not ids.


svn path=/trunk/; revision=6188
2007-12-22 18:15:57 +00:00
Matthias Clasen
48ba9ea756 2.15.0
svn path=/trunk/; revision=6180
2007-12-21 00:37:41 +00:00
Hans Breuer
b64e1dfd47 don't build gdesktopappinfo.obj, it collides with symbols
2007-12-20  Hans Breuer  <hans@breuer.org>

	* makefile.msc : don't build gdesktopappinfo.obj, it collides 
	with symbols gwin32appinfo.obj, added gmount.obj
	* gio.symbols : mark g_desktop_app_* as G_OS_UNIX


svn path=/trunk/; revision=6178
2007-12-20 19:13:18 +00:00
Alexander Larsson
71768c8426 File attribute renames: std:: -> standard:: fs:: -> filesystem:: id::fs ->
2007-12-20  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
        * gfileattribute.c:
        * gfileinfo.c:
        * gfileinfo.h:
        * gfilenamecompleter.c:
        * glocalfile.c:
        * glocalfileinfo.c:
        * gpollfilemonitor.c:
	File attribute renames:
	std:: -> standard::
	fs:: -> filesystem::
	id::fs -> id::filesystem


svn path=/trunk/; revision=6170
2007-12-20 13:30:47 +00:00
Alexander Larsson
33c055feb1 Add GMountUnmountFlags to all unmount and eject calls. Add
2007-12-20  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        * gdrive.[ch]:
        * gmount.[ch]:
        * gvolume.[ch]:
        * gunixmount.c:
        * gunixvolume.c:
        * gio.symbols:
	Add GMountUnmountFlags to all unmount and
	eject calls.
	Add g_mount_remount() call.



svn path=/trunk/; revision=6169
2007-12-20 11:48:14 +00:00
Alexander Larsson
ba464215e7 Fix unused variable warning
2007-12-20  Alexander Larsson  <alexl@redhat.com>

	* gvfs.c (get_default_vfs):
	Fix unused variable warning


svn path=/trunk/; revision=6168
2007-12-20 10:57:45 +00:00
Matthias Clasen
10378099cd Updates
svn path=/trunk/; revision=6167
2007-12-20 03:16:02 +00:00
Matthias Clasen
aef5a4b0ab Remove C99 comments
svn path=/trunk/; revision=6166
2007-12-20 03:12:24 +00:00
Matthias Clasen
864200c753 Additions
svn path=/trunk/; revision=6165
2007-12-20 03:11:11 +00:00
Alexander Larsson
28d1c8e0ad Make g_io_modules_load_all_in_directory not unuse loaded modules so that
2007-12-19  Alexander Larsson  <alexl@redhat.com>

        * giomodule.c:
	Make g_io_modules_load_all_in_directory not unuse
	loaded modules so that users of it can do stuff
	before unloading.
	Init internal "module" types.
	Initialize static prio and name for types so that
	we don't have to load modules to get it.
	
        * gnativevolumemonitor.h:
	* gvolumemonitor.h:
	Move is_supported to parent class so that
	non-native monitors can avoid being initialized
	too. (For instance GDaemonVolumeMonitor if we're
	not using GDaemonVfs.)
	
        * glocaldirectorymonitor.[ch]:
        * glocalfilemonitor.[ch]:
	* gunionvolumemonitor.c:
        * gunixvolumemonitor.c:
        * gvfs.c:
	Find plugins using the static prio+name to
	avoid unnecessarily loading the modules.


svn path=/trunk/; revision=6159
2007-12-19 16:08:55 +00:00
Alexander Larsson
13f33931fc Remove warnings
2007-12-19  Alexander Larsson  <alexl@redhat.com>

        * giomodule.c:
	Remove warnings


svn path=/trunk/; revision=6157
2007-12-19 13:18:34 +00:00
Alexander Larsson
1fbd06d85b Store the native type as GType, not class so that we can unload it. But
2007-12-19  Alexander Larsson  <alexl@redhat.com>

        * gunionvolumemonitor.c:
	Store the native type as GType, not class so that
	we can unload it. But still avoid unnecessarily
	unload modules.


svn path=/trunk/; revision=6156
2007-12-19 13:10:22 +00:00
David Zeuthen
88679aba98 Introduce g_volume_monitor_adopt_orphan_mount() function. Also add signals
2007-12-19  David Zeuthen  <davidz@redhat.com>

	Introduce g_volume_monitor_adopt_orphan_mount() function. Also
	add signals 'disconnected' and 'eject-button' on GDrive. Add
	signal 'removed' on GVolume and 'unmounted' on GMount.

	* gdrive.c: (g_drive_base_init):
	* gdrive.h:
	* gfile.c: (g_file_mount_mountable),
	(g_file_mount_enclosing_volume):
	* gio.symbols:
	* gioerror.h:
	* gmount.c: (g_mount_base_init):
	* gmount.h:
	* gunionvolumemonitor.c: (g_volume_monitor_adopt_orphan_mount):
	* gunixvolumemonitor.c: (update_volumes), (update_mounts):
	* gvolume.c: (g_volume_base_init), (g_volume_mount):
	* gvolume.h:
	* gvolumemonitor.h:


svn path=/trunk/; revision=6153
2007-12-19 09:39:50 +00:00
Matthias Clasen
0debd52858 Fix up includes in section docs
svn path=/trunk/; revision=6149
2007-12-18 02:52:11 +00:00
Alexander Larsson
c4e3cfbf40 Add is_supported() to GNativeVolumeMonitorClass so that we can avoid
2007-12-17  Alexander Larsson  <alexl@redhat.com>

        * gnativevolumemonitor.h:
        * gunionvolumemonitor.c:
        * gunixvolumemonitor.c:
	Add is_supported() to GNativeVolumeMonitorClass so
	that we can avoid having to create an object to see
	if the backend is supported at runtime.
	Also add name member and an env var to pick a specific
	volume monitor backend.
	
        * gmountprivate.h:
        * glocalfile.c:
	Add cancellable to _g_mount_get_for_mount_path()
	
        * glocaldirectorymonitor.c:
        * glocalfilemonitor.c:
	Avoid loading and unloading modules while sorting.



svn path=/trunk/; revision=6144
2007-12-17 16:00:33 +00:00
Matthias Clasen
feb5258cf9 Namespace waste reduction, move some g_get_unix_mount functions to the
2007-12-17  Matthias Clasen  <mclasen@redhat.com>

        * gio.symbols:
        * gunixmounts.[hc]: Namespace waste reduction, move some
        g_get_unix_mount functions to the g_unix_mount namespace.

        * gunixmounts.c:
        * gunixvolumemonitor.c:
        * glocalfile.c:
        * glocaldirectorymonitor.c: Update all callers.

        * gunixmounts.h: Remove leftover g_unix_get_canonical_device_path


svn path=/trunk/; revision=6143
2007-12-17 14:59:23 +00:00
Alexander Larsson
19e895d818 Add doc comments about what GFile operations are guaranteed to not block.
2007-12-17  Alexander Larsson  <alexl@redhat.com>

        * gfile.c:
	Add doc comments about what GFile operations are
	guaranteed to not block.


svn path=/trunk/; revision=6142
2007-12-17 11:26:34 +00:00
Alexander Larsson
6ad96b3677 Add missing #ifdef fixing OSX build. (#503334, patch from Richard Hult)
2007-12-17  Alexander Larsson  <alexl@redhat.com>

        * gunixmounts.c:
	Add missing #ifdef fixing OSX build.
	(#503334, patch from Richard Hult)



svn path=/trunk/; revision=6141
2007-12-17 10:53:53 +00:00
David Zeuthen
f4add8f0fa Provide eject() on both GMount and GVolume and utility functions to guess
2007-12-14  David Zeuthen  <davidz@redhat.com>

	* Makefile.am:
	* gio.symbols:
	* gmount.c: (g_mount_get_uuid), (g_mount_can_eject),
	(g_mount_eject), (g_mount_eject_finish):
	* gmount.h:
	* gunionvolumemonitor.c: (g_union_volume_monitor_finalize),
	(get_volume_for_uuid), (get_mount_for_uuid),
	(g_union_volume_monitor_class_init),
	(get_default_native_type_with_exclude), (get_default_native_type),
	(get_native_type), (update_native_type),
	(g_union_volume_monitor_init), (_g_mount_get_for_mount_path):
	* gunixmount.c: (_g_unix_mount_new), (g_unix_mount_get_uuid),
	(g_unix_mount_can_eject), (eject_unmount_cb),
	(eject_unmount_read_error), (eject_unmount_do),
	(g_unix_mount_unmount), (g_unix_mount_eject),
	(g_unix_mount_eject_finish), (g_unix_mount_mount_iface_init):
	* gunixmounts.c: (g_unix_mount_guess_can_eject),
	(g_unix_mount_point_guess_can_eject):
	* gunixmounts.h:
	* gunixvolume.c: (_g_unix_volume_new), (g_unix_volume_get_uuid),
	(g_unix_volume_can_eject), (g_unix_volume_get_drive),
	(eject_mount_cb), (eject_mount_read_error), (eject_mount_do),
	(g_unix_volume_mount), (g_unix_volume_eject),
	(g_unix_volume_eject_finish), (g_unix_volume_volume_iface_init):
	* gunixvolumemonitor.c: (get_volume_for_uuid),
	(get_mount_for_uuid), (g_unix_volume_monitor_class_init),
	(update_mounts):
	* gvolume.c: (g_volume_get_uuid), (g_volume_can_eject),
	(g_volume_eject), (g_volume_eject_finish):
	* gvolume.h:
	* gvolumemonitor.c: (g_volume_monitor_get_volume_for_uuid),
	(g_volume_monitor_get_mount_for_uuid):
	* gvolumemonitor.h:

	Provide eject() on both GMount and GVolume and utility functions
	to guess whether a GUnixMountPoint or GUnixMountEntry should be
	ejected. Introduce the concept of UUID's and wire it into GVolume
	and GMount and provide API on GVolumeMonitor to find such
	instances. Also handle the case where an external
	GNativeVolumeMonitor fails to initialize. Lock around the
	_g_get_mount_for_mount_path() function such that volume monitor
	implementations won't have to do locking themselves.



svn path=/trunk/; revision=6140
2007-12-17 09:31:08 +00:00
Matthias Clasen
2e3f48993d Documentation updates
svn path=/trunk/; revision=6138
2007-12-17 07:04:51 +00:00
Matthias Clasen
53c5a8122b More doc fixups
svn path=/trunk/; revision=6134
2007-12-15 06:05:40 +00:00
Matthias Clasen
f5d2feddf6 Fix up docs
svn path=/trunk/; revision=6133
2007-12-15 06:03:35 +00:00
Matthias Clasen
2f3aef1617 Use hash iterators
svn path=/trunk/; revision=6132
2007-12-15 04:39:26 +00:00
Alexander Larsson
f506365079 Move GFileAttributeValue to a private header, as its sort of ugly.
2007-12-14  Alexander Larsson  <alexl@redhat.com>

	* Makefile.am:
        * gfileattribute.[ch]:
        * gfileattribute-priv.h:
	Move GFileAttributeValue to a private header, as
	its sort of ugly.
	
        * gfile.[ch]:
	Make set_attribute take a type + a pointer instead
	of a GFileAttributeValue.
	
        * gfileinfo.[ch]:
	Fix up for above changes.
	Add g_file_info_get_attribute_data to get
	all info in one call, g_file_info_get_attribute_status
	to get the status and g_file_info_get_attribute_as_string.
	
        * gio.symbols:
        * glocalfile.c:
        * glocalfileinfo.[ch]:
	Update for changes
	
        * gunixmounts.c:
	Make _guess_type static.


svn path=/trunk/; revision=6129
2007-12-14 15:56:56 +00:00
Yevgen Muntyan
2ceae92eeb Say Makefile.am instead of gio/Makefile.am in changelog
svn path=/trunk/; revision=6128
2007-12-14 14:36:08 +00:00
Yevgen Muntyan
887e45888d Moved the ChangeLog entry to gio/ChangeLog
svn path=/trunk/; revision=6127
2007-12-14 14:34:11 +00:00
Yevgen Muntyan
ee5aacbc61 Fixed build when srcdir != builddir, made mkenums and friends use
2007-12-14  Yevgen Muntyan  <muntyan@tamu.edu>

	* gio/Makefile.am:
	* gio/inotify/Makefile.am: Fixed build when srcdir != builddir,
	made mkenums and friends use temporary files to avoid leaving
	empty generated files on failure (#503470).


svn path=/trunk/; revision=6126
2007-12-14 14:28:35 +00:00
Alexander Larsson
3abace8118 Fix AKS -> ASK typo
2007-12-14  Alexander Larsson  <alexl@redhat.com>

        * gmountoperation.h:
	Fix AKS -> ASK typo


svn path=/trunk/; revision=6120
2007-12-14 11:17:44 +00:00
Alexander Larsson
4cb6eab803 Clean up all flags enums to not have _FLAGS in them Make the names of some
2007-12-14  Alexander Larsson  <alexl@redhat.com>

        * gappinfo.h:
        * gfile.[ch]:
        * gfileattribute.[ch]:
        * gio.symbols:
        * glocalfile.c:
        * glocalfileoutputstream.c:
        * gmountoperation.[ch]:
        * goutputstream.[ch]:
	Clean up all flags enums to not have _FLAGS in them
	Make the names of some of the enums better.

        * glocalfileinfo.c:
	Fix warning


svn path=/trunk/; revision=6119
2007-12-14 11:07:31 +00:00
Michael Natterer
0f8f543230 fix g_io_scheduler symbol names.
2007-12-14  Michael Natterer  <mitch@imendio.com>

	* gio.symbols: fix g_io_scheduler symbol names.


svn path=/trunk/; revision=6118
2007-12-14 10:59:10 +00:00
Alexander Larsson
ced2927726 Only allow including <gio/gio.h> from apps
2007-12-14  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * fam/Makefile.am:
        * gappinfo.h:
        * gasyncresult.h:
        * gbufferedinputstream.h:
        * gbufferedoutputstream.h:
        * gcancellable.h:
        * gcontenttype.h:
        * gdatainputstream.h:
        * gdataoutputstream.h:
        * gdesktopappinfo.h:
        * gdirectorymonitor.h:
        * gdrive.h:
        * gfile.h:
        * gfileattribute.h:
        * gfileenumerator.h:
        * gfileicon.h:
        * gfileinfo.h:
        * gfileinputstream.h:
        * gfilemonitor.h:
        * gfilenamecompleter.h:
        * gfileoutputstream.h:
        * gfilterinputstream.h:
        * gfilteroutputstream.h:
        * gicon.h:
        * ginputstream.h:
        * gio.h:
        * gioerror.h:
        * giomodule.h:
        * gioscheduler.h:
        * gloadableicon.h:
        * gmemoryinputstream.h:
        * gmemoryoutputstream.h:
        * gmount.h:
        * gmountoperation.h:
        * goutputstream.h:
        * gseekable.h:
        * gsimpleasyncresult.h:
        * gthemedicon.h:
        * gunixinputstream.h:
        * gunixmounts.h:
        * gunixoutputstream.h:
        * gvfs.h:
        * gvolume.h:
        * gvolumemonitor.h:
        * inotify/Makefile.am:
	Only allow including <gio/gio.h> from apps


svn path=/trunk/; revision=6117
2007-12-14 10:35:24 +00:00
Alexander Larsson
3db93c01b7 Rename gioscheduler calls so they all use the g_io_schedule_ prefix. Split
2007-12-14  Alexander Larsson  <alexl@redhat.com>

        * gioscheduler.[ch]:
        * gsimpleasyncresult.c:
	Rename gioscheduler calls so they all use the g_io_schedule_ prefix.
	Split out the send_to_mainloop call into two versions instead
	of having the block argument.


svn path=/trunk/; revision=6116
2007-12-14 09:42:59 +00:00
Alexander Larsson
2ae689e31f g_push/pop_current_cancellable -> g_cancellable_push/pop_current
2007-12-13  Alexander Larsson  <alexl@redhat.com>

        * gcancellable.[ch]:
        * gio.symbols:
        * gbufferedinputstream.c:
        * gfileenumerator.c:
        * gfileinputstream.c:
        * gfileoutputstream.c:
        * ginputstream.c:
        * gioscheduler.c:
        * goutputstream.c:
	g_push/pop_current_cancellable ->
	g_cancellable_push/pop_current


svn path=/trunk/; revision=6115
2007-12-13 16:48:06 +00:00
Alexander Larsson
f6b9b4f45e Rename g_mount_for_location to g_file_mount_enclosing_volume.
2007-12-13  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        * gio.symbols:
	Rename g_mount_for_location to g_file_mount_enclosing_volume.


svn path=/trunk/; revision=6114
2007-12-13 16:22:43 +00:00
Alexander Larsson
77162a7c7c G_PASSWORD_FLAGS_ANON_SUPPORTED -> G_PASSWORD_FLAGS_ANONYMOUS_SUPPORTED
2007-12-13  Alexander Larsson  <alexl@redhat.com>

        * gmountoperation.h:
	G_PASSWORD_FLAGS_ANON_SUPPORTED -> G_PASSWORD_FLAGS_ANONYMOUS_SUPPORTED


svn path=/trunk/; revision=6106
2007-12-13 13:35:25 +00:00
Alexander Larsson
afc16811d8 Fix race condition when freeing proxy in g_io_job_send_to_mainloop().
2007-12-12  Alexander Larsson  <alexl@redhat.com>

        * gioscheduler.c:
	Fix race condition when freeing proxy in
	g_io_job_send_to_mainloop().



svn path=/trunk/; revision=6105
2007-12-12 19:34:19 +00:00
Alexander Larsson
1c57670f19 Make attribute namespace separator "::" instead of ":". Use - instead of _
2007-12-12  Alexander Larsson  <alexl@redhat.com>

        * gfileattribute.c:
        * gfileinfo.[ch]:
        * glocalfile.c:
        * glocalfileinfo.c:
	Make attribute namespace separator "::" instead of ":".
	Use - instead of _ as separator in attribute names.


svn path=/trunk/; revision=6104
2007-12-12 15:50:45 +00:00
Alexander Larsson
ab7ff4c6a0 s/parent/parent_instance/ in GObjects
2007-12-12  Alexander Larsson  <alexl@redhat.com>

        * gbufferedinputstream.h:
        * gbufferedoutputstream.h:
        * gdatainputstream.h:
        * gdataoutputstream.h:
        * gdirectorymonitor.h:
        * gfileenumerator.h:
        * gfileinputstream.h:
        * gfilemonitor.h:
        * gfileoutputstream.h:
        * gfilterinputstream.h:
        * gfilteroutputstream.h:
        * ginputstream.h:
        * glocalfileinputstream.h:
        * glocalfileoutputstream.h:
        * gmemoryinputstream.h:
        * gmemoryoutputstream.h:
        * gnativevolumemonitor.h:
        * goutputstream.h:
        * gunixinputstream.h:
        * gunixoutputstream.h:
        * gvfs.h:
        * gvolumemonitor.h:
	s/parent/parent_instance/ in GObjects


svn path=/trunk/; revision=6102
2007-12-12 14:33:20 +00:00
Alexander Larsson
01e1ab6e68 No need for padding for interfaces
2007-12-12  Alexander Larsson  <alexl@redhat.com>

        * gdrive.h:
        * gmount.h:
        * gvolume.h:
	No need for padding for interfaces


svn path=/trunk/; revision=6101
2007-12-12 14:03:36 +00:00
Alexander Larsson
41d1650c9b Fix up a bunch of details in the docs.
2007-12-12  Alexander Larsson  <alexl@redhat.com>

        * gappinfo.[ch]:
        * gasyncresult.c:
        * gbufferedinputstream.c:
        * gbufferedoutputstream.c:
        * gcancellable.c:
        * gcontenttype.c:
        * gdatainputstream.[ch]:
        * gdesktopappinfo.c:
        * gdirectorymonitor.c:
        * gfile.[ch]:
        * gfileattribute.[ch]:
        * gfileicon.[ch]:
        * gfileinfo.h:
        * gfileinputstream.h:
        * gfilemonitor.[ch]:
        * gfileoutputstream.[ch]:
        * gfilterinputstream.h:
        * gfilteroutputstream.h:
        * gicon.h:
        * gioscheduler.c:
        * gloadableicon.[ch]:
        * gmemoryinputstream.c:
        * gmountoperation.c:
        * gthemedicon.c:
	Fix up a bunch of details in the docs.

        * glocalfileinfo.c:
	CR/LF -> LF fixups


svn path=/trunk/; revision=6100
2007-12-12 12:19:02 +00:00
David Zeuthen
3ca9fd4dbb Rework how volumes, drives and volume monitoring is done. Previosly the
2007-12-11  David Zeuthen  <davidz@redhat.com>

	Rework how volumes, drives and volume monitoring is
	done. Previosly the model was

	 GDrive <1-1> GVolume

	where a GDrive instance represented a mount point and a GVolume
	instance represented a mounted file system. This patch changes it
	the model to

		GDrive <1-N> GVolume <1-1> GMount

	where GMount now serves the purpose of the old GVolume and the new
	GVolume serves the purpose of the old GDrive. In addition the new
	GDrive interface is used to represent a collection of GVolume
	instances (typically partitions) and also contains utility to query
	the state of the physical drive the GDrive object represents (such
	as checking for media, polling the drive, ejecting the media etc.).

	Also implement mounting and unmounting in the Unix volume monitor
	backend. A subquent patch will introduce GDrive support for ejection
	of media.

	* Makefile.am:
	* gdrive.c: (g_drive_is_media_check_automatic),
	(g_drive_is_media_removable), (g_drive_has_media),
	(g_drive_can_poll_for_media), (g_drive_eject),
	(g_drive_eject_finish), (g_drive_poll_for_media),
	(g_drive_poll_for_media_finish):
	* gdrive.h:
	* gfile.c: (g_file_find_enclosing_mount):
	* gfile.h:
	* gio.symbols:
	* glocaldirectorymonitor.c:
	(g_local_directory_monitor_constructor), (mounts_changed):
	* glocalfile.c: (get_mount_info),
	(g_local_file_find_enclosing_mount),
	(g_local_file_file_iface_init):
	* gnativevolumemonitor.h:
	* gunionvolumemonitor.c: (get_mounts), (get_volumes),
	(get_connected_drives), (g_union_volume_monitor_class_init),
	(child_volume_added), (child_volume_removed),
	(child_volume_changed), (child_mount_added), (child_mount_removed),
	(child_mount_pre_unmount), (child_mount_changed),
	(child_drive_changed), (g_union_volume_monitor_add_monitor),
	(g_union_volume_monitor_remove_monitor),
	(_g_mount_get_for_mount_path):
	* gunixmounts.c: (g_unix_is_mount_path_system_internal),
	(guess_system_internal), (_g_get_unix_mounts),
	(_g_get_unix_mount_points), (g_get_unix_mount_at),
	(g_unix_mount_free), (g_unix_mount_compare),
	(g_unix_mount_get_mount_path), (g_unix_mount_get_device_path),
	(g_unix_mount_get_fs_type), (g_unix_mount_is_readonly),
	(g_unix_mount_is_system_internal), (g_unix_mount_guess_type),
	(type_to_icon), (g_unix_mount_guess_name),
	(g_unix_mount_guess_icon), (g_unix_mount_point_guess_name),
	(g_unix_mount_point_guess_icon), (_canonicalize_filename),
	(_resolve_symlink), (_resolve_dev_root):
	* gunixmounts.h:
	* gunixvolume.c: (g_unix_volume_finalize), (_g_unix_volume_new),
	(_g_unix_volume_disconnected), (_g_unix_volume_set_mount),
	(_g_unix_volume_unset_mount), (g_unix_volume_get_icon),
	(g_unix_volume_get_name), (g_unix_volume_can_mount),
	(g_unix_volume_get_drive), (g_unix_volume_get_mount),
	(_g_unix_volume_has_mount_path), (mount_cb), (mount_read_error),
	(g_unix_volume_mount), (g_unix_volume_mount_finish),
	(g_unix_volume_volume_iface_init):
	* gunixvolume.h:
	* gunixvolumemonitor.c: (g_unix_volume_monitor_finalize),
	(get_mounts), (get_volumes), (get_connected_drives),
	(get_mount_for_mount_path), (g_unix_volume_monitor_class_init),
	(mountpoints_changed), (mounts_changed),
	(g_unix_volume_monitor_init),
	(_g_unix_volume_monitor_lookup_volume_for_mount_path),
	(find_mount_by_mountpath), (update_volumes), (update_mounts):
	* gunixvolumemonitor.h:
	* gvolume.c: (g_volume_get_mount), (g_volume_can_mount),
	(g_volume_mount), (g_volume_mount_finish):
	* gvolume.h:
	* gvolumemonitor.c: (g_volume_monitor_class_init),
	(g_volume_monitor_get_connected_drives),
	(g_volume_monitor_get_volumes), (g_volume_monitor_get_mounts):
	* gvolumemonitor.h:


svn path=/trunk/; revision=6095
2007-12-11 21:23:55 +00:00
Matthias Clasen
a26502d794 Close the gap
svn path=/trunk/; revision=6091
2007-12-10 18:54:24 +00:00
Matthias Clasen
355d85b171 Install gdesktopappinfo as unix-specific api
svn path=/trunk/; revision=6090
2007-12-10 18:51:21 +00:00
Tor Lillqvist
83445755b3 Add some more G_OS_WIN32 conditionals to silence gcc warnings.
2007-12-10  Tor Lillqvist  <tml@novell.com>

	* glocalfile.c: Add some more G_OS_WIN32 conditionals to silence
	gcc warnings.


svn path=/trunk/; revision=6088
2007-12-10 15:24:53 +00:00
15:08:59 Tim Janik
cc3de68e21 http://mail.gnome.org/archives/gtk-devel-list/2007-October/msg00089.html
2007-12-10 15:08:59  Tim Janik  <timj@imendio.com>

        * let g_warn_if_fail replace g_assert as discussed here:
          http://mail.gnome.org/archives/gtk-devel-list/2007-October/msg00089.html

        * fix bug #502498: Test framework assertion failures should follow
        gcc error format.

        * gmessages.h, gmessages.c: deprecated g_assert_warning() which is
        unused now. removed g_assert*() definitions whcih are provided by 
        gtestutils.h now. added g_warn_if_reached() and g_warn_if_fail()  
        which are recommended as g_assert/g_assert_not_reached replacements
        for non-test programs.
        added g_warn_message() to implement g_warn_*() macros.
        use emacs-next-error friendly formatting for file:line: for warnings.

        * gtestutils.h, gtestutils.c: use emacs-next-error friendly formatting.
        implement g_assert_not_reached() with g_assertion_message() and
        g_assert() in terms of g_assertion_message_expr() so we'll be able to
        provide assertion messages in test logs.

        * gkeyfile.c, gbookmarkfile.c: changed g_assert*() to g_warn_if_fail()
        or g_return_if_fail() where suitable.

        * gio/: changed g_assert to g_warn_if_fail.



svn path=/trunk/; revision=6086
2007-12-10 14:07:42 +00:00
Alexander Larsson
51eb9d19bd Don't hardcode '/' (#502727)
2007-12-10  Alexander Larsson  <alexl@redhat.com>

	* gfile.c (g_file_set_display_name):
	Don't hardcode '/' (#502727)


svn path=/trunk/; revision=6084
2007-12-10 11:19:41 +00:00
Hans Breuer
d527cd5d9b follow lib naming convention working implementation for user and group
2007-12-09  Hans Breuer  <hans@breuer.org>

	* makefile.msc : follow lib naming convention
	* glocalfileinfo.c(win32_get_file_user_info) : working implementation
	for user and group name, tested with ../tests/gio-ls


svn path=/trunk/; revision=6080
2007-12-09 22:10:40 +00:00
A. Walton
ab69ee2945 More documentation cleanup and filling in missing information, bringing
2007-12-09  A. Walton  <awalton@svn.gnome.org>

	* gdesktopappinfo.c:
	* gdrive.c:
	* gdrive.h:
	* gfile.c:
	* gfile.h:
	* gfileattribute.c:
	* gfileenumerator.c:
	* gioerror.c:
	* gioscheduler.c:
	* gioscheduler.h:
	* gloadableicon.c:
	* gmemoryinputstream.c:
	* gmemoryoutputstream.c:
	* goutputstream.h:
	* gsimpleasyncresult.c:
	More documentation cleanup and filling in missing information, 
bringing
	GIO to 99% symbol coverage.

svn path=/trunk/; revision=6077
2007-12-09 15:51:12 +00:00
Hans Breuer
b877c83cdc removed -GD to compile with msvc9 (vs2008) with less complains
2007-12-09  Hans Breuer  <hans@breuer.org>

	* **/makefile.msc glib/makefile.msc.in : removed -GD to compile
	with msvc9 (vs2008) with less complains
	
	* glibconfig.h.win32.in : #define G_HAVE_ISO_VARARGS 1 for
	msv8 (vs2005) and above
	
	* glib/gfileutils.c : s/stricmp/_stricmp/
	* msvc_recommended_pragmas.h : work around Microsoft's premature 
	attempt to deprecate the C-Library

	* tests/makefile.msc.in : added checksum-test


svn path=/trunk/; revision=6076
2007-12-09 14:38:26 +00:00
Christian Persch
3c3d3e25ff Add forgotten #ifdef G_OS_WIN32 to fix the build on linux.
2007-12-08  Christian Persch  <chpe@gnome.org>

	* gio/glocalfileinfo.c: (get_thumbnail_attributes): Add forgotten
	#ifdef G_OS_WIN32 to fix the build on linux.

svn path=/trunk/; revision=6074
2007-12-08 14:29:37 +00:00
Hans Breuer
a33f8a7564 [gio compiles and links on win32, not sure how much already works] ifdefed
2007-12-08  Hans Breuer  <hans@breuer.org>

	[gio compiles and links on win32, not sure how much already works]
	* glocaldirectorymonitor.c : ifdefed out inotify emulation for win32
	* glocalfile.c : use HAVE_UNISTD_H; implement file system size info 
	base on win32 API; prefer g_lstat() over lstat(); instead of 
	localtime_r() use an all GLib implementation on win32;
	get_mount_info() still needs a win32 specifc implementation
	* glocalfileinfo.c : use HAVE_*_H; start of implementation of 
	win32_get_file_user_info to get owner/group info without uid/gid
	* glocalfileinputstream.c : include <io.h> on win32
	* glocalfileoutputstream.c : include <io.h> on win32 and some S_IS*
	definition, use g_win32_ftruncate() for G_OS_WIN32
	* gwin32appinfo.c : optionalize a bunch on #ifdef AssocQueryString
	it is available with mingw/w32api but a mess with the M$ Platform SDKs
	see: http://mail.gnome.org/archives/gtk-devel-list/2007-December/msg00014.html
	* makefile.msc : updated


svn path=/trunk/; revision=6070
2007-12-08 12:01:06 +00:00
Alexander Larsson
14d96a3061 Avoid warning spew if error == NULL
2007-12-07  Alexander Larsson  <alexl@redhat.com>

	* glocalfileenumerator.c (_g_local_file_enumerator_new):
	Avoid warning spew if error == NULL


svn path=/trunk/; revision=6065
2007-12-07 11:47:31 +00:00
Alexander Larsson
59cf55a08f Update docs wrt etags
2007-12-07  Alexander Larsson  <alexl@redhat.com>

	* gfile.c:
	Update docs wrt etags


svn path=/trunk/; revision=6064
2007-12-07 09:16:32 +00:00
Alexander Larsson
6356a9dd98 Include sys/types.h for dev_t (#501919)
2007-12-06  Alexander Larsson  <alexl@redhat.com>

	* glocalfileinfo.h:
	Include sys/types.h for dev_t (#501919)



svn path=/trunk/; revision=6057
2007-12-06 09:33:59 +00:00
Behdad Esfahbod
66f1845caa Make abicheck and pltcheck pass.
2007-12-06  Behdad Esfahbod  <behdad@gnome.org>

        * gio.symbols:
        * pltcheck.sh:
        Make abicheck and pltcheck pass.


svn path=/trunk/; revision=6054
2007-12-06 05:39:18 +00:00
Alexander Larsson
3869c33a73 Added.
2007-12-05  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * giomodule-priv.h: Added.
        * glocaldirectorymonitor.c:
        * glocalfilemonitor.c:
        * gunionvolumemonitor.c:
        * gvfs.c:
	Actually add the declaration of _g_io_modules_ensure_loaded


svn path=/trunk/; revision=6051
2007-12-05 11:10:21 +00:00
Alexander Larsson
4f039bd490 Fix warnings
2007-12-05  Alexander Larsson  <alexl@redhat.com>

        * gdatainputstream.c:
	Fix warnings
	
        * gio.symbols:
        * giomodule.[ch]
        * glocaldirectorymonitor.c:
        * glocalfilemonitor.c:
        * gunionvolumemonitor.c:
        * gvfs.c:
	Make g_io_modules_ensure_loaded a private function and
	don't pass in the dirname. This means we can do magic
	directory finding in the win32 version.
	Export the actual load-modules-in-directory code so that
	gvfs can reuse that.


svn path=/trunk/; revision=6050
2007-12-05 11:05:49 +00:00
Alexander Larsson
2c362b7f9e Rename all struct members named: read, write, close, truncate, or mount to
2007-12-05  Alexander Larsson  <alexl@redhat.com>

        * gbufferedinputstream.c:
        * gbufferedoutputstream.c:
        * gdrive.[ch]:
        * gfile.[ch]:
        * gfileenumerator.[ch]:
        * gfileinputstream.c:
        * gfileoutputstream.[ch]:
        * gfilterinputstream.c:
        * gfilteroutputstream.c:
        * ginputstream.[ch]:
        * glocalfile.c:
        * glocalfileenumerator.c:
        * glocalfileinputstream.c:
        * glocalfileoutputstream.c:
        * gmemoryinputstream.c:
        * gmemoryoutputstream.c:
        * goutputstream.[ch]:
        * gseekable.[ch]:
        * gunixdrive.c:
        * gunixinputstream.c:
        * gunixoutputstream.c:
	Rename all struct members named:
	read, write, close, truncate, or mount
	to foo_fn, as these are reserved names
	and could be defined as macros in libc.
	(#501645)


svn path=/trunk/; revision=6048
2007-12-05 10:38:03 +00:00
Emmanuele Bassi
d013d46b98 Replace the copy-and-paste MD5 digest generation with GChecksum.
2007-12-04  Emmanuele Bassi  <ebassi@gnome.org>

	* gio/glocalfileinfo.c: Replace the copy-and-paste MD5 digest
	generation with GChecksum.

svn path=/trunk/; revision=6043
2007-12-04 16:33:24 +00:00
Alexander Larsson
74e95b90d2 Only call flush if non-null.
2007-12-04  Alexander Larsson  <alexl@redhat.com>

        * goutputstream.c:
        (g_output_stream_close):
	Only call flush if non-null.


svn path=/trunk/; revision=6040
2007-12-04 10:44:49 +00:00
Dan Winship
117de38f04 Make this take a GError and return a gboolean, and do the "outstanding
2007-11-30  Dan Winship  <danw@gnome.org>

	* ginputstream.c (g_input_stream_set_pending): Make this take a
	GError and return a gboolean, and do the "outstanding operation"
	check (and the "stream is already closed" check) itself.
	(g_input_stream_clear_pending): Formerly set_pending(FALSE).

	* goutputstream.c (g_output_stream_set_pending)
	(g_output_stream_clear_pending): Likewise

	* gbufferedinputstream.c: 
	* gfileinputstream.c: 
	* gfileoutputstream.c: Update for that

	* gsimpleasyncresult.c (g_simple_async_report_gerror_in_idle):
	Like g_simple_async_report_error_in_idle, but takes a GError
	rather than building one.


svn path=/trunk/; revision=6039
2007-12-04 08:57:04 +00:00
Dan Winship
b22aa6dde6 Don't cheat and unset the "pending" flag around inner calls. Instead, call
2007-11-30  Dan Winship  <danw@gnome.org>

	* goutputstream.c: Don't cheat and unset the "pending" flag around
	inner calls. Instead, call the class method directly rather than
	the wrapper function that checks "pending"


svn path=/trunk/; revision=6038
2007-12-04 08:55:51 +00:00
Behdad Esfahbod
a38a770636 Fix EXTRA_DIST automake warnings. (#501107)
2007-12-03  Behdad Esfahbod  <behdad@gnome.org>

        * glib/gnulib/Makefile.am: Fix EXTRA_DIST automake warnings. (#501107)


svn path=/trunk/; revision=6029
2007-12-04 00:35:42 +00:00
Hans Breuer
43ae389211 [start of port to win32/msvc] HAVE_UNIST_H and _pipe() only include
2007-12-03  Hans Breuer  <hans@breuer.org>

	[start of port to win32/msvc]
	* gcancellable.c : HAVE_UNIST_H and _pipe()
	* gcontenttype.c : only include <dirent.h> in the UNIX branch
	* gdatainputstream.c : pointer arithmetic on void* is a gcc extension
	* gdummyfile.c glocalfileinputstream.c gsimpleasyncresult.c : use 
	HAVE_UNIST_H
	* glocalfileoutputstream.c : use HAVE_UNIST_H and s/ssize_t/gssize/
	* glocalvfs.c : use HAVE_PWD_H
	* gio.symbols : ifdef unix specific functions with G_OS_UNIX
	* makefile.msc : new file (maybe later converted to makefile.msc.in)
	* Makefile.am : added to EXTRA_DIST

svn path=/trunk/; revision=6027
2007-12-03 22:37:44 +00:00
Matthias Clasen
e6588b7a23 Improve docs
svn path=/trunk/; revision=6020
2007-12-03 18:25:24 +00:00
Alexander Larsson
7561ec5765 Add xattr checks for OSX style API (#500506) 2007-12-03 Alexander Larsson
2007-12-03  Alexander Larsson  <alexl@redhat.com>

        * configure.in:
	Add xattr checks for OSX style API (#500506)
2007-12-03  Alexander Larsson  <alexl@redhat.com>

        * glocalfileinfo.c:
	Handle OSX style xattrs API (#500506)



svn path=/trunk/; revision=6017
2007-12-03 10:23:03 +00:00
Alexander Larsson
6394ae6fdb Add G_FILE_COPY_NO_FALLBACK_FOR_MOVE flag
2007-12-03  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        * glocalfile.c:
	Add G_FILE_COPY_NO_FALLBACK_FOR_MOVE flag



svn path=/trunk/; revision=6015
2007-12-03 09:11:48 +00:00
A. Walton
6f605509fd Documentation accuracy fixes.
2007-12-02  A. Walton  <awalton@svn.gnome.org>

	* gfile.c:
	* gfileattribute.c:
	Documentation accuracy fixes.


svn path=/trunk/; revision=6014
2007-12-02 12:32:27 +00:00
Behdad Esfahbod
be869457d4 Fix typo.
2007-12-01  Behdad Esfahbod  <behdad@gnome.org>

        * gioenumtypes.c.template: Fix typo.


svn path=/trunk/; revision=6013
2007-12-01 23:49:34 +00:00
Matthias Clasen
264aa4cd8a Make threadsafe get_type() functions.
2007-12-01  Matthias Clasen <mclasen@redhat.com>

        * gioenumtypes.c.template: Make threadsafe get_type() functions.



svn path=/trunk/; revision=6011
2007-12-01 17:40:19 +00:00
Matthias Clasen
2e67aabed7 Some more property work
svn path=/trunk/; revision=6008
2007-12-01 06:12:45 +00:00
Matthias Clasen
e919f0198b Don't mark buffer-size property as construct-only
svn path=/trunk/; revision=6007
2007-12-01 05:28:46 +00:00
Matthias Clasen
d8266ffb8f Add properties
svn path=/trunk/; revision=6006
2007-12-01 05:25:40 +00:00
Matthias Clasen
650c65e892 Doc improvements
svn path=/trunk/; revision=6005
2007-12-01 04:38:29 +00:00
Matthias Clasen
af5372bfe2 Add properties
svn path=/trunk/; revision=6004
2007-12-01 04:29:14 +00:00
Matthias Clasen
651efa855c Add properties
svn path=/trunk/; revision=6003
2007-12-01 02:53:34 +00:00
Matthias Clasen
ff0acf0af6 Templates for enum registration
2007-11-30  Matthias Clasen <mclasen@redhat.com>

        * gioenumtypes.[hc].template: Templates for enum registration

        * Makefile.am: Generate gioenumtypes.[hc]

        * gio.h: Include gioenumtypes.h
        * gappinfo.h:
        * gfile.h: Add some explicit nicks.

        * gio.symbols: Add new symbols

        * pltcheck.sh: Adjust



svn path=/trunk/; revision=6002
2007-12-01 01:53:00 +00:00
Matthias Clasen
c524cabff2 Add docs for etags
svn path=/trunk/; revision=6001
2007-11-30 18:11:03 +00:00
Matthias Clasen
3d8579f93a Explain I/O priorieties
svn path=/trunk/; revision=6000
2007-11-30 05:51:10 +00:00
Matthias Clasen
a2ca589703 More coding style fixes
svn path=/trunk/; revision=5999
2007-11-30 05:11:25 +00:00
Matthias Clasen
d80f09239e More doc improvements
svn path=/trunk/; revision=5997
2007-11-29 20:35:23 +00:00
Andrew Walton
2ae7c09063 Quick Changelog fix.
svn path=/trunk/; revision=5995
2007-11-29 10:24:48 +00:00
Andrew Walton
0c867d3444 Fixes unknown meaning in GAppLaunchContext docs. Clarify asynchronous ops.
* gappinfo.c:
	  Fixes unknown meaning in GAppLaunchContext docs.
	* gfile.c:
	  Clarify asynchronous ops.
	* gfileattribute.c:
	  Fix entity tag docs.
	* gicon.c:
	* gthemedicon.c:
	  Provides missing gtk-doc section, fixes API docs slighly.
	* gsimpleasyncresult.c:
	  Fill in missing info in docs.
	* gunixinputstream.c:
	* gunixoutputstream.c:
	  Be more expressive in short description.
	* gunixvolume.c:
	  Remove gtk-doc stubs for non-public API.


svn path=/trunk/; revision=5994
2007-11-29 10:18:55 +00:00
Matthias Clasen
09471fec46 Coding style fixups
svn path=/trunk/; revision=5993
2007-11-29 07:17:59 +00:00
Matthias Clasen
7c0e098f4e Don't export the inotify lock
svn path=/trunk/; revision=5992
2007-11-29 03:39:01 +00:00
Matthias Clasen
af101f1c9f Fix copy-and-paste leftovers
svn path=/trunk/; revision=5981
2007-11-28 18:45:08 +00:00
Matthias Clasen
07526e709a Improve consistency of enumerations
svn path=/trunk/; revision=5979
2007-11-28 18:38:53 +00:00
Alexander Larsson
d9594f5709 Removed unnecessary file
2007-11-28  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * gdriveprivate.h:
	Removed unnecessary file
	
        * gdesktopappinfo.[ch]:
        * gdummyfile.[ch]:
        * gfile.c:
        * glocaldirectorymonitor.[ch]:
        * glocalfile.[ch]:
        * glocalfileenumerator.[ch]:
        * glocalfileinputstream.[ch]:
        * glocalfilemonitor.[ch]:
        * glocalfileoutputstream.[ch]:
        * glocalvfs.[ch]:
        * gnativevolumemonitor.c:
        * gpollfilemonitor.[ch]:
        * gunionvolumemonitor.[ch]:
        * gunixdrive.[ch]:
        * gunixvolume.[ch]:
        * gunixvolumemonitor.[ch]:
        * gvfs.c:
        * gvolumeprivate.h:
        * inotify/ginotifydirectorymonitor.[ch]:
        * inotify/ginotifyfilemonitor.[ch]:
        * inotify/inotify-helper.c:
	Append _ to all internal functions
	
        * gio.symbols:
	Add missing symbols
	Export symbols needed for modules


svn path=/trunk/; revision=5977
2007-11-28 16:01:59 +00:00
Emmanuele Bassi
6ce14033c7 Remove makegioalias.pl from the marshal files and avoid it being cleaned
2007-11-28  Emmanuele Bassi  <ebassi@gnome.org>

	* gio/Makefile.am: Remove makegioalias.pl from the marshal files
	and avoid it being cleaned up when running make clean.

svn path=/trunk/; revision=5974
2007-11-28 14:42:29 +00:00
Alexander Larsson
7f3280230b Added. Added. Added. Added.
2007-11-28  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * abicheck.sh: Added.
        * makegioalias.pl: Added.
        * pltcheck.sh: Added.
        * gio.symbols: Added.
	* *.c:
        * inotify/*.c
	Initial work on adding symbol handling.

	* gvfs.h:
	Correct ifdef guard name

        * fam/Makefile.am:
        * inotify/Makefile.am:
        * xdgmime/Makefile.am:
	Include toplevel Makefile.decl


svn path=/trunk/; revision=5972
2007-11-28 12:39:07 +00:00
Matthias Clasen
61582bd91c Another round of trivial doc fixes
svn path=/trunk/; revision=5970
2007-11-28 06:43:33 +00:00
Matthias Clasen
54e52e099e More trivial doc fixes
svn path=/trunk/; revision=5968
2007-11-28 06:01:13 +00:00
Matthias Clasen
442e8df1b8 Clean up some docs
svn path=/trunk/; revision=5966
2007-11-28 04:29:02 +00:00
Andre Klapper
98c89274e1 Fix a typo.
2007-11-28  Andre Klapper  <a9016009@gmx.de>

	* gdesktopappinfo.c: Fix a typo.


svn path=/trunk/; revision=5962
2007-11-27 23:59:38 +00:00
Andre Klapper
1b4453a12f Fix a typo.
2007-11-27  Andre Klapper  <a9016009@gmx.de>

	* glocalfileoutputstream.c: Fix a typo.


svn path=/trunk/; revision=5959
2007-11-27 16:29:54 +00:00
Alexander Larsson
575c279d1c Don't include removed headers
2007-11-27  Alexander Larsson  <alexl@redhat.com>

	* gio.h:
	Don't include removed headers


svn path=/trunk/; revision=5957
2007-11-27 15:21:50 +00:00
Alexander Larsson
77657981f0 Removed. Removed. Added. Added. Renamed GSocket*Stream to GUnix*Stream and
2007-11-27  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * gsocketinputstream.[ch]: Removed.
        * gsocketoutputstream.[ch]: Removed.
        * gunixinputstream.[ch]: Added.
        * gunixoutputstream.[ch]: Added.
	Renamed GSocket*Stream to GUnix*Stream and made
	it unix-only, since its not really only for sockets
	and it only works on unix (but is highly useful there).



svn path=/trunk/; revision=5956
2007-11-27 15:08:03 +00:00
Alexander Larsson
e3607fcdf3 Moved gurifuncs from gio to glib
2007-11-27  Alexander Larsson  <alexl@redhat.com>

        * gio/Makefile.am:
        * gio/gurifuncs.[ch]:
        * glib/Makefile.am:
        * glib/gstring.[ch]:
        * glib/gurifuncs.[ch]:
	Moved gurifuncs from gio to glib


svn path=/trunk/; revision=5955
2007-11-27 14:57:45 +00:00
Alexander Larsson
68c74ba68f Move g_format_file_size_for_display from gio to glib
2007-11-27  Alexander Larsson  <alexl@redhat.com>

        * gio/gfileinfo.[ch]:
        * glib/gfileutils.[ch]:
        Move g_format_file_size_for_display from gio to glib


svn path=/trunk/; revision=5954
2007-11-27 14:30:31 +00:00
Andrew Walton
5247f12f36 Bumps documentation to 93% symbol coverage, touching most
of the public files. Fixes broken function documentation prototypes. 
	Fixes GCancellable inaccuracies. Removes unnecessary incomplete 
	gtk-doc headers in private files.

svn path=/trunk/; revision=5953
2007-11-27 14:00:13 +00:00
Juerg Billeter
6d071b4ab6 New functions for efficient access to buffer and simple single byte reads.
2007-11-27  Juerg Billeter  <j@bitron.ch>

	* gbufferedinputstream.c: (g_buffered_input_stream_peek_buffer),
	(g_buffered_input_stream_read_byte):
	* gbufferedinputstream.h:
	New functions for efficient access to buffer and simple single byte
	reads.

	* gdatainputstream.c: (scan_for_newline), (scan_for_chars),
	(g_data_input_stream_read_until):
	* gdatainputstream.h:
	Use peek_buffer to avoid memcpy in scan_for_newline, implement
	read_until with multiple stop chars.

svn path=/trunk/; revision=5952
2007-11-27 13:44:48 +00:00
Alexander Larsson
2490a699be Allow configuration of gio-module-dir
2007-11-27  Alexander Larsson  <alexl@redhat.com>

        * configure.in:
	Allow configuration of gio-module-dir
	
        * gio-2.0.pc.in:
	Export giomodules location as giomodule variable

2007-11-27  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * fam/Makefile.am:
        * inotify/Makefile.am:
	Use the user-specified giomoduledir


svn path=/trunk/; revision=5951
2007-11-27 12:39:14 +00:00
Alexander Larsson
9bd5e0d8e2 Makefile.am Add catch-all gio.h header Don't install gdummyfile.h
2007-11-27  Alexander Larsson  <alexl@redhat.com>

	* Makefile.am
	* gio.h:
	Add catch-all gio.h header
	Don't install gdummyfile.h


svn path=/trunk/; revision=5950
2007-11-27 10:46:45 +00:00
Matthias Clasen
13195ef836 Fix up a doc comment
svn path=/trunk/; revision=5943
2007-11-26 20:42:17 +00:00
Alexander Larsson
a78c4e833f Remove trailing whitespace
2007-11-26  Alexander Larsson  <alexl@redhat.com>

	* Makefile.am (gioinclude_HEADERS):
	Remove trailing whitespace
	


svn path=/trunk/; revision=5942
2007-11-26 16:36:52 +00:00
Alexander Larsson
3781343738 gio/ docs/reference/gio Merged gio-standalone into glib.
2007-11-26  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * configure.in:
        * gio-2.0-uninstalled.pc.in:
        * gio-2.0.pc.in: 
        * gio-unix-2.0-uninstalled.pc.in:
        * gio-unix-2.0.pc.in:
	* gio/
	* docs/reference/gio
	Merged gio-standalone into glib.
	
        * glib/glibintl.h:
        * glib/gutils.c:
	Export glib_gettext so that gio can use it
	Add P_ (using same domain for now)
	Add I_ as g_intern_static_string


svn path=/trunk/; revision=5941
2007-11-26 16:13:05 +00:00