summaryrefslogtreecommitdiffstats
path: root/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon
diff options
context:
space:
mode:
Diffstat (limited to 'meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon')
-rw-r--r--meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/configurefix.patch32
-rw-r--r--meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/desktop-moblin.patch13
-rw-r--r--meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/gnome-settings-daemon-2.24.0-catch-deviceadded.patch21
-rw-r--r--meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/gnome-settings-daemon-fix-gthread.patch15
-rw-r--r--meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/mojito-cleanup.patch76
-rw-r--r--meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/mount-plugin.patch620
6 files changed, 0 insertions, 777 deletions
diff --git a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/configurefix.patch b/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/configurefix.patch
deleted file mode 100644
index 892946f782..0000000000
--- a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/configurefix.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1Upstream-Status: Inappropriate [configuration]
2
3Index: gnome-settings-daemon-2.26.1/configure.ac
4===================================================================
5--- gnome-settings-daemon-2.26.1.orig/configure.ac 2009-09-16 22:57:31.000000000 +0100
6+++ gnome-settings-daemon-2.26.1/configure.ac 2009-09-16 22:58:45.000000000 +0100
7@@ -133,9 +133,6 @@
8 #
9 AC_DEFUN([AC_CHECK_X_HEADERS], [
10 ac_save_CPPFLAGS="$CPPFLAGS"
11- if test \! -z "$includedir" ; then
12- CPPFLAGS="$CPPFLAGS -I$includedir"
13- fi
14 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
15 AC_CHECK_HEADERS([$1],[$2],[$3],[$4])
16 CPPFLAGS="$ac_save_CPPFLAGS"])
17@@ -148,15 +145,9 @@
18 ac_save_LDFLAGS="$LDFLAGS"
19 # ac_save_LIBS="$LIBS"
20
21- if test \! -z "$includedir" ; then
22- CPPFLAGS="$CPPFLAGS -I$includedir"
23- fi
24 # note: $X_CFLAGS includes $x_includes
25 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
26
27- if test \! -z "$libdir" ; then
28- LDFLAGS="$LDFLAGS -L$libdir"
29- fi
30 # note: $X_LIBS includes $x_libraries
31 LDFLAGS="$LDFLAGS $ALL_X_LIBS"
32
diff --git a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/desktop-moblin.patch b/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/desktop-moblin.patch
deleted file mode 100644
index b8f1661b06..0000000000
--- a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/desktop-moblin.patch
+++ /dev/null
@@ -1,13 +0,0 @@
1Upstream-Status: Inappropriate [configuration]
2
3--- gnome-settings-daemon-2.26.1/data/gnome-settings-daemon.desktop.in.in~ 2009-04-24 20:59:51.000000000 -0700
4+++ gnome-settings-daemon-2.26.1/data/gnome-settings-daemon.desktop.in.in 2009-04-24 20:59:51.000000000 -0700
5@@ -2,7 +2,7 @@
6 Type=Application
7 _Name=GNOME Settings Daemon
8 Exec=@LIBEXECDIR@/gnome-settings-daemon
9-OnlyShowIn=GNOME;
10+OnlyShowIn=GNOME;MOBLIN;
11 X-GNOME-Autostart-Phase=Initialization
12 X-GNOME-Autostart-Notify=true
13 X-GNOME-AutoRestart=true
diff --git a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/gnome-settings-daemon-2.24.0-catch-deviceadded.patch b/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/gnome-settings-daemon-2.24.0-catch-deviceadded.patch
deleted file mode 100644
index b9cf6e17d3..0000000000
--- a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/gnome-settings-daemon-2.24.0-catch-deviceadded.patch
+++ /dev/null
@@ -1,21 +0,0 @@
1Upstream-Status: Pending
2
3============================================================
4 Listen for DeviceAdded in addition to DeviceEnabled
5
6 This should help address problems like left-handed
7mouse, and acceleration settings getting lost after
8resume, or when new devices gets plugged in.
9
10diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
11--- a/plugins/mouse/gsd-mouse-manager.c
12+++ b/plugins/mouse/gsd-mouse-manager.c
13@@ -320,7 +320,7 @@ devicepresence_filter (GdkXEvent *xevent,
14 if (xev->type == xi_presence)
15 {
16 XDevicePresenceNotifyEvent *dpn = (XDevicePresenceNotifyEvent *) xev;
17- if (dpn->devchange == DeviceEnabled)
18+ if (dpn->devchange == DeviceEnabled || dpn->devchange == DeviceAdded)
19 set_mouse_settings ((GsdMouseManager *) data);
20 }
21 return GDK_FILTER_CONTINUE;
diff --git a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/gnome-settings-daemon-fix-gthread.patch b/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/gnome-settings-daemon-fix-gthread.patch
deleted file mode 100644
index 965da0961e..0000000000
--- a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/gnome-settings-daemon-fix-gthread.patch
+++ /dev/null
@@ -1,15 +0,0 @@
1Upstream-Status: Inappropriate [configuration]
2
3Index: gnome-settings-daemon-2.25.90/configure.ac
4===================================================================
5--- gnome-settings-daemon-2.25.90.orig/configure.ac
6+++ gnome-settings-daemon-2.25.90/configure.ac
7@@ -85,6 +85,8 @@ AC_PATH_PROG(GCONFTOOL, gconftool-2)
8
9 AM_GCONF_SOURCE_2
10
11+AC_CHECK_LIB(gthread-2.0, g_thread_init)
12+
13 dnl ---------------------------------------------------------------------------
14 dnl - Check for libnotify
15 dnl ---------------------------------------------------------------------------
diff --git a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/mojito-cleanup.patch b/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/mojito-cleanup.patch
deleted file mode 100644
index 79f28711c5..0000000000
--- a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/mojito-cleanup.patch
+++ /dev/null
@@ -1,76 +0,0 @@
1Upstream-Status: Pending
2
3diff --git a/plugins/housekeeping/gsd-housekeeping-manager.c b/plugins/housekeeping/gsd-housekeeping-manager.c
4index f84cfad..e8f474a 100644
5--- a/plugins/housekeeping/gsd-housekeeping-manager.c
6+++ b/plugins/housekeeping/gsd-housekeeping-manager.c
7@@ -85,9 +85,13 @@ thumb_data_free (gpointer data)
8 }
9 }
10
11+typedef enum {
12+ HASH,
13+ HASH_PNG
14+} FileType;
15
16 static GList *
17-read_dir_for_purge (const char *path, GList *files)
18+read_dir_for_purge (const char *path, GList *files, FileType type)
19 {
20 GFile *read_path;
21 GFileEnumerator *enum_dir;
22@@ -105,9 +109,20 @@ read_dir_for_purge (const char *path, GList *files)
23 GFileInfo *info;
24 while ((info = g_file_enumerator_next_file (enum_dir, NULL, NULL)) != NULL) {
25 const char *name;
26+ gboolean prune = FALSE;
27+
28 name = g_file_info_get_name (info);
29
30- if (strlen (name) == 36 && strcmp (name + 32, ".png") == 0) {
31+ switch (type) {
32+ case HASH:
33+ prune = (strlen (name) == 36);
34+ break;
35+ case HASH_PNG:
36+ prune = (strlen (name) == 36 && strcmp (name + 32, ".png") == 0);
37+ break;
38+ }
39+
40+ if (prune) {
41 ThumbData *td;
42 GFile *entry;
43 char *entry_path;
44@@ -197,14 +212,14 @@ purge_thumbnail_cache (void)
45 ".thumbnails",
46 "normal",
47 NULL);
48- files = read_dir_for_purge (path, NULL);
49+ files = read_dir_for_purge (path, NULL, HASH_PNG);
50 g_free (path);
51
52 path = g_build_filename (g_get_home_dir (),
53 ".thumbnails",
54 "large",
55 NULL);
56- files = read_dir_for_purge (path, files);
57+ files = read_dir_for_purge (path, files, HASH_PNG);
58 g_free (path);
59
60 path = g_build_filename (g_get_home_dir (),
61@@ -212,7 +227,14 @@ purge_thumbnail_cache (void)
62 "fail",
63 "gnome-thumbnail-factory",
64 NULL);
65- files = read_dir_for_purge (path, files);
66+ files = read_dir_for_purge (path, files, HASH_PNG);
67+ g_free (path);
68+
69+ path = g_build_filename (g_get_user_cache_dir (),
70+ "mojito",
71+ "thumbnails",
72+ NULL);
73+ files = read_dir_for_purge (path, files, HASH);
74 g_free (path);
75
76 g_get_current_time (&current_time);
diff --git a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/mount-plugin.patch b/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/mount-plugin.patch
deleted file mode 100644
index 25dc36e672..0000000000
--- a/meta-demoapps/recipes-gnome/gnome/gnome-settings-daemon/mount-plugin.patch
+++ /dev/null
@@ -1,620 +0,0 @@
1Upstream-Status: Pending
2
3diff --git a/configure.ac b/configure.ac
4index 135f2ce..ba737a5 100644
5--- a/configure.ac
6+++ b/configure.ac
7@@ -356,6 +356,7 @@ plugins/keybindings/Makefile
8 plugins/keyboard/Makefile
9 plugins/media-keys/Makefile
10 plugins/media-keys/cut-n-paste/Makefile
11+plugins/mount/Makefile
12 plugins/mouse/Makefile
13 plugins/screensaver/Makefile
14 plugins/sound/Makefile
15diff --git a/data/gnome-settings-daemon.schemas.in b/data/gnome-settings-daemon.schemas.in
16index 4920ae3..502e9e6 100644
17--- a/data/gnome-settings-daemon.schemas.in
18+++ b/data/gnome-settings-daemon.schemas.in
19@@ -557,5 +557,29 @@
20 </locale>
21 </schema>
22
23+ <schema>
24+ <key>/schemas/apps/gnome_settings_daemon/plugins/mount/active</key>
25+ <applyto>/apps/gnome_settings_daemon/plugins/mount/active</applyto>
26+ <owner>gnome-settings-daemon</owner>
27+ <type>bool</type>
28+ <default>TRUE</default>
29+ <locale name="C">
30+ <short>Enable mount plugin</short>
31+ <long>Set to True to enable the plugin to automount media.</long>
32+ </locale>
33+ </schema>
34+ <schema>
35+ <key>/schemas/apps/gnome_settings_daemon/plugins/mount/priority</key>
36+ <applyto>/apps/gnome_settings_daemon/plugins/mount/priority</applyto>
37+ <owner>gnome-settings-daemon</owner>
38+ <type>int</type>
39+ <default>99</default>
40+ <locale name="C">
41+ <short></short>
42+ <long></long>
43+ </locale>
44+ </schema>
45+
46+
47 </schemalist>
48 </gconfschemafile>
49diff --git a/plugins/Makefile.am b/plugins/Makefile.am
50index 2d33061..46615c1 100644
51--- a/plugins/Makefile.am
52+++ b/plugins/Makefile.am
53@@ -11,6 +11,7 @@ SUBDIRS = \
54 keybindings \
55 keyboard \
56 media-keys \
57+ mount \
58 mouse \
59 screensaver \
60 sound \
61diff --git a/plugins/mount/Makefile.am b/plugins/mount/Makefile.am
62new file mode 100644
63index 0000000..188c83d
64--- /dev/null
65+++ b/plugins/mount/Makefile.am
66@@ -0,0 +1,39 @@
67+plugin_LTLIBRARIES = \
68+ libmount.la
69+
70+libmount_la_SOURCES = \
71+ gsd-mount-manager.c \
72+ gsd-mount-manager.h \
73+ gsd-mount-plugin.c \
74+ gsd-mount-plugin.h
75+
76+libmount_la_CPPFLAGS = \
77+ -I$(top_srcdir)/gnome-settings-daemon \
78+ -DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
79+ $(AM_CPPFLAGS)
80+
81+libmount_la_CFLAGS = \
82+ $(SETTINGS_PLUGIN_CFLAGS) \
83+ $(AM_CFLAGS)
84+
85+libmount_la_LDFLAGS = \
86+ $(GSD_PLUGIN_LDFLAGS)
87+
88+libmount_la_LIBADD = \
89+ $(SETTINGS_PLUGIN_LIBS)
90+
91+plugin_in_files = \
92+ mount.gnome-settings-plugin.in
93+
94+plugin_DATA = $(plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin)
95+
96+EXTRA_DIST = \
97+ $(plugin_in_files)
98+
99+CLEANFILES = \
100+ $(plugin_DATA)
101+
102+DISTCLEANFILES = \
103+ $(plugin_DATA)
104+
105+@GSD_INTLTOOL_PLUGIN_RULE@
106diff --git a/plugins/mount/gsd-mount-manager.c b/plugins/mount/gsd-mount-manager.c
107new file mode 100644
108index 0000000..a768f03
109--- /dev/null
110+++ b/plugins/mount/gsd-mount-manager.c
111@@ -0,0 +1,261 @@
112+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
113+ *
114+ * Copyright (C) 2009 Intel Corporation
115+ *
116+ * This program is free software; you can redistribute it and/or modify it under
117+ * the terms of the GNU General Public License as published by the Free Software
118+ * Foundation; either version 2 of the License, or (at your option) any later
119+ * version.
120+ *
121+ * This program is distributed in the hope that it will be useful, but WITHOUT
122+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
123+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
124+ * details.
125+ *
126+ * You should have received a copy of the GNU General Public License along with
127+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
128+ * Place - Suite 330, Boston, MA 02111-1307, USA.
129+ *
130+ */
131+
132+#include <config.h>
133+
134+#include <glib.h>
135+#include <glib/gi18n.h>
136+#include <gio/gio.h>
137+#include <gtk/gtk.h>
138+
139+#include "gsd-mount-manager.h"
140+
141+#define GSD_MOUNT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_MOUNT_MANAGER, GsdMountManagerPrivate))
142+
143+struct GsdMountManagerPrivate
144+{
145+ GVolumeMonitor *monitor;
146+};
147+
148+G_DEFINE_TYPE (GsdMountManager, gsd_mount_manager, G_TYPE_OBJECT)
149+
150+static gpointer manager_object = NULL;
151+
152+#if 0
153+static void
154+drive_connected_cb (GVolumeMonitor *monitor,
155+ GDrive *drive,
156+ GsdMountManager *manager)
157+{
158+ /* TODO: listen for the eject button */
159+}
160+#endif
161+
162+static void
163+volume_mounted_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
164+{
165+ GError *error = NULL;
166+ char *name;
167+
168+ name = g_volume_get_name (G_VOLUME (source_object));
169+
170+ if (!g_volume_mount_finish (G_VOLUME (source_object), result, &error)) {
171+ g_debug ("Failed to mount '%s': %s", name, error->message);
172+
173+ if (error->code != G_IO_ERROR_FAILED_HANDLED) {
174+ char *primary;
175+ GtkWidget *dialog;
176+
177+ primary = g_strdup_printf (_("Unable to mount %s"), name);
178+
179+ dialog = gtk_message_dialog_new (NULL, 0,
180+ GTK_MESSAGE_ERROR,
181+ GTK_BUTTONS_CLOSE,
182+ primary);
183+
184+ g_free (primary);
185+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), error->message);
186+
187+ gtk_dialog_run (GTK_DIALOG (dialog));
188+ gtk_widget_destroy (dialog);
189+ }
190+ g_error_free (error);
191+ } else {
192+ g_debug ("Mounted '%s'", name);
193+ }
194+
195+ g_free (name);
196+}
197+
198+static void
199+volume_added_cb (GVolumeMonitor *monitor,
200+ GVolume *volume,
201+ GsdMountManager *manager)
202+{
203+ char *name;
204+
205+ name = g_volume_get_name (volume);
206+ g_debug ("Volme '%s' added", name);
207+
208+ if (g_volume_can_mount (volume)) {
209+ GMountOperation *mount_op;
210+
211+ g_debug ("Mounting '%s'", name);
212+
213+ mount_op = gtk_mount_operation_new (NULL);
214+ g_volume_mount (volume, G_MOUNT_MOUNT_NONE,
215+ mount_op, NULL,
216+ volume_mounted_cb, manager);
217+ }
218+
219+ g_free (name);
220+}
221+
222+static void
223+mount_added_cb (GVolumeMonitor *monitor,
224+ GMount *mount,
225+ GsdMountManager *manager)
226+{
227+ GFile *file;
228+ char *uri;
229+
230+ file = g_mount_get_root (mount);
231+ uri = g_file_get_uri (file);
232+
233+ g_debug ("%s mounted, starting file manager", uri);
234+
235+ /* TODO: error */
236+ gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL);
237+
238+ g_free (uri);
239+ g_object_unref (file);
240+}
241+
242+static void
243+mount_existing_volumes (GsdMountManager *manager)
244+{
245+ /* TODO: iterate over drives to hook up eject */
246+ GList *l;
247+
248+ g_debug ("Mounting existing volumes");
249+
250+ l = g_volume_monitor_get_volumes (manager->priv->monitor);
251+ while (l) {
252+ GVolume *volume = l->data;
253+ GMount *mount;
254+
255+ mount = g_volume_get_mount (volume);
256+ if (mount == NULL &&
257+ g_volume_can_mount (volume) &&
258+ g_volume_should_automount (volume)) {
259+ GMountOperation *mount_op;
260+ char *name;
261+
262+ name = g_volume_get_name (volume);
263+ g_debug ("Mounting '%s'", name);
264+ g_free (name);
265+
266+ mount_op = gtk_mount_operation_new (NULL);
267+ g_volume_mount (volume, G_MOUNT_MOUNT_NONE,
268+ mount_op, NULL,
269+ volume_mounted_cb, manager);
270+ }
271+
272+ if (mount)
273+ g_object_unref (mount);
274+ g_object_unref (volume);
275+ l = g_list_delete_link (l, l);
276+ }
277+}
278+
279+gboolean
280+gsd_mount_manager_start (GsdMountManager *manager,
281+ GError **error)
282+{
283+ g_debug ("Starting mount manager");
284+
285+ manager->priv->monitor = g_volume_monitor_get ();
286+
287+#if 0
288+ g_signal_connect_object (manager->priv->monitor, "drive-connected",
289+ G_CALLBACK (drive_connected_cb), manager, 0);
290+#endif
291+ g_signal_connect_object (manager->priv->monitor, "volume-added",
292+ G_CALLBACK (volume_added_cb), manager, 0);
293+ g_signal_connect_object (manager->priv->monitor, "mount-added",
294+ G_CALLBACK (mount_added_cb), manager, 0);
295+
296+ /* TODO: handle eject buttons */
297+
298+#if 0
299+ mount_existing_volumes (manager);
300+#endif
301+
302+ return TRUE;
303+}
304+
305+void
306+gsd_mount_manager_stop (GsdMountManager *manager)
307+{
308+ g_debug ("Stopping mount manager");
309+}
310+
311+static void
312+gsd_mount_manager_dispose (GObject *object)
313+{
314+ GsdMountManager *manager = GSD_MOUNT_MANAGER (object);
315+
316+ if (manager->priv->monitor) {
317+ g_signal_handlers_disconnect_by_func
318+ (manager->priv->monitor, volume_added_cb, manager);
319+ g_signal_handlers_disconnect_by_func
320+ (manager->priv->monitor, mount_added_cb, manager);
321+ g_object_unref (manager->priv->monitor);
322+ manager->priv->monitor = NULL;
323+ }
324+
325+ G_OBJECT_CLASS (gsd_mount_manager_parent_class)->dispose (object);
326+}
327+
328+static void
329+gsd_mount_manager_init (GsdMountManager *manager)
330+{
331+ manager->priv = GSD_MOUNT_MANAGER_GET_PRIVATE (manager);
332+}
333+
334+static void
335+gsd_mount_manager_finalize (GObject *object)
336+{
337+ GsdMountManager *mount_manager;
338+
339+ g_return_if_fail (object != NULL);
340+ g_return_if_fail (GSD_IS_MOUNT_MANAGER (object));
341+
342+ mount_manager = GSD_MOUNT_MANAGER (object);
343+
344+ g_return_if_fail (mount_manager->priv != NULL);
345+
346+ G_OBJECT_CLASS (gsd_mount_manager_parent_class)->finalize (object);
347+}
348+
349+static void
350+gsd_mount_manager_class_init (GsdMountManagerClass *klass)
351+{
352+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
353+
354+ object_class->dispose = gsd_mount_manager_dispose;
355+ object_class->finalize = gsd_mount_manager_finalize;
356+
357+ g_type_class_add_private (klass, sizeof (GsdMountManagerPrivate));
358+}
359+
360+GsdMountManager *
361+gsd_mount_manager_new (void)
362+{
363+ if (manager_object != NULL) {
364+ g_object_ref (manager_object);
365+ } else {
366+ manager_object = g_object_new (GSD_TYPE_MOUNT_MANAGER, NULL);
367+ g_object_add_weak_pointer (manager_object,
368+ (gpointer *) &manager_object);
369+ }
370+
371+ return GSD_MOUNT_MANAGER (manager_object);
372+}
373diff --git a/plugins/mount/gsd-mount-manager.h b/plugins/mount/gsd-mount-manager.h
374new file mode 100644
375index 0000000..9093fff
376--- /dev/null
377+++ b/plugins/mount/gsd-mount-manager.h
378@@ -0,0 +1,58 @@
379+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
380+ *
381+ * Copyright (C) 2009 Intel Corporation
382+ *
383+ * This program is free software; you can redistribute it and/or modify it under
384+ * the terms of the GNU General Public License as published by the Free Software
385+ * Foundation; either version 2 of the License, or (at your option) any later
386+ * version.
387+ *
388+ * This program is distributed in the hope that it will be useful, but WITHOUT
389+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
390+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
391+ * details.
392+ *
393+ * You should have received a copy of the GNU General Public License along with
394+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
395+ * Place - Suite 330, Boston, MA 02111-1307, USA.
396+ *
397+ */
398+
399+#ifndef __GSD_MOUNT_MANAGER_H
400+#define __GSD_MOUNT_MANAGER_H
401+
402+#include <glib-object.h>
403+
404+G_BEGIN_DECLS
405+
406+#define GSD_TYPE_MOUNT_MANAGER (gsd_mount_manager_get_type ())
407+#define GSD_MOUNT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_MOUNT_MANAGER, GsdMountManager))
408+#define GSD_MOUNT_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_MOUNT_MANAGER, GsdMountManagerClass))
409+#define GSD_IS_MOUNT_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_MOUNT_MANAGER))
410+#define GSD_IS_MOUNT_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_MOUNT_MANAGER))
411+#define GSD_MOUNT_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_MOUNT_MANAGER, GsdMountManagerClass))
412+
413+typedef struct GsdMountManagerPrivate GsdMountManagerPrivate;
414+
415+typedef struct
416+{
417+ GObject parent;
418+ GsdMountManagerPrivate *priv;
419+} GsdMountManager;
420+
421+typedef struct
422+{
423+ GObjectClass parent_class;
424+} GsdMountManagerClass;
425+
426+GType gsd_mount_manager_get_type (void);
427+
428+GsdMountManager * gsd_mount_manager_new (void);
429+
430+gboolean gsd_mount_manager_start (GsdMountManager *manager,
431+ GError **error);
432+void gsd_mount_manager_stop (GsdMountManager *manager);
433+
434+G_END_DECLS
435+
436+#endif /* __GSD_MOUNT_MANAGER_H */
437diff --git a/plugins/mount/gsd-mount-plugin.c b/plugins/mount/gsd-mount-plugin.c
438new file mode 100644
439index 0000000..af295a5
440--- /dev/null
441+++ b/plugins/mount/gsd-mount-plugin.c
442@@ -0,0 +1,103 @@
443+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
444+ *
445+ * Copyright (C) 2009 Intel Corporation
446+ *
447+ * This program is free software; you can redistribute it and/or modify it under
448+ * the terms of the GNU General Public License as published by the Free Software
449+ * Foundation; either version 2, or (at your option) any later version.
450+ *
451+ * This program is distributed in the hope that it will be useful, but WITHOUT
452+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
453+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
454+ * details.
455+ *
456+ * You should have received a copy of the GNU General Public License along with
457+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
458+ * Place - Suite 330, Boston, MA 02111-1307, USA.
459+ *
460+ */
461+
462+#include <config.h>
463+
464+#include <glib/gi18n.h>
465+#include <gmodule.h>
466+#include <gnome-settings-daemon/gnome-settings-plugin.h>
467+
468+#include "gsd-mount-plugin.h"
469+#include "gsd-mount-manager.h"
470+
471+struct GsdMountPluginPrivate {
472+ GsdMountManager *manager;
473+};
474+
475+#define GSD_MOUNT_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), GSD_TYPE_MOUNT_PLUGIN, GsdMountPluginPrivate))
476+
477+GNOME_SETTINGS_PLUGIN_REGISTER (GsdMountPlugin, gsd_mount_plugin)
478+
479+static void
480+gsd_mount_plugin_init (GsdMountPlugin *plugin)
481+{
482+ plugin->priv = GSD_MOUNT_PLUGIN_GET_PRIVATE (plugin);
483+
484+ g_debug ("GsdMountPlugin initializing");
485+
486+ plugin->priv->manager = gsd_mount_manager_new ();
487+}
488+
489+static void
490+gsd_mount_plugin_finalize (GObject *object)
491+{
492+ GsdMountPlugin *plugin;
493+
494+ g_return_if_fail (object != NULL);
495+ g_return_if_fail (GSD_IS_MOUNT_PLUGIN (object));
496+
497+ g_debug ("GsdMountPlugin finalizing");
498+
499+ plugin = GSD_MOUNT_PLUGIN (object);
500+
501+ g_return_if_fail (plugin->priv != NULL);
502+
503+ if (plugin->priv->manager != NULL) {
504+ g_object_unref (plugin->priv->manager);
505+ }
506+
507+ G_OBJECT_CLASS (gsd_mount_plugin_parent_class)->finalize (object);
508+}
509+
510+static void
511+impl_activate (GnomeSettingsPlugin *plugin)
512+{
513+ gboolean res;
514+ GError *error;
515+
516+ g_debug ("Activating mount plugin");
517+
518+ error = NULL;
519+ res = gsd_mount_manager_start (GSD_MOUNT_PLUGIN (plugin)->priv->manager, &error);
520+ if (! res) {
521+ g_warning ("Unable to start mount manager: %s", error->message);
522+ g_error_free (error);
523+ }
524+}
525+
526+static void
527+impl_deactivate (GnomeSettingsPlugin *plugin)
528+{
529+ g_debug ("Deactivating mount plugin");
530+ gsd_mount_manager_stop (GSD_MOUNT_PLUGIN (plugin)->priv->manager);
531+}
532+
533+static void
534+gsd_mount_plugin_class_init (GsdMountPluginClass *klass)
535+{
536+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
537+ GnomeSettingsPluginClass *plugin_class = GNOME_SETTINGS_PLUGIN_CLASS (klass);
538+
539+ object_class->finalize = gsd_mount_plugin_finalize;
540+
541+ plugin_class->activate = impl_activate;
542+ plugin_class->deactivate = impl_deactivate;
543+
544+ g_type_class_add_private (klass, sizeof (GsdMountPluginPrivate));
545+}
546diff --git a/plugins/mount/gsd-mount-plugin.h b/plugins/mount/gsd-mount-plugin.h
547new file mode 100644
548index 0000000..526a41f
549--- /dev/null
550+++ b/plugins/mount/gsd-mount-plugin.h
551@@ -0,0 +1,55 @@
552+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
553+ *
554+ * Copyright (C) 2009 Intel Corporation
555+ *
556+ * This program is free software; you can redistribute it and/or modify it under
557+ * the terms of the GNU General Public License as published by the Free Software
558+ * Foundation; either version 2, or (at your option) any later version.
559+ *
560+ * This program is distributed in the hope that it will be useful, but WITHOUT
561+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
562+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
563+ * details.
564+ *
565+ * You should have received a copy of the GNU General Public License along with
566+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
567+ * Place - Suite 330, Boston, MA 02111-1307, USA.
568+ *
569+ */
570+
571+#ifndef __GSD_MOUNT_PLUGIN_H__
572+#define __GSD_MOUNT_PLUGIN_H__
573+
574+#include <glib-object.h>
575+#include <gmodule.h>
576+#include <gnome-settings-daemon/gnome-settings-plugin.h>
577+
578+G_BEGIN_DECLS
579+
580+#define GSD_TYPE_MOUNT_PLUGIN (gsd_mount_plugin_get_type ())
581+#define GSD_MOUNT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_MOUNT_PLUGIN, GsdMountPlugin))
582+#define GSD_MOUNT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_MOUNT_PLUGIN, GsdMountPluginClass))
583+#define GSD_IS_MOUNT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_MOUNT_PLUGIN))
584+#define GSD_IS_MOUNT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_MOUNT_PLUGIN))
585+#define GSD_MOUNT_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_MOUNT_PLUGIN, GsdMountPluginClass))
586+
587+typedef struct GsdMountPluginPrivate GsdMountPluginPrivate;
588+
589+typedef struct
590+{
591+ GnomeSettingsPlugin parent;
592+ GsdMountPluginPrivate *priv;
593+} GsdMountPlugin;
594+
595+typedef struct
596+{
597+ GnomeSettingsPluginClass parent_class;
598+} GsdMountPluginClass;
599+
600+GType gsd_mount_plugin_get_type (void) G_GNUC_CONST;
601+
602+G_MODULE_EXPORT GType register_gnome_settings_plugin (GTypeModule *module);
603+
604+G_END_DECLS
605+
606+#endif /* __GSD_MOUNT_PLUGIN_H__ */
607diff --git a/plugins/mount/mount.gnome-settings-plugin.in b/plugins/mount/mount.gnome-settings-plugin.in
608new file mode 100644
609index 0000000..ca29ad1
610--- /dev/null
611+++ b/plugins/mount/mount.gnome-settings-plugin.in
612@@ -0,0 +1,8 @@
613+[GNOME Settings Plugin]
614+Module=mount
615+IAge=0
616+_Name=Mount
617+_Description=Mount removable media
618+Authors=Ross Burton
619+Copyright=Copyright © 2009 Intel Corporation
620+Website=