Commit Graph

116 Commits

Author SHA1 Message Date
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
Matthias Clasen
f4cff2b923 Some documentation additions 2011-05-01 23:02:53 -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
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
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
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
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
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
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
Pavel Holejsovsky
b497220e48 Fix GI annotation for g_desktop_app_info_launch_uris_as_manager 2011-01-05 20:35:50 +01: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
Pavel Holejsovsky
1f84c5b72f Add GI annotations to GAppInfo and GDesktopAppInfo 2010-12-27 15:40:07 +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
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
Matthias Clasen
eed36d38d1 Various doc tweaks 2010-11-28 23:55:43 -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
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
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
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
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
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
448ac22e80 Fix an oversight in the previous commit 2010-07-08 16:24:44 -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
Ryan Lortie
5b946e0504 gio/: fully remove gioalias hacks 2010-07-07 19:53:22 -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
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
7ca2e00054 Doc improvements
Make sure all unix-specific apis are marked as such.
2010-05-08 23:28:17 -04: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
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
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
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
Javier Jardón
00a331f970 Fix compilation warning: cast to (GCompareFunc) 2009-11-17 20:44:01 +01: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
Mart Raudsepp
c755a7fd11 gio: Fix some typos in G*AppInfo documentation 2009-09-22 11:22:44 +03:00
Matthias Clasen
80fd5ed402 Don't evaluate an uninitialized value
Bug found by clang.
2009-09-07 02:50:51 -04: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
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
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
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
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