Commit Graph

4081 Commits

Author SHA1 Message Date
Matthias Clasen
dc496ac764 Add a test for GMenuAttributeIter 2014-06-05 08:04:47 -04:00
Matthias Clasen
90671cd3cd docs: Add missing language annotations 2014-06-01 09:38:49 -04:00
Matthias Clasen
a484719033 docs: Fix up varargs documentation
gtk-doc expects varargs to be documented in a specific way,
otherwise it complains.
2014-05-31 10:54:02 -04:00
Dan Winship
84fd73b2fa gio/tests/network-address: fix when no network is available
GResolver doesn't do full validation of its inputs, so in some of
these tests, the fact that we were getting back
G_RESOLVER_ERROR_NOT_FOUND is because the junk string was getting
passed to an upstream DNS resolver, which returned NXDOMAIN. But if
there's no network on the machine then we'd get
G_RESOLVER_ERROR_INTERNAL instead in that case.
2014-05-27 09:42:50 -04:00
Ryan Lortie
6f7dc3a44f gio tests: rm xdgconfighome on 'make clean' 2014-05-26 23:01:56 +02:00
Evan Nemerson
570b27b9ac gio: port annotations from the Vala metadata.
https://bugzilla.gnome.org/show_bug.cgi?id=730493
2014-05-23 10:04:06 -07:00
Murray Cumming
2a27b72522 GDBusError enum: Remove trailing comma.
This is helpful to people using the g++ --pedantic option.
2014-05-22 12:46:07 +02:00
Philip Withnall
cdb9670dc3 gdbus-tool: Remove dead variables
Coverity issues: #1159447, #1159446

https://bugzilla.gnome.org/show_bug.cgi?id=730295
2014-05-20 11:03:02 +01:00
Philip Withnall
e1243d11f0 gsubprocess: Add a missing va_end() call
Coverity issues: #1214070, #1214069

https://bugzilla.gnome.org/show_bug.cgi?id=730278
2014-05-20 11:01:37 +01:00
Philip Withnall
7f5cc2c3c5 gsocket: Add missing preconditions to g_socket_send_message()
https://bugzilla.gnome.org/show_bug.cgi?id=730190
2014-05-15 14:35:19 +01:00
Philip Withnall
60e459b196 gresource-tool: Fix an FD leak in an error path
Coverity issues: #1214054, #1214055, #1214056
2014-05-15 14:35:19 +01:00
Chun-wei Fan
c2a828772b gio/gtestdbus.c: Fix write_config_file() for Windows
Windows does not like g_unlink() to be called on files whose file
descriptor is still open, so doing that would cause a permission
denied error.  Since the fd is not used in that function after
acquiring the temp file, close it earlier before
g_file_set_contents(), so that it can complete successfully.

This fixes a number of GTK+ tests on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=719344
2014-05-12 22:14:05 +08:00
Sébastien Wilmet
430e6fd6ad doc: various improvements
- GSubprocessLauncher exists since 2.40, not 2.36
- more logical order for g_markup functions
- fix short description of GMarkup
- GMarkupParser: specify that some parameters are NULL-terminated.
- g_string_new (NULL); is possible.
- other trivial fixes.

https://bugzilla.gnome.org/show_bug.cgi?id=728983
2014-05-09 18:47:42 +02:00
Lukasz Skalski
7c205ae90d gio: cleanup gdbusmessage.c file
* removed passing GError to ensure_input_padding() function
  - it was necessary before commit 3e5214c15c
  when we used GData*Streams and GMemoryInputStream with
  g_seekable_seek() - now it's useless,

* removed checking return value of ensure_input_padding()
  function - in previous implementation (like above)
  g_seekable_seek() could return FALSE - now it's always TRUE,

* removed passing GError to g_memory_buffer_read_*() functions
  and checking returned value - it also has been inherited after
  old implementation with g_data_input_stream_read_*() functions
  - now it's also useless

* cleaned up code formatting,

https://bugzilla.gnome.org/show_bug.cgi?id=729875
2014-05-09 10:21:22 -04:00
Ryan Lortie
079d20f012 tests: add testcase for {Only,Not}ShowIn
https://bugzilla.gnome.org/show_bug.cgi?id=729813
2014-05-08 16:19:56 -04:00
Ryan Lortie
5a5e16e93c AppInfo: use XDG_CURRENT_DESKTOP for OnlyShowIn
Expand the functionality of g_desktop_app_info_set_desktop_env() to
include the possibility of passing strings containing ':' characters (as
some apps, such as gnome-session, are directly passing the value of
XDG_CURRENT_DESKTOP).  At the same time, deprecate it, since now we get
the list from the environment variable for ourselves.

Modify the checks in g_desktop_app_info_get_show_in() to deal with
multiple items listed in XDG_CURRENT_DESKTOP.  For example, if we find
that we have

  XDG_CURRENT_DESKTOP=GNOME-Classic:GNOME

and a desktop file contains:

  OnlyShowIn=GNOME

then we will show this file because of the fallback to GNOME.  If the
file _also_ contains the line:

  NotShowIn=GNOME-Classic

Then we will not show it, because GNOME-Classic comes before GNOME in
XDG_CURRENT_DESKTOP.

https://bugzilla.gnome.org/show_bug.cgi?id=729813
2014-05-08 16:19:56 -04:00
Ryan Lortie
880e8e8cb2 tests: add tests for GDesktopAppInfo Implements=
https://bugzilla.gnome.org/show_bug.cgi?id=712391
2014-05-08 16:19:55 -04:00
Ryan Lortie
9aaf990960 Add g_desktop_app_info_get_implementations()
This provides support for the draft addition of 'Implements=' to the Desktop
Entry specification.

https://bugzilla.gnome.org/show_bug.cgi?id=712391
2014-05-08 16:19:05 -04:00
Lionel Landwerlin
1565a49144 gio: iostream: use GTask instead of internal pointer
This fixes an infinite recursion loop when calling
g_io_stream_close_async() on a SoupIOStream.

https://bugzilla.gnome.org/show_bug.cgi?id=722723
2014-05-05 11:10:09 -04:00
Dan Winship
81e0a2f362 gio: add a missing property to GDummyTlsConnection
GDummyTlsConnection didn't implement the "interaction" property,
meaning you'd get warnings if you tried to set it while creating a
GTlsConnection when using the dummy backend. (Of course, trying to
create the GTlsConnection will fail anyway, but it ought to fail
without hitting any g_warnings.)
2014-05-03 17:27:44 -04:00
Lars Uebernickel
4ba23522b1 gmenuexporter: fix protocol documentation link 2014-04-28 09:28:21 +02:00
Juan Pablo Ugarte
254b8dfcd0 Added type check to GPermission public functions. 2014-04-25 20:06:41 -03:00
Philip Withnall
956921e51f gresolver: Ensure GThreadedResolver always sets an error if resolution fails
It was previously possible for GThreadedResolver to return an empty list
and no error in response to a g_resolver_lookup_by_name() call, if it
happened that all the addresses returned by getaddrinfo() could not be
converted from native addresses to GSocketAddresses.

Fix that by setting a G_RESOLVER_ERROR_NOT_FOUND if the returned list is
empty.

https://bugzilla.gnome.org/show_bug.cgi?id=728776
2014-04-25 09:52:01 +01:00
Philip Withnall
14b0c15abb gresolver: Document that GResolver lists are non-empty on success
The documentation previously wasn’t clear about whether the GResolver
methods could return an empty list and no error. On balance, this seems
like a bad idea, and GResolver should commit to always return a
non-empty list, or an error (which should be G_RESOLVER_ERROR_NOT_FOUND
if the list would otherwise be empty).

https://bugzilla.gnome.org/show_bug.cgi?id=728776
2014-04-25 09:52:01 +01:00
Dan Winship
c565d645e9 gio: remove an unneeded pragma
ddf82a25 removed the use of non-literal format strings from
gthreadedresolver.c, but left the "#pragma GCC diagnostic ignored
-Wformat-nonliteral" behind.
2014-04-24 12:18:36 -04:00
Volker Sobek
4441595378 docs: Remove <!-- --> comment before plural s
These did show up in the html. Since symbol names are checked for a
trailing plural s when generating the docs, the links stay functional
after removing these comments.

https://bugzilla.gnome.org/show_bug.cgi?id=728380
2014-04-24 13:42:37 +02:00
Philip Withnall
99b67614b7 gaction: Minor clarifications in the GAction documentation
https://bugzilla.gnome.org/show_bug.cgi?id=728350
2014-04-23 13:02:41 +01:00
Philip Withnall
9352cdb5f4 gfile: More explicitly document the context for GFileProgressCallback
Be more explicit in the documentation for g_file_copy_async() about
which GMainContext its progress callback is executed in.

https://bugzilla.gnome.org/show_bug.cgi?id=728565
2014-04-19 18:24:04 +01:00
Philip Withnall
2b247e1589 gio: Document that GSocket is not thread safe
https://bugzilla.gnome.org/show_bug.cgi?id=726318
2014-04-16 19:04:25 +01:00
Volker Sobek
9f0ad54c80 docs: Use markdown links in all .c and .h files
Commit e7fd3de86d already did most of this.

https://bugzilla.gnome.org/show_bug.cgi?id=728285
2014-04-15 22:19:07 +02:00
Ryan Lortie
afaee8dc6a gdesktopappinfo: fix a crasher
During the time that we are expanding the strv, it is not
null-terminated.  Use the strv_len variable instead to bound the search
for duplicates.
2014-04-15 14:12:58 -04:00
Alberto Ruiz
7916f6d636 gio: fix g-i annotations in g_settings_schema_source_list_schemas() 2014-04-15 18:56:26 +02:00
Ryan Lortie
9a5e85c078 tests: use mimeapps.list over defaults.list
defaults.list is deprecated, so use mimeapps.list as a filename instead.

https://bugzilla.gnome.org/show_bug.cgi?id=728040
2014-04-15 11:36:39 -04:00
Ryan Lortie
6fd5a8cdaa GDesktopAppInfo: rewrite content type code
Redo the code for type-based selection of applications (all,
recommended, default, fallback) based on the new DesktopFileDir
structures that we introduced last cycle.

At the same time, we expand the functionality to add support for the new
features of the specification:

 - moving ~/.local/share/applications/mimeapps.list to ~/.config/

 - per-desktop default applications (via XDG_CURRENT_DESKTOP)

 - sysadmin customisation of defaults (via /etc/xdg/mimeapps.list)

 - deprecation of the old defaults.list, favouring the use of
   /usr/share/applications/mimeapps.list (or gnome-mimeapps.list) to
   accomplish the same

We modify the mimeapps testcase to check for mimeapps.list having been
created in XDG_CONFIG_HOME instead of XDG_DATA_HOME.

The modification is a net reduction of code (due to less duplication in
bookkeeping).  It is also an increase in performance and reduction in
memory consumption (due to simplified data structures).  Finally, it
removes the stat-based timestamp checking in favour of the
GFileMonitor-based approach that was already being used in the
implementation of DesktopFileDir (in order to know if we had to rescan
the desktop files themselves).

https://bugzilla.gnome.org/show_bug.cgi?id=728040
2014-04-15 11:36:39 -04:00
Ryan Lortie
caf0f1df1c mimetype tests: don't depend on specific behaviour
We currently assume that setting an application as the default will take
it to the front of the list of supported applications for a given type,
but this is not necessarily true.

Check instead that the application is actually set as default.

https://bugzilla.gnome.org/show_bug.cgi?id=728040
2014-04-15 11:36:39 -04:00
Ryan Lortie
54047080e9 appmonitor test: avoid /usr/share
Set XDG_DATA_DIRS to make sure we don't use /usr/share from the
appmonitor test.  We will soon throw a warning if we find defaults.list,
so make sure we don't open ourselves up to that if there is one on the
system.

https://bugzilla.gnome.org/show_bug.cgi?id=728040
2014-04-15 11:36:39 -04:00
Ryan Lortie
a366b6f2d5 tests: expand 'apps' tool
Add modes to output the applications found for get_default_,
get_recommended_, get_fallback_ and get_all_for_type().

https://bugzilla.gnome.org/show_bug.cgi?id=728040
2014-04-15 11:36:38 -04:00
Ryan Lortie
41761a134d mimeapps test: fix defaults vs. recommended
The desktop file for myapp3 didn't declare support for image/png, but
the testcase expects it to be recommended on the basis of it being the
default app according to defaults.list.

This will not work in the future -- we will only list apps that actually
support the filetype in question, unless they've been explicitly added
as associations.

https://bugzilla.gnome.org/show_bug.cgi?id=728040
2014-04-15 11:36:38 -04:00
Ryan Lortie
84e9829fee desktop-app-info test: use g_assert_strcmp()
Replace some assert(strcmp()) with g_assert_strcmp() so that we get
better output in case of failures.

https://bugzilla.gnome.org/show_bug.cgi?id=728040
2014-04-15 11:36:38 -04:00
Colin Walters
2d96503898 gdesktopappinfo: Don't double free sn_id
Not sure why mclasen added a g_free() in that path, it was just wrong.
We free it correctly later.
2014-04-12 13:26:29 -04:00
Colin Walters
af1772b642 gdesktopappinfo: Initialize sn_id to NULL
Otherwise we'll be freeing a random stack pointer.
2014-04-12 13:21:20 -04:00
Matthias Clasen
94e5dafbc9 Deal with startup notify id being NULL
The app launch context may just not support startup notification,
in which case, g_app_launch_context_get_startup_notify_id() will
return NULL.

Failure to take this into account leads to criticals like this:
gnome-session[8489]: GLib-CRITICAL: g_variant_new_take_string: assertion 'string != NULL' failed
gnome-session[8489]: GLib-CRITICAL: g_variant_new_variant: assertion 'value != NULL' failed
gnome-session[8489]: GLib-CRITICAL: g_variant_get_type: assertion 'value != NULL' failed
gnome-session[8489]: GLib-CRITICAL: g_variant_type_is_subtype_of: assertion 'g_variant_type_check (type)' failed

https://bugzilla.gnome.org/show_bug.cgi?id=728066
2014-04-11 19:00:12 -07:00
Cosimo Cecchi
9fe9a676a4 gapplication-tool: ensure object paths are valid
Hyphens are not valid characters for DBus object paths; see the similar
code in gapplicationimpl-dbus.c

https://bugzilla.gnome.org/show_bug.cgi?id=727928
2014-04-10 09:16:22 -07:00
Cosimo Cecchi
59d11879ef gapplication-tool: fix a typo
This must have never worked.

https://bugzilla.gnome.org/show_bug.cgi?id=727928
2014-04-10 09:16:22 -07:00
Debarshi Ray
0e44b29340 giomodule: Add a NULL guard to extension_point_get_extension_by_name
... otherwise a NULL input will lead to a crash in strcmp.

https://bugzilla.gnome.org/show_bug.cgi?id=727964
2014-04-10 15:27:16 +02:00
Colin Walters
7089cf8967 g_file_copy: Don't set GError when we intend to ignore errors
For better or worse, the current g_file_copy intention was to ignore
errors copying metadata, but we still set the GError, while returning
TRUE.

https://bugzilla.gnome.org/show_bug.cgi?id=727559
2014-04-09 20:22:38 -04:00
Stef Walter
76d6fd01de gio: Add newer dbus UnknownXxxx and PropertyReadOnly errors
Add G_DBUS_ERROR codes for:

 * org.freedesktop.DBus.Error.UnknownObject
 * org.freedesktop.DBus.Error.UnknownInterface
 * org.freedesktop.DBus.Error.UnknownProperty
 * org.freedesktop.DBus.Error.PropertyReadOnly

These were discussed on the dbus mailing list
and introduced in the following libdbus commit:

2c34514620c4b79ea4ec71d1db583379138d01ac

https://bugzilla.gnome.org/show_bug.cgi?id=727900
2014-04-09 20:48:19 +02:00
Dan Winship
65f2669173 gtlscertificate: fix certificate list parsing with trailing comments
g_tls_certificate_list_new_from_file() was supposed to ignore non-PEM
content, but it accidentally required that there not be anything after
the last certificate. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=727692
2014-04-09 10:39:45 -04:00
Marek Kasik
b81c12fcab GApplication: Don't decrease use_count below 0
Place an assert for use_count to be at least 1
in g_application_release() so we don't decrease
it below 0.

https://bugzilla.gnome.org/show_bug.cgi?id=727551
2014-04-04 16:04:46 +02:00
Wim Taymans
20feb23569 networkaddress: fix parsing of uri with @ after authority
Make sure that the @ sign is inside the authority part before attempting
to parse the userinfo. We do this by checking if the @ sign comes before
any of the possible authority delimiters.
Add unit test to verify parsing of ftp://ftp.gnome.org/start?foo=bar@baz

https://bugzilla.gnome.org/show_bug.cgi?id=726040
2014-04-02 11:23:29 -04:00