]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: Let colord_get_profile_for_device_id() not return empty file name
authorTill Kamppeter <till.kamppeter@gmail.com>
Sun, 19 Sep 2021 17:32:33 +0000 (19:32 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Sun, 19 Sep 2021 17:32:33 +0000 (19:32 +0200)
If the function colord_get_profile_for_device_id() returns an empty
file name, the color generates an error message in the CUPS
error_log. Some print dialogs report every log message of level error
to the user even if the job got correctly printed.

cupsfilters/colord.c

index 3e15032fa64b79d63b5d831073f63f0e46223deb..6459197a1b89b0a3dd10cddbdd295d8f80de5861 100644 (file)
@@ -345,8 +345,8 @@ colord_get_profile_for_device_id (filter_data_t *data,
   con = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
   if (con == NULL) {
     // If D-Bus is not reachable, gracefully leave and ignore error
-//     if(log) log(ld, FILTER_LOGLEVEL_ERROR, 
-//             "Failed to connect to system bus");
+    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+               "Failed to connect to system bus");
     goto out;
   }
 
@@ -360,7 +360,7 @@ colord_get_profile_for_device_id (filter_data_t *data,
 
   /* get the best profile for the device */
   filename = get_profile_for_device_path(data, con, device_path, qualifier_tuple);
-  if (filename == NULL) {
+  if (filename == NULL || !filename[0]) {
     if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
                "Failed to get profile filename for %s", device_id);
     goto out;