summaryrefslogtreecommitdiff
path: root/libmdock/mdock-item.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmdock/mdock-item.c')
-rw-r--r--libmdock/mdock-item.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/libmdock/mdock-item.c b/libmdock/mdock-item.c
index 67f581f..67d3638 100644
--- a/libmdock/mdock-item.c
+++ b/libmdock/mdock-item.c
@@ -17,7 +17,6 @@
* along with MDock. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "mdock-enums.h"
#include "mdock-item.h"
#define MDOCK_ITEM_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), MDOCK_TYPE_ITEM, MDockItemPrivate))
@@ -293,12 +292,13 @@ void mdock_item_set_desktop_app_info(MDockItem *self, GDesktopAppInfo *app_info)
g_object_set(self, "desktop-app-info", app_info, NULL);
}
-void mdock_item_launch(MDockItem *self)
+void mdock_item_launch_files(MDockItem *self, GList *files)
{
g_return_if_fail(self->priv->appinfo);
GError *error = NULL;
g_debug("Launching '%s'", g_app_info_get_commandline(G_APP_INFO(self->priv->appinfo)));
- if (!g_app_info_launch(G_APP_INFO(self->priv->appinfo), NULL, NULL, &error)) {
+
+ if (!g_app_info_launch(G_APP_INFO(self->priv->appinfo), files, NULL, &error)) {
GtkWidget *msg;
g_warning("Cannot launch '%s': %s",
@@ -319,6 +319,20 @@ void mdock_item_launch(MDockItem *self)
gtk_widget_show_all(msg);
g_error_free(error);
}
+
+
+}
+
+void mdock_item_launch_file(MDockItem *self, GFile *file)
+{
+ GList *files = g_list_append(NULL, file);
+ mdock_item_launch_files(self, files);
+ g_list_free(files);
+}
+
+void mdock_item_launch(MDockItem *self)
+{
+ mdock_item_launch_files(self, NULL);
}
const gchar *mdock_item_get_display_name(MDockItem *self)