Commit Graph

3911 Commits

Author SHA1 Message Date
Matthias Clasen
d102cf2b0f Fix the build
The thumbnail-verification test (indirectly) includes individual
headers, so define GIO_COMPILATION to make it work.
2014-01-19 08:58:28 -05:00
Marc-André Lureau
38a6ab3e0e win32: silence build warning
glocalfile.c: In function 'g_local_file_measure_size_of_file':
glocalfile.c:2654:3: warning: passing argument 2 of 'g_lstat' from
incompatible pointer type [enabled by default]
   if (g_lstat (name->data, &buf) != 0)
   ^
In file included from glocalfile.c:68:0:
../glib/gstdio.h:135:5: note: expected 'struct GStatBuf *' but argument
is of type 'struct _stati64 *'

https://bugzilla.gnome.org/show_bug.cgi?id=711547
2014-01-19 08:28:31 -05:00
Marc-André Lureau
a8f58fcfec win32: silence build warning
gdbusauthmechanismexternal.c: In function 'mechanism_client_initiate':
gdbusauthmechanismexternal.c:355:3: warning: 'initial_response' may be
used uninitialized in this function [-Wmaybe-uninitialized]
   return initial_response;
   ^
gdbusauthmechanismexternal.c:332:10: note: 'initial_response' was
declared here

https://bugzilla.gnome.org/show_bug.cgi?id=711547
2014-01-19 08:26:47 -05:00
Marc-André Lureau
2873b3c20c win32: silence build warning
glocalfileinfo.c: In function '_g_local_file_info_get':
glocalfileinfo.c:1955:11: warning: passing argument 3 of
'get_thumbnail_attributes' from incompatible pointer type [enabled by
default]
           get_thumbnail_attributes (path, info, &statbuf);
           ^
glocalfileinfo.c:1285:1: note: expected 'const struct GStatBuf *' but
argument is of type 'struct _stati64 *'
 get_thumbnail_attributes (const char     *path,

https://bugzilla.gnome.org/show_bug.cgi?id=711547
2014-01-19 08:25:33 -05:00
Ryan Lortie
9e81c07ad6 GSimpleAction: fix mistake in last commit
Some bad copy-paste happening here...
2014-01-18 14:27:26 -05:00
Ryan Lortie
1ec71144fb GSimpleAction: add default activate handler
If the action is stateful and the user doesn't have their own activate handler
then do some reasonable things for ourselves.

After a lot of experience using stateful GSimpleAction it turns out that
people almost always end up using it in the same ways:

A boolean-typed stateful action with no parameter is most likely going
to want to be toggled.  Any other type of action that has the parameter
type equal to the state type probably intends for activation to
represent a request to change the state.

This patch implements those two cases.  This will let people stop
writing their own trivial handlers over and over.

https://bugzilla.gnome.org/show_bug.cgi?id=722503
2014-01-18 14:19:37 -05:00
Ryan Lortie
e5f91951a1 GApplication: change commandline encoding policy
Clarify in the documentation that the commandline arguments passed
around by GApplication (to local_command_line and returned via
g_application_command_line_get_arguments()) are in the GLib filename
encoding (ie: UTF-8) on Windows, not the system code page.

Fix the mismatch that would result from having argv passed to
g_application_run() in main() on Windows (where it is in the system
code page) by ignoring argc/argv on Windows and calling
g_win32_get_command_line() for ourselves.  Document this.

This might be a slight API break on Windows: we documented that it was
possible to call g_application_run() with arguments other than argc/argv
and now doing that will result in those arguments being ignored.  It has
always been recommended practice to only call g_application_run() from
main() directly, however, and all of our code examples have shown only
this.  We will see if this causes any issues and consider reevaluating
the situation if so.

https://bugzilla.gnome.org/show_bug.cgi?id=722025
2014-01-17 20:06:37 -05:00
Ryan Lortie
643f2b348d g_file_new_for_commandline_arg: clarify encoding
Add a note to the documentation for g_file_new_for_commandline_arg()
that this function is intended to operate on strings already in the GLib
filename encoding on Windows.

This has been the case for a long time, but this documents the
requirement.

https://bugzilla.gnome.org/show_bug.cgi?id=722025
2014-01-17 20:05:41 -05:00
Marc-André Lureau
d3c729bf0e gio: fix small memory leak on local xattr
g_strconcat() allocates memory, it needs to be freed.

==10653== 1,400 bytes in 50 blocks are definitely lost in loss record
1,838 of 1,851
==10653==    at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10653==    by 0x54ACB22: g_malloc (gmem.c:102)
==10653==    by 0x54ACE4D: g_malloc_n (gmem.c:343)
==10653==    by 0x54C8463: g_strconcat (gstrfuncs.c:589)
==10653==    by 0x4D6ED38: get_xattrs_from_fd (glocalfileinfo.c:660)
==10653==    by 0x4D71622:
_g_local_file_info_get_from_fd (glocalfileinfo.c:2028)
==10653==    by 0x4D731A0:
g_local_file_input_stream_query_info (glocalfileinputstream.c:356)
==10653==    by 0x4C996D8:
g_file_input_stream_query_info (gfileinputstream.c:148)
==10653==    by 0x4C863F6: file_copy_fallback (gfile.c:3120)
==10653==    by 0x4C86DD2: g_file_copy (gfile.c:3398)

https://bugzilla.gnome.org/show_bug.cgi?id=722357
2014-01-16 20:27:26 -05:00
Jasper St. Pierre
c4934c9358 Update .gitignore 2014-01-15 10:37:59 -05:00
Ryan Lortie
bcd276c2b4 more distcheck fixes 2014-01-13 17:23:22 -05:00
Ryan Lortie
4130118a72 giomodule test: fix again
The compiled modules will be in the G_TEST_BUILT directory, not _DIST.
2014-01-13 16:12:31 -05:00
Ryan Lortie
186965fc9b giomodule test: force shared library build
http://lists.gnu.org/archive/html/bug-libtool/2013-05/msg00009.html hit
us again.  libtool only builds .so files if we install the library, so
force it to build for our testcase, even if we don't install it.
2014-01-13 15:31:38 -05:00
Rico Tzschichholz
60cca82c9d gdesktopinfo: Fix typo in "Since" annotation of has_key 2014-01-13 12:33:35 +01:00
Ryan Lortie
d3017967d8 GApplication: allow handles_commandline and service
The default local_command_line handler has a fast return path for the
case that we handle the commandline by forwarding it to the primary
instance, but this doesn't account for the fact that we may want to
become a service.

Allow for this by making sure we don't take the fast path of the service
flag is set.
2014-01-10 11:17:44 -05:00
Ryan Lortie
e8b7dd32fc GApplication: add --gapplication-service switch
Add a --gapplication-service switch to the default implementation of
local_command_line.  This name is unlikely to clash with any option used
by an existing application.

When a normal application (neither service nor launcher) is launched with
exactly this one argument, G_APPLICATION_IS_SERVICE will be set.

The idea is that people will write their D-Bus service file with
--gapplication-service on the Exec line.  This provides a nice
compromise for people who want the benefits of DBusActivatable
applications but without losing the ability to easily run them directly
(under the debugger or inside jhbuild, etc.)

https://bugzilla.gnome.org/show_bug.cgi?id=710965
2014-01-09 16:15:53 -05:00
Ryan Lortie
8bc63b0ef0 gdbus-introspection test: test escaping attributes
Make sure attribute values are properly escaped in generated XML.

https://bugzilla.gnome.org/show_bug.cgi?id=721796
2014-01-08 22:58:06 -05:00
Ryan Lortie
04ee782486 gdbus: properly escape introspection annotations
Make sure we escape any special characters that are found in annotation
names or values to avoid emitting a malformed XML document in response
to an Introspect call.

https://bugzilla.gnome.org/show_bug.cgi?id=721796
2014-01-08 22:58:06 -05:00
Matthias Clasen
3872049445 Add includes to all gio docs 2014-01-07 22:55:43 -05:00
Chun-wei Fan
589aed9383 gio/tests/giomodule.c: Use G_MODULE_SUFFIX
The file extension of the GIO module could be something other than .so,
depending on platform.  Use G_MODULE_SUFFIX so that the test will run
correctly on non-*nix platforms, such as Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=719344
2014-01-04 10:44:17 +08:00
Matthias Clasen
2b289cc565 Fix make install with --disable-installed-tests
If installed tests are not enabled, installed_testdir is not
defined, so we end up trying to create /modules and to chmod
things in /x-content/, which is not right.
2014-01-02 13:36:37 -05:00
Ryan Lortie
c09cfc1c8a GFile: fix uninitialised variable
clang cause the fact that some of our 'goto out;' cases cause use to try
and free an uninitialised GString.  Fix that up.
2014-01-02 12:54:12 -05:00
Ryan Lortie
51b3dd7332 GDBusConnection: don't write to stdout
When losing the D-Bus connection, we would write to stdout about it just
before killing ourselves with SIGTERM.  We're a library, so we should
probably use stderr instead.

https://bugzilla.gnome.org/show_bug.cgi?id=721324
2014-01-02 10:08:55 -05:00
Ryan Lortie
8976175ba9 gsettings: tweak test for last commit
The last commit changed the behaviour of child objects of delayed
GSettings.  Adjust the testcase accordingly.
2014-01-02 01:55:07 -05:00
Ryan Lortie
c7636ce64b g_settings_get_child(): inherit backend
Part of the purpose of g_settings_get_child() was that it could be used
after you delay() a GSettings object, and then apply() all of the
settings together.  In order for that to work, we need to share the
backend.

https://bugzilla.gnome.org/show_bug.cgi?id=720891
2014-01-02 01:50:40 -05:00
Matthias Clasen
11ddb843b9 Make /contenttype/tree test work installed
The x-content/win32-software type is only recognized if
the autorun.exe file is executable. Since the file is installed
as data, we need to fix up its permissions in an
install-data-hook.
2014-01-01 22:30:24 -05:00
Matthias Clasen
dba1ae12a8 Avoid a compiler warning 2014-01-01 22:01:15 -05:00
Colin Walters
97d9138f6c gio/tests: Fix usage of BUILT_SOURCES 2014-01-01 19:05:34 -05:00
Matthias Clasen
680c348bb4 Add missing includes
config.h needs to be included in every source file, first.
2014-01-01 17:59:21 -05:00
Matthias Clasen
2299bcd88d Improve GResourceFile test coverage 2014-01-01 17:59:21 -05:00
Matthias Clasen
3eeeb7aaa7 Improve gsettings test coverage 2014-01-01 17:59:21 -05:00
Matthias Clasen
1041fc2190 Improve gdbus test coverage 2014-01-01 17:59:21 -05:00
Matthias Clasen
df3ac947ac Improve converter test coverage 2014-01-01 17:59:21 -05:00
Matthias Clasen
354ae1d61c Add tests for remote actions
This improves the GApplication test coverage.
2014-01-01 17:59:21 -05:00
Matthias Clasen
8aeb391a77 Improve GIOModule test coverage
Add a dedicated test for GIOModule.
2014-01-01 17:59:21 -05:00
Matthias Clasen
7bea4bd89a Correct a doc comment 2014-01-01 17:59:21 -05:00
Matthias Clasen
5bcbb98f45 GIOModule: Add some more details to the docs 2014-01-01 17:59:21 -05:00
Matthias Clasen
0356d7f4c3 Fix a typo in a comment
The D-Bus interface is org.freedesktop.DBus.Peer, not
org.freedesktop.DBus.
2014-01-01 17:59:21 -05:00
Matthias Clasen
b5ba22f163 Add a generic property test
This test is inspired by its namesake in GTK+. We instantiate
all types, and check the default values of their properties,
with some exceptions for types that are known not to work.
2014-01-01 17:59:21 -05:00
Matthias Clasen
290b46cd24 GTlsPassword: Make declared defaults match
String properties typically start out with a value of NULL.
No reason to deviate from that convention here.
2014-01-01 17:59:20 -05:00
Matthias Clasen
3a37e403e6 Make GFileIcon more robust
No reason not to survive g_object_unref (g_object_new (...))
2014-01-01 17:59:20 -05:00
Matthias Clasen
34de9189f6 Make GEmblem more robust
No reason not to survive g_object_unref (g_object_new (...)).
2014-01-01 17:59:20 -05:00
Matthias Clasen
62b28546af Trivial formatting fixes 2014-01-01 17:59:20 -05:00
Matthias Clasen
6c75ba2b90 Add tests for x-content type sniffing
This test exercises the tree matching parts of gcontenttype.c
2014-01-01 17:59:20 -05:00
Matthias Clasen
159459bc2d Simplify fileattributematcher tests a bit
Just use assertions instead of pretty-printed error messages.
2014-01-01 17:59:20 -05:00
Matthias Clasen
3bbfd90880 Improve GApplicationCommandline test coverage
Add tests for many GApplicationCommandline apis to the
existing application tests.
2014-01-01 17:59:20 -05:00
Matthias Clasen
7846d6154a Improve GSubprocess test coverage
Test the synchronous communicate functions.
2014-01-01 17:59:20 -05:00
Matthias Clasen
e021bb9101 Improve GInitable test coverage
This just adds a bit more variety to the uses of GInitiable
in other tests.
2014-01-01 17:59:20 -05:00
Jasper St. Pierre
0c87f71521 codegen: direction defaults to "in" 2013-12-31 15:39:02 -05:00
Antoine Jacoutot
fb21c8eaab kqueue: fix a potential deadlock
In case an object is already monitored, we lock then return without
unlocking it which can then result in a self deadlock. So properly
unlock before returning.

https://bugzilla.gnome.org/show_bug.cgi?id=721074
2013-12-26 19:57:44 +01:00