aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xlopez@igalia.com>2011-08-29 21:48:03 +0800
committerXan Lopez <xlopez@igalia.com>2011-08-29 21:48:03 +0800
commit52b5de7fb81e96af073d159869c508996a1ddb55 (patch)
treec7287776a7dadb3e52b0716bbcb5a4736ed04f42
parent207f5b355abbaf2b91e9b684f3cc45387b5119cb (diff)
downloadgsoc2013-epiphany-52b5de7fb81e96af073d159869c508996a1ddb55.tar
gsoc2013-epiphany-52b5de7fb81e96af073d159869c508996a1ddb55.tar.gz
gsoc2013-epiphany-52b5de7fb81e96af073d159869c508996a1ddb55.tar.bz2
gsoc2013-epiphany-52b5de7fb81e96af073d159869c508996a1ddb55.tar.lz
gsoc2013-epiphany-52b5de7fb81e96af073d159869c508996a1ddb55.tar.xz
gsoc2013-epiphany-52b5de7fb81e96af073d159869c508996a1ddb55.tar.zst
gsoc2013-epiphany-52b5de7fb81e96af073d159869c508996a1ddb55.zip
ephy-file-helpers: make .desktop file launcher method parameters optional
We don't always need them.
-rw-r--r--lib/ephy-file-helpers.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index ebf163d77..f1003b67b 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -738,7 +738,7 @@ ephy_file_launch_application (GAppInfo *app,
/**
* ephy_file_launch_desktop_file:
* @filename: the path to the .desktop file
- * @parameter: path to a parameter file to pass to the application
+ * @parameter: path to an optional parameter file to pass to the application
* @user_time: user time to prevent focus stealing
* @widget: an optional widget for ephy_file_launch_application()
*
@@ -754,17 +754,21 @@ ephy_file_launch_desktop_file (const char *filename,
GtkWidget *widget)
{
GDesktopAppInfo *app;
- GFile *file;
+ GFile *file = NULL;
GList *list = NULL;
gboolean ret;
app = g_desktop_app_info_new (filename);
- file = g_file_new_for_path (parameter);
- list = g_list_append (list, file);
+ if (parameter)
+ {
+ file = g_file_new_for_path (parameter);
+ list = g_list_append (list, file);
+ }
ret = ephy_file_launch_application (G_APP_INFO (app), list, user_time, widget);
g_list_free (list);
- g_object_unref (file);
+ if (file)
+ g_object_unref (file);
return ret;
}