updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / glib2-wncksync-patch / gio-wncksync.patch
blob77c5127ad8179f06413d0494d6972110b5de9567
1 *** gio/gdesktopappinfo.c 2009-10-16 23:57:29.436561111 -0400
2 --- gio/gdesktopappinfo.c 2009-10-17 00:06:28.716984254 -0400
3 ***************
4 *** 69,74 ****
5 --- 69,78 ----
6 static void mime_info_cache_reload (const char *dir);
7 static gboolean g_desktop_app_info_ensure_saved (GDesktopAppInfo *info,
8 GError **error);
9 + static void
10 + g_desktop_app_info_launch_handler_on_launched (GDesktopAppInfoLaunchHandler *launch_handler,
11 + const char *desktop_file_path,
12 + gint pid);
14 /**
15 * GDesktopAppInfo:
16 ***************
17 *** 859,864 ****
18 --- 863,907 ----
19 g_setenv ("DESKTOP_STARTUP_ID", data->sn_id, TRUE);
22 + static void
23 + g_desktop_app_info_on_launched (const char *desktop_file_path, gint pid)
24 + {
25 + static gsize lookup = 0;
27 + if (g_once_init_enter (&lookup))
28 + {
29 + gsize setup_value = 1;
30 + GDesktopAppInfoLaunchHandler *lookup_instance;
31 + GIOExtensionPoint *ep;
32 + GIOExtension *extension;
33 + GList *l;
35 + /* Ensure vfs in modules loaded */
36 + _g_io_modules_ensure_loaded ();
38 + ep = g_io_extension_point_lookup (G_DESKTOP_APP_INFO_LAUNCH_HANDLER_EXTENSION_POINT_NAME);
40 + lookup_instance = NULL;
41 + for (l = g_io_extension_point_get_extensions (ep); l != NULL; l = l->next)
42 + {
43 + extension = l->data;
44 + lookup_instance = g_object_new (g_io_extension_get_type (extension), NULL);
45 + if (lookup_instance != NULL)
46 + break;
47 + }
49 + if (lookup_instance != NULL)
50 + setup_value = (gsize)lookup_instance;
52 + g_once_init_leave (&lookup, setup_value);
53 + }
55 + if (lookup == 1)
56 + return;
58 + g_desktop_app_info_launch_handler_on_launched (G_DESKTOP_APP_INFO_LAUNCH_HANDLER (lookup), desktop_file_path, pid);
59 + }
61 static gboolean
62 g_desktop_app_info_launch_uris (GAppInfo *appinfo,
63 GList *uris,
64 ***************
65 *** 910,922 ****
66 g_list_free (launched_files);
69 if (!g_spawn_async (info->path,
70 argv,
71 NULL,
72 G_SPAWN_SEARCH_PATH,
73 child_setup,
74 &data,
75 ! NULL,
76 error))
78 if (data.sn_id)
79 --- 953,966 ----
80 g_list_free (launched_files);
83 + gint pid;
84 if (!g_spawn_async (info->path,
85 argv,
86 NULL,
87 G_SPAWN_SEARCH_PATH,
88 child_setup,
89 &data,
90 ! &pid,
91 error))
93 if (data.sn_id)
94 ***************
95 *** 927,932 ****
96 --- 971,980 ----
98 goto out;
100 + else
102 + g_desktop_app_info_on_launched (info->filename, pid);
105 g_free (data.sn_id);
106 g_free (data.display);
107 ***************
108 *** 2692,2696 ****
109 --- 2740,2806 ----
110 return (* iface->get_default_for_uri_scheme) (lookup, uri_scheme);
113 + /* GDesktopAppInfoLaunchHandler interface: */
115 + static void g_desktop_app_info_launch_handler_base_init (gpointer g_class);
116 + static void g_desktop_app_info_launch_handler_class_init (gpointer g_class,
117 + gpointer class_data);
119 + GType
120 + g_desktop_app_info_launch_handler_get_type (void)
122 + static volatile gsize g_define_type_id__volatile = 0;
124 + if (g_once_init_enter (&g_define_type_id__volatile))
126 + const GTypeInfo desktop_app_info_launch_handler_info =
128 + sizeof (GDesktopAppInfoLaunchHandlerIface), /* class_size */
129 + g_desktop_app_info_launch_handler_base_init, /* base_init */
130 + NULL, /* base_finalize */
131 + g_desktop_app_info_launch_handler_class_init,
132 + NULL, /* class_finalize */
133 + NULL, /* class_data */
134 + 0,
135 + 0, /* n_preallocs */
136 + NULL
137 + };
138 + GType g_define_type_id =
139 + g_type_register_static (G_TYPE_INTERFACE, I_("GDesktopAppInfoLaunchHandler"),
140 + &desktop_app_info_launch_handler_info, 0);
142 + g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
144 + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
147 + return g_define_type_id__volatile;
150 + static void
151 + g_desktop_app_info_launch_handler_class_init (gpointer g_class,
152 + gpointer class_data)
156 + static void
157 + g_desktop_app_info_launch_handler_base_init (gpointer g_class)
161 + static void
162 + g_desktop_app_info_launch_handler_on_launched (GDesktopAppInfoLaunchHandler *launch_handler,
163 + const char *desktop_file_path,
164 + gint pid)
166 + GDesktopAppInfoLaunchHandlerIface *iface;
168 + g_return_if_fail (G_IS_DESKTOP_APP_INFO_LAUNCH_HANDLER (launch_handler));
170 + iface = G_DESKTOP_APP_INFO_LAUNCH_HANDLER_GET_IFACE (launch_handler);
172 + (* iface->on_launched) (launch_handler, desktop_file_path, pid);
175 #define __G_DESKTOP_APP_INFO_C__
176 #include "gioaliasdef.c"
178 *** gio/gdesktopappinfo.h 2009-03-31 19:04:20.000000000 -0400
179 --- gio/gdesktopappinfo.h 2009-07-21 20:34:35.565657314 -0400
180 ***************
181 *** 89,94 ****
182 --- 89,123 ----
183 GAppInfo *g_desktop_app_info_lookup_get_default_for_uri_scheme (GDesktopAppInfoLookup *lookup,
184 const char *uri_scheme);
188 + #define G_TYPE_DESKTOP_APP_INFO_LAUNCH_HANDLER (g_desktop_app_info_launch_handler_get_type ())
189 + #define G_DESKTOP_APP_INFO_LAUNCH_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_DESKTOP_APP_INFO_LAUNCH_HANDLER, GDesktopAppInfoLaunchHandler))
190 + #define G_IS_DESKTOP_APP_INFO_LAUNCH_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_DESKTOP_APP_INFO_LAUNCH_HANDLER))
191 + #define G_DESKTOP_APP_INFO_LAUNCH_HANDLER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_DESKTOP_APP_INFO_LAUNCH_HANDLER, GDesktopAppInfoLaunchHandlerIface))
193 + /**
194 + * G_DESKTOP_APP_INFO_LAUNCH_HANDLER_EXTENSION_POINT_NAME:
196 + * Extension point for default handler to launching. See
197 + * <link linkend="extending-gio">Extending GIO</link>.
198 + */
199 + #define G_DESKTOP_APP_INFO_LAUNCH_HANDLER_EXTENSION_POINT_NAME "gio-desktop-app-info-launch-handler"
201 + typedef struct _GDesktopAppInfoLaunchHandler GDesktopAppInfoLaunchHandler;
202 + typedef struct _GDesktopAppInfoLaunchHandlerIface GDesktopAppInfoLaunchHandlerIface;
204 + struct _GDesktopAppInfoLaunchHandlerIface
206 + GTypeInterface g_iface;
208 + void (* on_launched) (GDesktopAppInfoLaunchHandler *launch_handler,
209 + const char *desktop_file_path,
210 + gint pid);
211 + };
213 + GType g_desktop_app_info_launch_handler_get_type (void) G_GNUC_CONST;
215 G_END_DECLS
217 #endif /* __G_DESKTOP_APP_INFO_H__ */
219 *** gio/giomodule.c 2009-03-31 19:04:20.000000000 -0400
220 --- gio/giomodule.c 2009-07-21 20:40:32.738157079 -0400
221 ***************
222 *** 312,317 ****
223 --- 312,320 ----
224 #ifdef G_OS_UNIX
225 ep = g_io_extension_point_register (G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME);
226 g_io_extension_point_set_required_type (ep, G_TYPE_DESKTOP_APP_INFO_LOOKUP);
228 + ep = g_io_extension_point_register (G_DESKTOP_APP_INFO_LAUNCH_HANDLER_EXTENSION_POINT_NAME);
229 + g_io_extension_point_set_required_type (ep, G_TYPE_DESKTOP_APP_INFO_LAUNCH_HANDLER);
230 #endif
232 ep = g_io_extension_point_register (G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME);