16509 Commits

Author SHA1 Message Date
Matthias Clasen
5066318482 Fix indentation mishap 2016-07-06 19:58:34 -04:00
Matthias Clasen
9d6b3d729f Remove an extraneous casts
Spotted by Cosimo.
2016-07-06 19:51:45 -04:00
Matthias Clasen
ce62ca0c14 Be more truthful about network availability
If flatpak-info exists, but we don't have the shared key, then
the network is not available. Pointed out by Cosimo.
2016-07-06 19:42:12 -04:00
Matthias Clasen
f08b703f84 Use g_build_filename
Instead of manual path construction. Pointed out by Cosimo.
2016-07-06 19:34:45 -04:00
Matthias Clasen
5090920c98 Remove debug spew
Spotted by Cosimo.
2016-07-06 19:31:56 -04:00
Matthias Clasen
f700245891 Avoid an extraneous cast
Cosimo pointed out that this is unnecessary.
2016-07-06 19:30:23 -04:00
Matthias Clasen
9d59e45961 Set an error on failure
'has no owner' seems close enough, that is what we are seeing
here.
2016-07-06 19:29:13 -04:00
Matthias Clasen
22ff54a069 network monitor portal: Fix indentation
Pointed out by Cosimo Cecchi.
2016-07-06 19:24:55 -04:00
Matthias Clasen
01404fbe83 Avoid a use-after-free
Instead of pulling parent_window out of a copy of the environment
and having it go bad when we free the copy, move the definition
of GAppLaunchContextPrivate up and use the envp member without
copying in.

Pointed out by Cosimo Cecchi.
2016-07-06 19:10:33 -04:00
Matthias Clasen
34c104924f Avoid type name clash
GIO should not install types whose names don't start with 'g'.
This was causing the xdg-desktop-portal to crash, since it was
also trying to register Xdp types.
2016-07-04 22:53:30 -04:00
Matthias Clasen
5e1e90ce25 Add a portal backend for GNotification
This will talk to a portal api instead of directly to the shell.
2016-07-03 18:01:45 -04:00
Matthias Clasen
291af24495 portal support: Flush the connection
As Mario pointed out, this is common practice for uses
of the bus singleton inside GIO.
2016-07-03 18:01:45 -04:00
Matthias Clasen
5af31fbdbc portal support: Don't wait for the reply
It does not really make sense for g_app_info_launch_default_for_uri
to block on an interactive dialog. If we want that, we can should
introduce a proper async variant of this API with a cancellable
and a finish().
2016-07-03 18:01:45 -04:00
Matthias Clasen
69f7a26f34 portal support: handle errors
Return an error when we don't have a session bus connection.
Pointed out by Cosimo and Mario.
2016-07-03 18:01:45 -04:00
Matthias Clasen
c88714b9cc portal support: Use g_get_user_runtime_dir()
Pointed out by Cosimo Cecchi and Mario Sanchez Prada.
2016-07-03 18:01:45 -04:00
Matthias Clasen
4f6d25ed44 proxy: Redo the network availability check
Do this more like for the network monitor: We keep using the
portal proxy, but we neuter all results. Eventually, we can
do this on the portal side, but we need some systemd infrastructure
for it.
2016-07-03 18:01:45 -04:00
Matthias Clasen
0912552c67 Avoid a critical
The key might not be present in flatpak-info. Deal with that.
2016-07-03 18:01:45 -04:00
Matthias Clasen
4521e5c40d Add a portalized proxy resolver implementation
The backend for this lives in xdg-desktop-portal, and is in turn
using GProxyResolver.
2016-07-03 18:01:45 -04:00
Matthias Clasen
de5b18dfc3 Move some portal support to its own files
This is better than copying these utility functions around to
multiple places.
2016-07-03 18:01:45 -04:00
Matthias Clasen
e8df162402 network monitor portal: Respect sandbox setup
When network is not available in the sandbox, there is
no point in reporting accurately about the network
status outside the sandbox. Just return 'no connection'
in this case.
2016-07-03 18:01:45 -04:00
Matthias Clasen
956d4858f3 Add a portalized network monitor implementation
The backend for this lives in xdg-desktop-portal, and is in turn
using GNetworkMonitor.
2016-07-03 18:01:45 -04:00
Matthias Clasen
5496d16ed3 Use the new portal name
The portal got renamed to org.freedesktop.portal.OpenURI.
2016-07-03 18:01:45 -04:00
Matthias Clasen
453507ac6d Revert "Add portal support to g_app_info_launch_uris"
This reverts commit c980bd2bc416f6762c49497ddc042cea11a30bf2.
2016-07-03 18:01:45 -04:00
Matthias Clasen
4c24fab1ba Revert "Take the parent window id from the environment"
This reverts commit 4b44094309efe9a86bc0f3e6e687059ee55a90ab.
2016-07-03 18:01:45 -04:00
Matthias Clasen
b78cf7cb23 Add portal support to g_app_info_launch_default_for_uri
We need to patch in the portal support at a high enough
level that GAppInfo is not involved - a sandboxed app may
not be able to see any applications, so it can just launch
the defaults.
2016-07-03 18:01:45 -04:00
Matthias Clasen
5b5b1aab7b Take the parent window id from the environment
GTK+ will set this for when showing URIs in a sandbox.
2016-07-03 18:01:45 -04:00
Matthias Clasen
3ef357aca0 Add portal support to g_app_info_launch_uris
Call out to the org.freedesktop.portal.AppChooser portal.
2016-07-03 18:01:45 -04:00
Matthias Clasen
27fad7a6b1 Document the gio tool
Add a man page, and integrate it in the reference docs.
2016-07-01 16:01:34 -04:00
Matthias Clasen
37129297a9 Add new files to POTFILES 2016-07-01 16:01:34 -04:00
Matthias Clasen
9edba4e49c Add a new gio commandline tool
This command collects the various commandline utilities that
are currently shipped in gvfs, and unifies them under a single,
command-style binary.

The tools just use GIO APIs, so it makes sense for them to live here.
2016-07-01 16:01:34 -04:00
Matthias Clasen
669a0f72a1 Trivial: documentation wording fix
There was a stray 'of' here.
2016-06-30 08:58:41 -04:00
Philip Withnall
ae9e72ef61 gmessages: Simplify _g_log_abort() in gmessages.c a little
https://bugzilla.gnome.org/show_bug.cgi?id=744456
2016-06-29 17:18:55 +01:00
Philip Withnall
3613b7a366 gio: Add source tags to various GTasks constructed in GLib
This makes them easier to identify when debugging and profiling.

This patch was somewhat less than interesting to write.

https://bugzilla.gnome.org/show_bug.cgi?id=767765
2016-06-29 15:16:52 +01:00
Philip Withnall
7ea4949cda gmain: Add G_PID_FORMAT
This will be useful for printing out GPids in printf()-style functions.

https://bugzilla.gnome.org/show_bug.cgi?id=767765
2016-06-29 15:16:52 +01:00
Philip Withnall
8c6d08ab1b build: Simplify dtrace configuration
Apply the same changes as in commit
7563ab473468fecefc388ae2ed06afab8ead6211 to gio/Makefile.am.

https://bugzilla.gnome.org/show_bug.cgi?id=725902
2016-06-29 15:10:12 +01:00
Philip Withnall
c4695f192c build: Rename SystemTap scripts to include the LT version
In a vague attempt at ensuring the .stp scripts can be closely
associated with the .so files which they hard-code references to, rename
the scripts so they include the LT version — so that they are the .so
file name plus .stp.

This does not fix the fact that our .stp scripts will not work on
multiarch systems, as they are installed in an architecture-independent
directory (/usr/share/systemtap/tapset). At the moment, it is
recommended that any distribution who package the .stp files should
install them in the architecture-specific subdirectories of this (for
example, /usr/share/systemtap/tapset/x86-64).

A better long-term solution for this is under discussion upstream:
https://sourceware.org/bugzilla/show_bug.cgi?id=20264

https://bugzilla.gnome.org/show_bug.cgi?id=662802
2016-06-29 14:43:52 +01:00
Philip Withnall
c9d661b431 build: Ensure gio.stp.in is always distributed
Even if systemtap is not enabled in configure when running distcheck.

https://bugzilla.gnome.org/show_bug.cgi?id=662802
2016-06-29 14:43:51 +01:00
Florian Müllner
61c1e2db99 vfs: Fix copying default schemes list
The list of supported schemes is not known at compile-time, so it is
wrong to iterate the list with G_N_ELEMENTS() and we miss all but the
first scheme. Fix by checking for the %NULL sentinel instead.

https://bugzilla.gnome.org/show_bug.cgi?id=768119
2016-06-28 15:57:49 +02:00
Florian Müllner
a42bdecf5c vfs: Fix return value of get_supported_uri_schemes()
The function is expected to return a %NULL-terminated array, but
commit 375b4ca65c dropped the sentinel when adding support for
additional custom schemes. Add it back.

https://bugzilla.gnome.org/show_bug.cgi?id=768119
2016-06-28 15:57:49 +02:00
Ondrej Holy
e57355b055 fileinfo: Add G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE attribute
Add filesystem attribute to detect remote filesystems in order to
replace hardcoded filesystem types in GtkFileSystem. Set this attribute
also for GLocalFile appropriately.

Bump version to 2.49.3, so that early adopters of new API have a version
number to target.
2016-06-28 10:28:51 +02:00
Ernestas Kulik
f4b5dc30a7 gvfs: fix possible infinite loop in parse_name_internal()
If none of the closures in the hash table return a non-null value, the
loop never ends. Since the end of the hash table has been reached at
that point, g_hash_table_iter_next() starts asserting.

The possible fix is making the return value of g_hash_table_iter_next()
the condition in the loop.

https://bugzilla.gnome.org/show_bug.cgi?id=768029
2016-06-25 08:44:52 -04:00
Cosimo Cecchi
375b4ca65c vfs: add g_vfs_register_uri_scheme()
Add a new API to allow clients to register a custom GFile implementation
handling a particular URI scheme.
This can be useful for tests, but also for cases where a different URI
scheme is desired to be used with another custom GFile backend.

As an additional cleanup, we can use this to register the "resource" URI
scheme too.

Based on a patch by Jasper St. Pierre <jstpierre@mecheye.net>.

https://bugzilla.gnome.org/show_bug.cgi?id=767887
2016-06-25 06:58:19 +08:00
Andika Triwidada
4442bf2c95 Updated Indonesian translation
(cherry picked from commit 7cb5b02e6ab662e6cb384a3d68acdd81a3c15515)
2016-06-24 10:08:13 +00:00
Allison Lortie
9bb2499c9c tests: fix uint64 argument to g_object_set() call
5cea1c861def0251a10cd4de01908aaf3276c72d introduced accessors for 64bit
ints to gsettings, at which point the testcases were expanded.

Unfortunately, the expanded tests contained a bug: integer constants
passed to g_object_set() for a 64-bit property need an up-cast.  Add
that now.

Problem found by Iain Lane.
2016-06-23 11:49:39 -04:00
Philip Withnall
8e21b9e966 build: Add gio_probes.d to sources list so it ends up in the tarball
The probes.d file should be distributed even if GLib is build with
dtrace disabled. This is what’s done in the glib and gobject
directories.
2016-06-22 12:41:34 +01:00
Cosimo Cecchi
d07e166432 gkeyfile: add g_key_file_load_from_bytes() API
This makes it easier to use GKeyFile from language bindings, and makes
the API more consistent and modern with the new data type available in
GLib.

https://bugzilla.gnome.org/show_bug.cgi?id=767880
2016-06-20 17:53:00 -07:00
Ryan Lortie
7563ab4734 build: simplify dtrace configuration
The ability to pass libtool via $(CC) to dtrace and have it respect this
appears to be a feature that is only present in the systemtap version of
the tool.  In particular, FreeBSD (which seems to be using a copy of the
tool from Solaris) doesn't support this.

The result is that, with $(CC) ignored, and a .lo file specified in -o,
we get an ELF written to the .lo.

Instead of trying to have dtrace run libtool we can have libtool run
dtrace.  dtrace is really just a compiler that produces an object file
here, and it even understands -o, so libtool can make the appropriate
adjustments.

There appears to be some prior art for this approach.  A quick search
shows that at least QEMU is using this approach.  It also appears to
work on Linux with systemtap's dtrace and on FreeBSD.

This may regress cross-compilation because the dtrace command will have
no way of knowing which compiler we intend for it to use to produce the
object file.  I say "may" because I don't know if dtrace ever worked in
the first place under cross-compilation.

https://bugzilla.gnome.org/show_bug.cgi?id=725902
2016-06-20 12:35:47 -04:00
Matthias Clasen
b990acf7ae 2.49.2 2.49.2 2016-06-20 08:03:17 -04:00
Matthias Clasen
26e07869af Updates 2016-06-20 07:58:01 -04:00
Chun-wei Fan
bbf07fb15e Visual Studio builds: Fix .pc generation
The previous update did not account for when no exec_prefix is spcified,
so update that, and use ${prefix} by default.  Clean up a bit as well.
2016-06-20 10:52:06 +08:00