rpms/desktop-printing/devel desktop-printing-0.19-hal_lpadmin.patch, NONE, 1.1 desktop-printing.spec, 1.55, 1.56

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Jun 6 10:33:02 UTC 2006


Author: ffesti

Update of /cvs/dist/rpms/desktop-printing/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv7886

Modified Files:
	desktop-printing.spec 
Added Files:
	desktop-printing-0.19-hal_lpadmin.patch 
Log Message:
[ffesti] Adjusted dbus interface for new hal-cups-utils


desktop-printing-0.19-hal_lpadmin.patch:
 ec-driver-prompt-dialog.c |   89 ++++------------------------------------------
 ec-driver-prompt-dialog.h |   10 +----
 ec-driver-prompt.c        |   12 +-----
 3 files changed, 14 insertions(+), 97 deletions(-)

--- NEW FILE desktop-printing-0.19-hal_lpadmin.patch ---
diff -ru desktop-printing-0.19.orig/eggcups-0.19/ec-driver-prompt.c desktop-printing-0.19/eggcups-0.19/ec-driver-prompt.c
--- desktop-printing-0.19.orig/eggcups-0.19/ec-driver-prompt.c	2006-05-19 10:47:34.000000000 +0200
+++ desktop-printing-0.19/eggcups-0.19/ec-driver-prompt.c	2006-05-30 14:38:01.000000000 +0200
@@ -435,15 +435,9 @@
 		rb_debug ("Printer configuration found.  Configuring printer.");
 		dbus_set_printer_driver	(return_make, return_model, udi, printer_name, NULL);
 	} else {
-		gchar *driver;
- 
-		if (!dbus_match_printer_driver (make, model, &driver)) {
-			ECDriverPromptDialog *dlg;	
-			dlg = ec_driver_prompt_create_dialog (self);
-			ec_driver_prompt_dialog_set_and_show (dlg, make, model, udi, printer_name);
-		}
-
-		g_free (driver);
+		ECDriverPromptDialog *dlg;	
+		dlg = ec_driver_prompt_create_dialog (self);
+		ec_driver_prompt_dialog_set_and_show (dlg, make, model, udi, printer_name);
         }
 
 	libhal_free_string (make);
diff -ru desktop-printing-0.19.orig/eggcups-0.19/ec-driver-prompt-dialog.c desktop-printing-0.19/eggcups-0.19/ec-driver-prompt-dialog.c
--- desktop-printing-0.19.orig/eggcups-0.19/ec-driver-prompt-dialog.c	2006-05-19 10:47:34.000000000 +0200
+++ desktop-printing-0.19/eggcups-0.19/ec-driver-prompt-dialog.c	2006-05-30 14:43:54.000000000 +0200
@@ -882,76 +882,6 @@
 	g_object_unref (gconf_client);
 }
 
-/* FIXME: This function needs to propagate errors
- */
-gboolean
-dbus_match_printer_driver (const gchar  *make, 
-			   const gchar  *model, 
-			   gchar       **driver)
-{
-	DBusConnection *connection;
-	DBusMessage *message = NULL;
-	DBusMessage *reply = NULL;
-	DBusMessageIter iter;
-	DBusError error;
-        const gchar *value;
-	gboolean driver_matches = FALSE;
-
-        if (driver)
-		*driver = NULL;
-
-	if (make == NULL || model == NULL)
-		return FALSE;
-
-	connection = dbus_bus_get (DBUS_BUS_SYSTEM, NULL);
-	if (connection == NULL) 
-		return TRUE;
-                                                                                
-	message = dbus_message_new_method_call (CUPS_DRIVER_CONFIG_NAMESPACE,
-        	                                CUPS_DRIVER_CONFIG_PATH,
-                                                CUPS_DRIVER_CONFIG_NAMESPACE,
-                	                        CUPS_DRIVER_CONFIG_MATCH_DRIVER_METHOD);
-	if (!message) {
-		driver_matches = TRUE;
-		goto out;
-	}
-                                                                                
-	dbus_message_iter_init_append (message, &iter);
-	dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &make);
-	dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &model);
-
-	dbus_error_init (&error);
-	reply = dbus_connection_send_with_reply_and_block (connection, message, 10000, &error);
-	if (dbus_error_is_set (&error)) {
-	      if (dbus_error_has_name (&error, CUPS_DRIVER_CONFIG_DRIVER_NOT_FOUND_ERROR)) {
-		    driver_matches = FALSE;
-	      } else {
-		    driver_matches = TRUE;
-	      }
-	      goto out;
-	}
-	
-	if (!dbus_message_get_args (reply, &error,
-                                    DBUS_TYPE_STRING, &value,
-                                    DBUS_TYPE_INVALID)) {
-		dbus_error_free (&error);
-		driver_matches = TRUE;
-	} else if (driver) {
-		*driver = g_strdup (value);
-		driver_matches = TRUE;
-	}
-	
- out:
-	dbus_connection_flush (connection);
-	if (message)
-		dbus_message_unref (message);
-	if (reply)
-		dbus_message_unref (reply);
-	dbus_connection_unref (connection);
-	
-	return driver_matches;
-}
-
 gboolean
 dbus_set_printer_driver (const gchar *make,
                          const gchar *model,
@@ -962,22 +892,19 @@
 	DBusConnection *connection;
 	DBusMessage *message;
 	DBusMessageIter iter;
-                                                                                
+
 	connection = dbus_bus_get (DBUS_BUS_SYSTEM, error);
 	if (connection == NULL) 
 		return FALSE;
-                                                                                
-	message = dbus_message_new_method_call (CUPS_DRIVER_CONFIG_NAMESPACE,
-        	                                CUPS_DRIVER_CONFIG_PATH,
-                                                CUPS_DRIVER_CONFIG_NAMESPACE,
-                	                        CUPS_DRIVER_CONFIG_SET_DRIVER_METHOD);
-                                                                                
+
+	message = dbus_message_new_method_call (HAL_NAMESPACE,
+        	                                udi,
+                                                HAL_PRINTER_INTERFACE,
+                	                        HAL_PRINTER_CONFIG_METHOD);
+				
 	dbus_message_iter_init_append (message, &iter);
 	dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &make);
 	dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &model);
-	dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &udi);
-	dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &name);
-
 
 	if (!dbus_connection_send (connection, message, NULL))
 		return FALSE;
@@ -1027,8 +954,8 @@
                                                                GTK_MESSAGE_ERROR,
                                                                GTK_BUTTONS_CLOSE,
                                                                "%s", error.message);
-
 			gtk_dialog_run (GTK_DIALOG (error_dialog));
+
 			dbus_error_free (&error);
 		}
 
diff -ru desktop-printing-0.19.orig/eggcups-0.19/ec-driver-prompt-dialog.h desktop-printing-0.19/eggcups-0.19/ec-driver-prompt-dialog.h
--- desktop-printing-0.19.orig/eggcups-0.19/ec-driver-prompt-dialog.h	2006-05-19 10:47:34.000000000 +0200
+++ desktop-printing-0.19/eggcups-0.19/ec-driver-prompt-dialog.h	2006-05-30 14:40:58.000000000 +0200
@@ -35,9 +35,9 @@
 #define CUPS_DRIVER_CONFIG_PATH      "/org/freedesktop/CupsDriverConfig"
 #define CUPS_DRIVER_CONFIG_NAMESPACE "org.freedesktop.CupsDriverConfig"
 
-#define CUPS_DRIVER_CONFIG_SET_DRIVER_METHOD "SetDriver"
-#define CUPS_DRIVER_CONFIG_MATCH_DRIVER_METHOD "MatchDriver"
-#define CUPS_DRIVER_CONFIG_DRIVER_NOT_FOUND_ERROR "org.freedesktop.CupsDriverConfig.DriverNotFound"
+#define HAL_NAMESPACE         "org.freedesktop.Hal"
+#define HAL_PRINTER_INTERFACE "org.freedesktop.Hal.Device.Printer"
+#define HAL_PRINTER_CONFIG_METHOD "Configure"
 
 #define EC_GCONF_PRINTER_PATH      "/system/printing/user_drivers"
 
@@ -80,10 +80,6 @@
                          				 const gchar *name,
                          				 DBusError *error);
 
-gboolean dbus_match_printer_driver 			(const gchar  *make, 
-			   				 const gchar  *model, 
-			   				 gchar       **driver);
-
 void ec_driver_prompt_dialog_set_and_show 		(ECDriverPromptDialog *dlg,
 				      			const gchar *make,
 				      			const gchar *model,


Index: desktop-printing.spec
===================================================================
RCS file: /cvs/dist/rpms/desktop-printing/devel/desktop-printing.spec,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- desktop-printing.spec	22 May 2006 10:26:29 -0000	1.55
+++ desktop-printing.spec	6 Jun 2006 10:32:57 -0000	1.56
@@ -5,7 +5,7 @@
 Summary: Desktop print icon
 Name: desktop-printing
 Version: 0.19
-Release: 7.2
+Release: 8
 License: GPL
 Group: Applications/File
 # total lie
@@ -13,11 +13,12 @@
 Source1: gnome-default-printer.png
 Patch0: desktop-printing-0.19-dbus-api.patch
 Patch1: eggcups-dbus-send-null-crash.patch
+Patch2: desktop-printing-0.19-hal_lpadmin.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 Requires: redhat-menus
 Requires: dbus >= %{dbus_version}, dbus-x11
-Requires: hal-cups-utils
+Requires: hal-cups-utils >= 0.6.0
 Requires: cups
 PreReq:   gtk2 >= %{gtk_version}
 
@@ -38,12 +39,13 @@
 pushd eggcups-%{version}
 %patch0 -p1 -b .dbus-api
 %patch1 -p0 -b .dbus-null-crash
+%patch2 -p2 -b .hal-lpadmin
 popd
 
 %build
 pushd eggcups-%{version}
 %configure --with-session-cupsd=no
-find . -type f -print0 \( -name '*.c' -o -name '*.h' -o -name '*.conf' \) | xargs -0 perl -pi -e 's,org/freedesktop/,com/redhat/,g;s,org.freedesktop.,com.redhat.,g'
+#find . -type f -print0 \( -name '*.c' -o -name '*.h' -o -name '*.conf' \) | xargs -0 perl -pi -e 's,org/freedesktop/,com/redhat/,g;s,org.freedesktop.,com.redhat.,g'
 make
 popd
 
@@ -91,6 +93,9 @@
 %{_sysconfdir}/gconf/*
 
 %changelog
+* Fri Jun 06 2006 Florian Festi <ffesti at redhat.com> - 0.19-8
+- patch for the new hal_lpadmin (hal-cups-utils)
+
 * Mon May 22 2006 Karsten Hopp <karsten at redhat.de> 0.19-7.2
 - add buildrequires openssl-devel
 




More information about the fedora-cvs-commits mailing list