[gnome-color-manager] trivial: When rescanning SANE, force it to drop the list of devices so we get the current list
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] trivial: When rescanning SANE, force it to drop the list of devices so we get the current list
- Date: Wed, 24 Mar 2010 12:40:23 +0000 (UTC)
commit 8efcc5280e9d4d73e0da636424c274457722a3ab
Author: Richard Hughes <richard hughsie com>
Date: Wed Mar 24 12:30:41 2010 +0000
trivial: When rescanning SANE, force it to drop the list of devices so we get the current list
src/gcm-client.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-client.c b/src/gcm-client.c
index dfec191..e7a366a 100644
--- a/src/gcm-client.c
+++ b/src/gcm-client.c
@@ -702,6 +702,10 @@ gcm_client_add_connected_devices_sane (GcmClient *client, GError **error)
SANE_Status status;
const SANE_Device **device_list;
+ /* force sane to drop it's cache of devices -- yes, it is that crap */
+ sane_exit ();
+ sane_init (NULL, NULL);
+
/* get scanners on the local server */
status = sane_get_devices (&device_list, FALSE);
if (status != SANE_STATUS_GOOD) {
@@ -709,6 +713,12 @@ gcm_client_add_connected_devices_sane (GcmClient *client, GError **error)
goto out;
}
+ /* nothing */
+ if (device_list == NULL || device_list[0] == NULL) {
+ egg_debug ("no devices to add");
+ goto out;
+ }
+
/* add them */
for (i=0; device_list[i] != NULL; i++)
gcm_client_sane_add (client, device_list[i]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]