summaryrefslogtreecommitdiff
path: root/libgnome-desktop/gnome-desktop-item.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgnome-desktop/gnome-desktop-item.c')
-rw-r--r--libgnome-desktop/gnome-desktop-item.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/libgnome-desktop/gnome-desktop-item.c b/libgnome-desktop/gnome-desktop-item.c
index 38b9ac61..9b0785ce 100644
--- a/libgnome-desktop/gnome-desktop-item.c
+++ b/libgnome-desktop/gnome-desktop-item.c
@@ -1017,7 +1017,9 @@ strip_the_amp(char *exec)
* then passed to gnome_exec_async for execution with argc and argv appended.
*
* Returns: The value returned by gnome_execute_async() upon execution of
- * the specified item or -1 on error.
+ * the specified item or -1 on error. It may also return a 0 on success
+ * if pid is not available, such as in a case where the entry is a URL
+ * entry.
*/
int
gnome_desktop_item_launch (const GnomeDesktopItem *item, int argc, const char **argv)
@@ -1034,6 +1036,16 @@ gnome_desktop_item_launch (const GnomeDesktopItem *item, int argc, const char **
return -1;
}
+ /* This is a URL, so launch it as a url */
+ if (item->type != NULL &&
+ item->item_format == GNOME_DESKTOP_ITEM_GNOME &&
+ strcmp (item->type, "URL") == 0) {
+ if (gnome_url_show (item->exec))
+ return 0;
+ else
+ return -1;
+ }
+
/* make a new copy and get rid of spaces */
the_exec = g_alloca(strlen(item->exec)+1);
strcpy(the_exec,item->exec);
@@ -1263,8 +1275,16 @@ gnome_desktop_item_drop_uri_list (const GnomeDesktopItem *item,
GList *file_list = NULL;
int ret = -1;
- g_return_val_if_fail(item!=NULL,-1);
- g_return_val_if_fail(uri_list!=NULL,-1);
+ g_return_val_if_fail (item != NULL, -1);
+ g_return_val_if_fail (uri_list != NULL, -1);
+
+ /* How could you drop something on a URL entry, that would
+ * be bollocks */
+ if (item->type != NULL &&
+ item->item_format == GNOME_DESKTOP_ITEM_GNOME &&
+ strcmp (item->type, "URL") == 0) {
+ return -1;
+ }
/* do we even allow drops? */
if(item->item_flags & GNOME_DESKTOP_ITEM_NO_FILE_DROP &&