Commit Graph

3757 Commits

Author SHA1 Message Date
Stef Walter
a638be8a79 Revert "giomodule: Fix leaks in module loading"
This reverts commit dc72039c16.

This depends on a patch that allows GTypeModule to be finalized.
Lets put this back in bugzilla until that gets in.
2013-11-11 17:17:10 +01:00
Chun-wei Fan
0212ab6182 Tests: Fix up the expected messages
There was an expected messages that was not in the form that GLib on
Windows actually produces, which causes some test to fail.  Fix this up.

https://bugzilla.gnome.org/show_bug.cgi?id=711047
2013-11-11 22:40:57 +08:00
Chun-wei Fan
b27a2d436b gio/tests/gsubprocess.c: Fix on Windows
We need to check for the correct line endings on Windows (\r\n) for the
echo tests and currently need to skip the test_echo_eof test there, as
it depends on the cat utility that is not normally found on Windows, and
using an external installation of cat via MSYS or Cygwin would render the
test program to hang as cat waits for user input.

https://bugzilla.gnome.org/show_bug.cgi?id=711047
2013-11-11 22:38:05 +08:00
Dan Winship
fff14a5b7c gcancellable: don't use g_cancellable_connect() in GCancellableSource
g_cancellable_connect() is documented as calling its callback only
once, but GCancellableSource should trigger every time the cancellable
is cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=710691
https://bugzilla.gnome.org/show_bug.cgi?id=711286
2013-11-11 09:28:07 -05:00
Stef Walter
670379b26f gdbus-connection-loss: Fix leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 08:46:45 +01:00
Stef Walter
14b27eaab8 gdbus-introspection: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 08:46:33 +01:00
Stef Walter
dc72039c16 giomodule: Fix leaks in module loading
https://bugzilla.gnome.org/show_bug.cgi?id=711798
2013-11-11 07:22:48 +01:00
Stef Walter
91c8fb82fe gdbus-connection: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 07:12:53 +01:00
Stef Walter
f80e2695e1 gdbus-connection-slow: Fix leak in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 07:12:37 +01:00
Stef Walter
0d51ff79ed gdbus-connection: Fix use after free in test
https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 07:12:26 +01:00
Stef Walter
95526b5db5 gsubprocess: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 07:12:18 +01:00
Stef Walter
fe3c878c53 gsubprocess: Fix error detection logic in tests
Various tests were depending on local_error being set by a callback
when it could never have been the case. Simplify async error detection
logic in those cases, and fix leak of GError.

https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 07:12:00 +01:00
Stef Walter
78ad171da9 g-icon: Fix memory leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 07:11:29 +01:00
Stef Walter
faafd4c051 contexts: Fix memory leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 07:11:22 +01:00
Stef Walter
438f7110f9 data-output-stream: Fix some access after free
The memory pointed to by a GMemoryOutputStream can be realloc'd

https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 07:11:14 +01:00
Stef Walter
72171240cc buffered-output-stream: Fix some access after free
The memory pointed to by a GMemoryOutputStream can be realloc'd

https://bugzilla.gnome.org/show_bug.cgi?id=711802
2013-11-11 07:10:59 +01:00
Stef Walter
419b47e166 gtestdbus: Fix leak of GMainLoop
https://bugzilla.gnome.org/show_bug.cgi?id=711808
2013-11-11 06:55:09 +01:00
Michael Catanzaro
ae6dbb35cb giomodule: small typo in documentation 2013-11-09 09:35:14 -06:00
Matthias Clasen
0cb8454b5c Small documentation improvement 2013-11-08 20:57:04 -05:00
Rico Tzschichholz
83d4278197 Revert "gio/Makefile: make sure to dist gappinfoprivate.h"
This reverts commit c45b26d61f.
2013-11-08 08:15:43 +01:00
Ryan Lortie
bda60c3e8b GAppInfoMonitor: don't try to use NULL hash table
Don't g_hash_table_iter_init() on a NULL table if we see the app info
monitoring but no monitors have been created yet.

https://bugzilla.gnome.org/show_bug.cgi?id=711632
2013-11-07 13:56:56 -05:00
Ryan Lortie
ffbf866d3b GApplication: fix bogus testcase
We had a GApplication testcase that handled both open and commandline.
This only way that this worked was by implementing the commandline
handler without actually setting the HANDLES_COMMAND_LINE flag.

This behaviour is now invalid, so just rip out the offending part of the
test.

https://bugzilla.gnome.org/show_bug.cgi?id=711099
2013-11-07 13:51:05 -05:00
Ryan Lortie
6e0bbd8adb appinfo: Add some testcases for searching
https://bugzilla.gnome.org/show_bug.cgi?id=711557
2013-11-07 12:41:27 -05:00
Ryan Lortie
3d32d5359a Add g_desktop_app_info_search()
The first time this function is called we load all of the keyfiles in
the directory, ignoring the 'Hidden' ones and build an index out of the
interesting fields using g_str_tokenize_and_fold().

We do prefix matching on the tokens to find relevent desktop files.

Right now this is implemented as a hashtable that we iterate over,
checking prefixes on each token.  This could possibly be sped up by
creating an array, but it's already pretty fast...

https://bugzilla.gnome.org/show_bug.cgi?id=711557
2013-11-07 12:41:27 -05:00
Ryan Lortie
c45b26d61f gio/Makefile: make sure to dist gappinfoprivate.h 2013-11-07 12:41:27 -05:00
Rico Tzschichholz
ffb39bff6f gio: Add gappinfoprivate.h to Makefile.am
In addition to e55d33edc1
2013-11-07 17:37:13 +01:00
Chun-wei Fan
87e6db8deb codegen.py: Rearrange GLib Version Check
...so that the generated code will build on all platforms, as compilers
like Visual C++ does not like #ifdef checks during a definition/use of
a macro.

https://bugzilla.gnome.org/show_bug.cgi?id=711049
2013-11-07 09:25:54 +08:00
Ryan Lortie
e55d33edc1 Add GAppInfoMonitor
This is a simple object that emits a "change" signal when the installed
applications may have changed in some way.

https://bugzilla.gnome.org/show_bug.cgi?id=711556
2013-11-06 11:26:53 -05:00
Ryan Lortie
86ce3bf48e gdesktopappinfo: keep a list of files in the dirs
In each DesktopFileDir, store a list of desktop files for that
directory.  This speeds up opening desktop files by name because we can
skip statting in directories that we know don't have the file and also
speeds up _get_all() because we can avoid enumeration.

This also improves our support for dealing with names like
'kde4/kate.desktop' (equivalent to kde4-kate.desktop) since we find out
about all of these files are the start and don't need to guess about
which '-' to change to a '/'.  It also means that we can easily deal
with more than one level of such prefixes.

We use a file monitor to watch for changes, invalidating our lists when
we notice them.

https://bugzilla.gnome.org/show_bug.cgi?id=711520
2013-11-06 10:56:25 -05:00
Chun-wei Fan
f493114280 gio/tests: Clean up inclusion of unistd.h
Include unistd.h only on *NIX and define items as necessary on Windows,
also replace instances of ssize_t with the GLib-equivilant gssize so to fix
the build on platforms that do not have ssize_t, such as Visual C++.

https://bugzilla.gnome.org/show_bug.cgi?id=711047
2013-11-04 22:55:30 +08:00
Chun-wei Fan
39a62a064b gio/test/resources.c: Fix for Windows
We need to use g_content_type_get_mime_type() to look up the mime type of
the file from the registry on the content type that was acquired on
Windows, as g_file_info_get_content_type() does not acquire the
file mime type (unlike on *NIX).

g_content_type_get_mime_type() on *NIX is more or less an no-op as it
simply returns the g_strdup()-ed version of the passed-in content type.

This will enable the resources test to pass on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=711047
2013-11-04 10:30:57 +08:00
Ross Lagerwall
89f9615835 gio: Don't allow skipping past the end of GLocalFileInputStream
The overridden implementation of the skip method for
GLocalFileInputStream allows skipping past the end of the file which is
inconsistent with the documentation.  Prevent this by first seeking to
the end of the file and then seeking backwards from there as much as
is necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=711048
2013-11-03 06:47:33 +02:00
Ross Lagerwall
e2fcb77cb0 gio: Clean up trashinfo file if trashing fails
https://bugzilla.gnome.org/show_bug.cgi?id=687202
2013-10-31 06:31:43 +02:00
Xavier Claessens
e94df7cfc2 Tests: It is useless to unset "DBUS_SESSION_BUS_ADDRESS" manually
If the goal is to make sure we don't have a dbus connection, it has
to call g_test_dbus_unset() instead which is much more complete.

In this case, g_test_dbus_unset() is called already, so it should be
fine.

https://bugzilla.gnome.org/show_bug.cgi?id=697348
2013-10-29 13:42:35 -04:00
Xavier Claessens
06fbdb04d5 GTestDBus: Make sure only DBUS_SESSION_BUS_ADDRESS is set by default
g_test_dbus_unset() now also unset DBUS_STARTER_ADDRESS and
DBUS_STARTER_BUS_TYPE.

https://bugzilla.gnome.org/show_bug.cgi?id=697348
2013-10-29 13:42:14 -04:00
Xavier Claessens
940fa98290 Tests: add session_bus_run() and use it where possible
This is to avoid having again the subtil bug in dbus-appinfo.c:
session_bus_down() was called before g_test_run() so the test was
running on the user's dbus session.

https://bugzilla.gnome.org/show_bug.cgi?id=697348
2013-10-29 13:30:22 -04:00
Colin Walters
5280c03368 tests/gdbus-introspection: Add a less trivial test case for _IGNORE_QUALIFIED
This is distilled from PackageKit which currently aborts on startup.

https://bugzilla.gnome.org/show_bug.cgi?id=665634
2013-10-29 09:37:06 -07:00
Lars Uebernickel
425f307b01 gtk-notification-backend: remove unused variable
A reference to the session bus is now stored in GNotificationBackend.
Remove the extraneous one in the gtk backend and stop using it in
withdraw_notification.

https://bugzilla.gnome.org/show_bug.cgi?id=711051
2013-10-29 09:01:35 -07:00
Ross Lagerwall
1a037b1408 gio: Clear error properly to prevent crash
https://bugzilla.gnome.org/show_bug.cgi?id=711070
2013-10-29 17:00:30 +02:00
Ryan Lortie
c8aba61713 GCancellable: drop lock for callback during connect()
Don't hold the lock when calling the user's callback during
g_cancellable_connect() for the case that the cancellable has already
fired.

Taken from a patch by Alex Larsson.

Doc updates from Colin Walters.

https://bugzilla.gnome.org/show_bug.cgi?id=705395
2013-10-29 10:49:48 -04:00
Chun-wei Fan
61e8e1cd02 gio/gsubprocess.c: Use g_snprintf()
snprintf() is unfortunately still not universally available, so use
g_snprintf() to ensure the build works on all platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=711049
2013-10-29 22:44:11 +08:00
Ryan Lortie
b227528f32 GSettingsSchemaSource: fix parameter name in header
list_schemas() had the parameters called 'recursive' and 'non-recursive'
in the header instead of 'relocatable'.  Fix that.
2013-10-28 20:50:01 -07:00
Ryan Lortie
abb9a746f4 exporter: give error on Describe of missing action
If someone calls org.gtk.Actions.Describe on a non-existent action then
return an exception instead of a trivial description (disabled, no
state, etc.).

https://bugzilla.gnome.org/show_bug.cgi?id=687185
2013-10-28 18:11:46 -07:00
Ryan Lortie
e275b8bc6c exporter: give error on Describe of missing action
If someone calls org.gtk.Actions.Describe on a non-existent action then
return an exception instead of a trivial description (disabled, no
state, etc.).

https://bugzilla.gnome.org/show_bug.cgi?id=687185
2013-10-28 18:08:21 -07:00
Ryan Lortie
83869120bb GSimpleAction: don't allow changing state type
g_object_set() allowed us to bypass the usual checks that the state
doesn't change type and also leaked.

Fix that up by turning the state into a construct property (so that it
always gets set once during construction, even if only to NULL) and
then route the further sets through the C API so that they are subject
to the same checks.

https://bugzilla.gnome.org/show_bug.cgi?id=696424
2013-10-28 18:08:16 -07:00
Ryan Lortie
908d7d6d6a glib-compile-schemas: ignore qualified tags/attrs
Ignore qualified (in the XML namespace sense) tags and attributes when
compiling GSettings schemas.

This will allow people to add custom tags and attributes to their schemas
without tripping up the compiler.

https://bugzilla.gnome.org/show_bug.cgi?id=635641
2013-10-28 15:30:25 -07:00
Ryan Lortie
9933a9f904 GDBus: ignore qualified XML tags and attributes
Ignore qualified (in the XML namespace sense) tags and attributes when
parsing D-Bus introspection XML.

This will allow people to add custom tags and attributes to their D-Bus
interfaces without tripping up GDBus.

https://bugzilla.gnome.org/show_bug.cgi?id=665634
2013-10-28 15:28:51 -07:00
Ryan Lortie
0d89d38cac GSettings: fix for loop in 'extends' functionality
Obvious mistake :(
2013-10-28 12:10:13 -07:00
Ryan Lortie
b30486985b gsettings(1): stop using deprecated APIs
Stop using the recently-deprecated GSettings APIs.

Use the GSettingsSchema-based APIs instead.

This fixes a number of bugs and also a net reduction of code. In
particular, list-schemas will now work in context of a given --schemadir
argument.

https://bugzilla.gnome.org/show_bug.cgi?id=695558
2013-10-28 11:49:10 -07:00
Ryan Lortie
a1a4dbf6ff gsettings(1): use global variables
The number of arguments passed to each function is about to increase, so
just use global variables instead.

This is a commandline tool, after all...

https://bugzilla.gnome.org/show_bug.cgi?id=695558
2013-10-28 11:48:32 -07:00