~mitya57/nautilus/lp1224217

« back to all changes in this revision

Viewing changes to debian/patches/81_gnome-app-install.patch

  • Committer: seb128
  • Date: 2009-04-01 10:10:49 UTC
  • Revision ID: seb128@seb128-desktop-20090401101049-x0mfut4l85f65jh3
initial nautilus import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- nautilus-2.21.1.orig/libnautilus-private/nautilus-program-choosing.c        2007-12-14 11:24:07.000000000 +0100
 
2
+++ nautilus-2.21.1/libnautilus-private/nautilus-program-choosing.c     2008-01-07 16:31:13.000000000 +0100
 
3
@@ -45,6 +45,7 @@
 
4
 #include <libgnome/gnome-url.h>
 
5
 #include <libgnomeui/gnome-uidefs.h>
 
6
 #include <stdlib.h>
 
7
+#include <libnautilus-extension/nautilus-file-info.h>
 
8
 
 
9
 #include <gdk/gdk.h>
 
10
 #include <gdk/gdkx.h>
 
11
@@ -228,6 +229,29 @@
 
12
 }
 
13
 
 
14
 
 
15
+void launch_gnome_app_install_mimetype(GdkScreen  *screen,
 
16
+                                      NautilusFile *file,
 
17
+                                      char *uri, char *uri_for_display) {
 
18
+       char *qmimetype, *quri, *qduri, *command;
 
19
+       if (!screen)
 
20
+               screen = gdk_display_get_default_screen(gdk_display_get_default ());
 
21
+
 
22
+       qmimetype = g_shell_quote (nautilus_file_info_get_mime_type (file));
 
23
+       quri = g_shell_quote (uri);
 
24
+       qduri = g_shell_quote (uri_for_display);
 
25
+       command = g_strconcat("gnome-app-install --mime-type=",
 
26
+                            qmimetype, " ", quri, " ", qduri,
 
27
+                            (char*)0 /* NB NULL is wrong */);
 
28
+       g_free (qmimetype);
 
29
+       g_free (quri);
 
30
+       g_free (qduri);
 
31
+
 
32
+       eel_gnome_shell_execute_on_screen (command, screen);
 
33
+       g_free (command);
 
34
+}
 
35
+
 
36
+
 
37
+
 
38
 /**
 
39
  * nautilus_launch_application:
 
40
  * 
 
41
@@ -306,12 +330,18 @@
 
42
                                                          parent_window);
 
43
                        g_free (uri_scheme);
 
44
                } else {
 
45
+                       launch_gnome_app_install_mimetype (screen,
 
46
+                                                          file,
 
47
+                                                          uri,
 
48
+                                                          uri_for_display);
 
49
+#if 0
 
50
 #ifdef NEW_MIME_COMPLETE
 
51
                        nautilus_program_chooser_show_invalid_message
 
52
                                (GNOME_VFS_MIME_ACTION_TYPE_APPLICATION, file, parent_window);
 
53
 #else
 
54
                        g_warning ("Can't open app: %s\n", error->message);
 
55
 #endif
 
56
+#endif
 
57
                }
 
58
        } else {
 
59
                for (l = files; l != NULL; l = l->next) {