Description: Disable gsd-printer plugin under Unity. We are still using system-config-printer for this, so no need to start another service for this.
Author: Martin Pitt <martin.pitt@ubuntu.com>
Forwarded: No, Ubuntu specific

Index: gnome-settings-daemon-3.3.91/plugins/print-notifications/gsd-print-notifications-plugin.c
===================================================================
--- gnome-settings-daemon-3.3.91.orig/plugins/print-notifications/gsd-print-notifications-plugin.c	2011-09-07 16:40:46.000000000 +0200
+++ gnome-settings-daemon-3.3.91/plugins/print-notifications/gsd-print-notifications-plugin.c	2012-03-05 21:04:12.953981067 +0100
@@ -38,6 +38,12 @@
 static void
 gsd_print_notifications_plugin_init (GsdPrintNotificationsPlugin *plugin)
 {
+        if (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0) {
+            plugin->priv = NULL;
+            g_debug ("GsdPrintNotificationsPlugin: Disabling for Unity, using system-config-printer");
+            return;
+        }
+
         plugin->priv = GSD_PRINT_NOTIFICATIONS_PLUGIN_GET_PRIVATE (plugin);
 
         plugin->priv->manager = gsd_print_notifications_manager_new ();
@@ -70,6 +76,11 @@
         gboolean res;
         GError  *error;
 
+        if (GSD_PRINT_NOTIFICATIONS_PLUGIN (plugin)->priv == NULL) {
+            g_debug ("Not activating disabled print-notifications plugin");
+            return;
+        }
+
         g_debug ("Activating print-notifications plugin");
 
         error = NULL;
@@ -83,6 +94,11 @@
 static void
 impl_deactivate (GnomeSettingsPlugin *plugin)
 {
+        if (GSD_PRINT_NOTIFICATIONS_PLUGIN (plugin)->priv == NULL) {
+            g_debug ("Not deactivating disabled print-notifications plugin");
+            return;
+        }
+
         g_debug ("Deactivating print_notifications plugin");
         gsd_print_notifications_manager_stop (GSD_PRINT_NOTIFICATIONS_PLUGIN (plugin)->priv->manager);
 }
