Merge lp:~cjcurran/indicator-session/udev-beginnings into lp:indicator-session/0.1

Proposed by Conor Curran
Status: Superseded
Proposed branch: lp:~cjcurran/indicator-session/udev-beginnings
Merge into: lp:indicator-session/0.1
Diff against target: 1490 lines (+1286/-28)
7 files modified
configure.ac (+2/-0)
src/Makefile.am (+2/-1)
src/device-menu-mgr.c (+57/-13)
src/sane-rules.h (+778/-0)
src/udev-mgr.c (+416/-6)
src/udev-mgr.h (+15/-4)
src/user-menu-mgr.c (+16/-4)
To merge this branch: bzr merge lp:~cjcurran/indicator-session/udev-beginnings
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Needs Fixing
Review via email: mp+70534@code.launchpad.net

This proposal has been superseded by a proposal from 2011-08-09.

Description of the change

backend for scanners and webcams in place

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote :

- Your leaking all the contents of the lists you add to the hash tables as g_list_free isn't going to do anything to the data the list points too. I think you need to initially do something like iterate the hash table, which then calls g_list_foreach on every value with g_free.

- gchar* random_scanner_name = g_strdup_printf("%p--scanner", self);
  g_hash_table_insert (self->scanners_present,
                       g_strdup(random_scanner_name),
                       g_strdup("Scanner"));
  g_free (random_scanner_name);

just don't free random_scanner_name and send it in without g_strdup?

Apart from that, nothing jumps out at me. However, I can't mark as approved as it crashes every time on my system with the same backtrace as we spoke about (when trying to register the DBus Service). I tried lp:indicator-session and it runs fine, so it's definitely something in this branch :/

I'll have another look at the diff tomorrow morning, but if your around it would be good to maybe go through on Mumble or something to see if there's something we've missed?

review: Needs Fixing
189. By Conor Curran

fixed memory leaks

190. By Conor Curran

segfault found and fixed

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2011-07-22 17:15:55 +0000
+++ configure.ac 2011-08-09 11:36:39 +0000
@@ -58,12 +58,14 @@
58 [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION58 [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION
59 dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION59 dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION
60 dbus-glib-160 dbus-glib-1
61 gudev-1.0
61 gio-unix-2.062 gio-unix-2.0
62 indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION)63 indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION)
63 ],64 ],
64 [test "x$with_gtk" = x2],65 [test "x$with_gtk" = x2],
65 [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION66 [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION
66 dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION67 dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION
68 gudev-1.0
67 dbus-glib-169 dbus-glib-1
68 gio-unix-2.070 gio-unix-2.0
69 indicator-0.4 >= $INDICATOR_REQUIRED_VERSION)71 indicator-0.4 >= $INDICATOR_REQUIRED_VERSION)
7072
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2011-07-21 15:38:44 +0000
+++ src/Makefile.am 2011-08-09 11:36:39 +0000
@@ -101,7 +101,8 @@
101 apt-transaction.h \101 apt-transaction.h \
102 apt-transaction.c \102 apt-transaction.c \
103 udev-mgr.h \103 udev-mgr.h \
104 udev-mgr.c104 udev-mgr.c \
105 sane-rules.h
105indicator_session_service_CFLAGS = \106indicator_session_service_CFLAGS = \
106 $(SESSIONSERVICE_CFLAGS) \107 $(SESSIONSERVICE_CFLAGS) \
107 $(GCONF_CFLAGS) \108 $(GCONF_CFLAGS) \
108109
=== modified file 'src/device-menu-mgr.c'
--- src/device-menu-mgr.c 2011-07-22 14:36:59 +0000
+++ src/device-menu-mgr.c 2011-08-09 11:36:39 +0000
@@ -27,7 +27,7 @@
27#include "lock-helper.h"27#include "lock-helper.h"
28#include "upower-client.h"28#include "upower-client.h"
29#include "apt-watcher.h"29#include "apt-watcher.h"
3030#include "udev-mgr.h"
3131
32#define UP_ADDRESS "org.freedesktop.UPower"32#define UP_ADDRESS "org.freedesktop.UPower"
33#define UP_OBJECT "/org/freedesktop/UPower"33#define UP_OBJECT "/org/freedesktop/UPower"
@@ -41,6 +41,7 @@
41 DbusmenuMenuitem* root_item;41 DbusmenuMenuitem* root_item;
42 SessionDbus* session_dbus_interface; 42 SessionDbus* session_dbus_interface;
43 AptWatcher* apt_watcher; 43 AptWatcher* apt_watcher;
44 UdevMgr* udev_mgr;
44};45};
4546
46static GConfClient *gconf_client = NULL;47static GConfClient *gconf_client = NULL;
@@ -80,8 +81,15 @@
80 gchar* type);81 gchar* type);
81static void show_system_settings_with_context (DbusmenuMenuitem * mi,82static void show_system_settings_with_context (DbusmenuMenuitem * mi,
82 guint timestamp,83 guint timestamp,
83 gchar * type); 84 gchar * type);
84 85
86static void device_menu_mgr_show_simple_scan (DbusmenuMenuitem * mi,
87 guint timestamp,
88 gchar * type);
89static void device_menu_mgr_show_cheese (DbusmenuMenuitem * mi,
90 guint timestamp,
91 gchar * type);
92
85static void93static void
86machine_sleep_from_hibernate (DbusmenuMenuitem * mi,94machine_sleep_from_hibernate (DbusmenuMenuitem * mi,
87 guint timestamp,95 guint timestamp,
@@ -214,7 +222,6 @@
214222
215 screensaver_throttle(type);223 screensaver_throttle(type);
216 lock_if_possible (self);224 lock_if_possible (self);
217
218 dbus_g_proxy_begin_call(up_main_proxy,225 dbus_g_proxy_begin_call(up_main_proxy,
219 type,226 type,
220 sleep_response,227 sleep_response,
@@ -460,6 +467,43 @@
460 g_free(control_centre_command);467 g_free(control_centre_command);
461}468}
462469
470// TODO: refactor both of these down to the one method.
471static void device_menu_mgr_show_simple_scan (DbusmenuMenuitem * mi,
472 guint timestamp,
473 gchar * type)
474{
475 GError * error = NULL;
476 if (!g_spawn_command_line_async("simple-scan", &error))
477 {
478 g_warning("Unable to launch simple-scan: %s", error->message);
479 g_error_free(error);
480 if (!g_spawn_command_line_async("software-center simple-scan", &error))
481 {
482 g_warning ("Unable to launch software-centre simple-scan: %s",
483 error->message);
484 g_error_free(error);
485 }
486 }
487}
488
489static void device_menu_mgr_show_cheese (DbusmenuMenuitem * mi,
490 guint timestamp,
491 gchar * type)
492{
493 GError * error = NULL;
494 if (!g_spawn_command_line_async("cheese", &error))
495 {
496 g_warning("Unable to launch cheese: %s", error->message);
497 g_error_free(error);
498 if (!g_spawn_command_line_async("software-center cheese", &error))
499 {
500 g_warning ("Unable to launch software-centre cheese: %s",
501 error->message);
502 g_error_free(error);
503 }
504 }
505}
506
463static void507static void
464device_menu_mgr_build_static_items (DeviceMenuMgr* self)508device_menu_mgr_build_static_items (DeviceMenuMgr* self)
465{509{
@@ -547,15 +591,14 @@
547 scanners_menuitem = dbusmenu_menuitem_new();591 scanners_menuitem = dbusmenu_menuitem_new();
548 dbusmenu_menuitem_property_set (scanners_menuitem,592 dbusmenu_menuitem_property_set (scanners_menuitem,
549 DBUSMENU_MENUITEM_PROP_LABEL,593 DBUSMENU_MENUITEM_PROP_LABEL,
550 _("HP Scanners"));594 _("Scanners"));
551 g_signal_connect (G_OBJECT(scanners_menuitem),595 g_signal_connect (G_OBJECT(scanners_menuitem),
552 DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,596 DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
553 G_CALLBACK(show_system_settings_with_context),597 G_CALLBACK(device_menu_mgr_show_simple_scan),
554 "scanners");598 NULL);
555 dbusmenu_menuitem_child_add_position (self->root_item,599 dbusmenu_menuitem_child_add_position (self->root_item,
556 scanners_menuitem,600 scanners_menuitem,
557 8);601 8);
558 //tmp
559 dbusmenu_menuitem_property_set_bool (scanners_menuitem,602 dbusmenu_menuitem_property_set_bool (scanners_menuitem,
560 DBUSMENU_MENUITEM_PROP_VISIBLE,603 DBUSMENU_MENUITEM_PROP_VISIBLE,
561 FALSE);604 FALSE);
@@ -563,15 +606,14 @@
563 webcam_menuitem = dbusmenu_menuitem_new();606 webcam_menuitem = dbusmenu_menuitem_new();
564 dbusmenu_menuitem_property_set (webcam_menuitem,607 dbusmenu_menuitem_property_set (webcam_menuitem,
565 DBUSMENU_MENUITEM_PROP_LABEL,608 DBUSMENU_MENUITEM_PROP_LABEL,
566 _("HP Webcam"));609 _("Webcam"));
567 g_signal_connect (G_OBJECT(webcam_menuitem),610 g_signal_connect (G_OBJECT(webcam_menuitem),
568 DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,611 DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
569 G_CALLBACK(show_system_settings_with_context),612 G_CALLBACK(device_menu_mgr_show_cheese),
570 "HP Webcam");613 NULL);
571 dbusmenu_menuitem_child_add_position (self->root_item,614 dbusmenu_menuitem_child_add_position (self->root_item,
572 webcam_menuitem,615 webcam_menuitem,
573 10);616 10);
574 //tmp
575 dbusmenu_menuitem_property_set_bool (webcam_menuitem,617 dbusmenu_menuitem_property_set_bool (webcam_menuitem,
576 DBUSMENU_MENUITEM_PROP_VISIBLE,618 DBUSMENU_MENUITEM_PROP_VISIBLE,
577 FALSE);619 FALSE);
@@ -681,7 +723,9 @@
681 restart_shutdown_logout_mi->logout_mi = logout_mi;723 restart_shutdown_logout_mi->logout_mi = logout_mi;
682 restart_shutdown_logout_mi->shutdown_mi = shutdown_mi;724 restart_shutdown_logout_mi->shutdown_mi = shutdown_mi;
683725
684 update_menu_entries(restart_shutdown_logout_mi); 726 update_menu_entries(restart_shutdown_logout_mi);
727 // Time to create the udev mgr and hand it the static relevant items.
728 self->udev_mgr = udev_mgr_new (scanners_menuitem, webcam_menuitem);
685}729}
686730
687731
688732
=== added file 'src/sane-rules.h'
--- src/sane-rules.h 1970-01-01 00:00:00 +0000
+++ src/sane-rules.h 2011-08-09 11:36:39 +0000
@@ -0,0 +1,778 @@
1void populate_scsi_scanners (GHashTable* scanners)
2{
3 GList* epson = NULL;
4 epson = g_list_append (epson, g_strdup ("GT-9700"));
5 epson = g_list_append (epson, g_strdup ("GT-9800"));
6 epson = g_list_append (epson, g_strdup ("Perfection1200"));
7 epson = g_list_append (epson, g_strdup ("Perfection636"));
8 epson = g_list_append (epson, g_strdup ("SCANNER GT-7000"));
9 g_hash_table_insert (scanners,
10 g_strdup("EPSON"),
11 epson);
12
13
14 GList* hp = NULL;
15 hp = g_list_append (hp, g_strdup ("C1130A"));
16 hp = g_list_append (hp, g_strdup ("C1750A"));
17 hp = g_list_append (hp, g_strdup ("C1790A"));
18 hp = g_list_append (hp, g_strdup ("C2500A"));
19 hp = g_list_append (hp, g_strdup ("C2520A"));
20 hp = g_list_append (hp, g_strdup ("C5110A"));
21 hp = g_list_append (hp, g_strdup ("C6270A"));
22 hp = g_list_append (hp, g_strdup ("C7670A"));
23 g_hash_table_insert (scanners,
24 g_strdup("HP"),
25 hp);
26}
27
28
29
30void populate_usb_scanners (GHashTable* scanners)
31{
32 GList* hp = NULL;
33
34 hp = g_list_append (hp, g_strdup ("0101"));
35 hp = g_list_append (hp, g_strdup ("0105"));
36 hp = g_list_append (hp, g_strdup ("0201"));
37 hp = g_list_append (hp, g_strdup ("0205"));
38 hp = g_list_append (hp, g_strdup ("0305"));
39 hp = g_list_append (hp, g_strdup ("0401"));
40 hp = g_list_append (hp, g_strdup ("0405"));
41 hp = g_list_append (hp, g_strdup ("0505"));
42 hp = g_list_append (hp, g_strdup ("0601"));
43 hp = g_list_append (hp, g_strdup ("0605"));
44 hp = g_list_append (hp, g_strdup ("0701"));
45 hp = g_list_append (hp, g_strdup ("0705"));
46 hp = g_list_append (hp, g_strdup ("0801"));
47 hp = g_list_append (hp, g_strdup ("0805"));
48 hp = g_list_append (hp, g_strdup ("0901"));
49 hp = g_list_append (hp, g_strdup ("0a01"));
50 hp = g_list_append (hp, g_strdup ("0b01"));
51 hp = g_list_append (hp, g_strdup ("1005"));
52 hp = g_list_append (hp, g_strdup ("1105"));
53 hp = g_list_append (hp, g_strdup ("1205"));
54 hp = g_list_append (hp, g_strdup ("1305"));
55 hp = g_list_append (hp, g_strdup ("1405"));
56 hp = g_list_append (hp, g_strdup ("1705"));
57 hp = g_list_append (hp, g_strdup ("1805"));
58 hp = g_list_append (hp, g_strdup ("2005"));
59 hp = g_list_append (hp, g_strdup ("2205"));
60 hp = g_list_append (hp, g_strdup ("2305"));
61 hp = g_list_append (hp, g_strdup ("2405"));
62 hp = g_list_append (hp, g_strdup ("2605"));
63 hp = g_list_append (hp, g_strdup ("2805"));
64 hp = g_list_append (hp, g_strdup ("3805"));
65 hp = g_list_append (hp, g_strdup ("3905"));
66 hp = g_list_append (hp, g_strdup ("3B17"));
67 hp = g_list_append (hp, g_strdup ("4105"));
68 hp = g_list_append (hp, g_strdup ("4205"));
69 hp = g_list_append (hp, g_strdup ("4305"));
70 hp = g_list_append (hp, g_strdup ("4505"));
71 hp = g_list_append (hp, g_strdup ("4605"));
72 hp = g_list_append (hp, g_strdup ("5617"));
73 hp = g_list_append (hp, g_strdup ("5717"));
74
75 g_hash_table_insert (scanners,
76 g_strdup("03f0"),
77 hp);
78
79 GList* mustek_2 = NULL;
80 mustek_2 = g_list_append (mustek_2, g_strdup ("1000"));
81 mustek_2 = g_list_append (mustek_2, g_strdup ("1001"));
82 g_hash_table_insert (scanners,
83 g_strdup("0400"),
84 mustek_2);
85
86 GList* kodak = NULL;
87 kodak = g_list_append (kodak, g_strdup ("6001"));
88 kodak = g_list_append (kodak, g_strdup ("6002"));
89 kodak = g_list_append (kodak, g_strdup ("6003"));
90 kodak = g_list_append (kodak, g_strdup ("6004"));
91 kodak = g_list_append (kodak, g_strdup ("6005"));
92 g_hash_table_insert (scanners,
93 g_strdup("040a"),
94 kodak);
95
96 GList* creative = NULL;
97
98 creative = g_list_append (creative, g_strdup ("4007"));
99
100 g_hash_table_insert (scanners,
101 g_strdup("041e"),
102 creative);
103
104 GList* lexmark = NULL;
105
106 lexmark = g_list_append (lexmark, g_strdup("002d"));
107 lexmark = g_list_append (lexmark, g_strdup("0060"));
108 lexmark = g_list_append (lexmark, g_strdup("007c"));
109 lexmark = g_list_append (lexmark, g_strdup("007d"));
110
111 g_hash_table_insert (scanners,
112 g_strdup("043d"),
113 lexmark);
114
115
116 GList* genius = NULL;
117 genius = g_list_append (genius, g_strdup("2004"));
118 genius = g_list_append (genius, g_strdup("2007"));
119 genius = g_list_append (genius, g_strdup("2008"));
120 genius = g_list_append (genius, g_strdup("2009"));
121 genius = g_list_append (genius, g_strdup("2011"));
122 genius = g_list_append (genius, g_strdup("2013"));
123 genius = g_list_append (genius, g_strdup("2014"));
124 genius = g_list_append (genius, g_strdup("2015"));
125 genius = g_list_append (genius, g_strdup("2016"));
126 genius = g_list_append (genius, g_strdup("2017"));
127 genius = g_list_append (genius, g_strdup("201a"));
128 genius = g_list_append (genius, g_strdup("201b"));
129 genius = g_list_append (genius, g_strdup("201d"));
130 genius = g_list_append (genius, g_strdup("201e"));
131 genius = g_list_append (genius, g_strdup("201f"));
132 genius = g_list_append (genius, g_strdup("20c1"));
133 g_hash_table_insert (scanners,
134 g_strdup("0458"),
135 genius);
136
137 GList* medion = NULL;
138 medion = g_list_append (medion, g_strdup("0377"));
139 g_hash_table_insert (scanners,
140 g_strdup("0461"),
141 medion);
142
143 GList* trust = NULL;
144 trust = g_list_append (trust, g_strdup("1000"));
145 trust = g_list_append (trust, g_strdup("1002"));
146 g_hash_table_insert (scanners,
147 g_strdup("047b"),
148 trust);
149
150 GList* kyocera = NULL;
151 kyocera = g_list_append (kyocera, g_strdup("0335"));
152 g_hash_table_insert (scanners,
153 g_strdup("0482"),
154 kyocera);
155
156 GList* compaq = NULL;
157 compaq = g_list_append (compaq, g_strdup("001a"));
158 g_hash_table_insert (scanners,
159 g_strdup("049f"),
160 compaq);
161 GList* benq = NULL;
162 benq = g_list_append (benq, g_strdup("1a20"));
163 benq = g_list_append (benq, g_strdup("1a2a"));
164 benq = g_list_append (benq, g_strdup("2022"));
165 benq = g_list_append (benq, g_strdup("2040"));
166 benq = g_list_append (benq, g_strdup("2060"));
167 benq = g_list_append (benq, g_strdup("207e"));
168 benq = g_list_append (benq, g_strdup("20b0"));
169 benq = g_list_append (benq, g_strdup("20be"));
170 benq = g_list_append (benq, g_strdup("20c0"));
171 benq = g_list_append (benq, g_strdup("20de"));
172 benq = g_list_append (benq, g_strdup("20f8"));
173 benq = g_list_append (benq, g_strdup("20fc"));
174 benq = g_list_append (benq, g_strdup("20fe"));
175 benq = g_list_append (benq, g_strdup("2137"));
176 benq = g_list_append (benq, g_strdup("2211"));
177 g_hash_table_insert (scanners,
178 g_strdup("04a5"),
179 benq);
180
181 GList* visioneer = NULL;
182 visioneer = g_list_append (visioneer, g_strdup("0229"));
183 visioneer = g_list_append (visioneer, g_strdup("0390"));
184 visioneer = g_list_append (visioneer, g_strdup("0420"));
185 visioneer = g_list_append (visioneer, g_strdup("0421"));
186 visioneer = g_list_append (visioneer, g_strdup("0422"));
187 visioneer = g_list_append (visioneer, g_strdup("0423"));
188 visioneer = g_list_append (visioneer, g_strdup("0424"));
189 visioneer = g_list_append (visioneer, g_strdup("0426"));
190 visioneer = g_list_append (visioneer, g_strdup("0427"));
191 visioneer = g_list_append (visioneer, g_strdup("0444"));
192 visioneer = g_list_append (visioneer, g_strdup("0446"));
193 visioneer = g_list_append (visioneer, g_strdup("0447"));
194 visioneer = g_list_append (visioneer, g_strdup("0448"));
195 visioneer = g_list_append (visioneer, g_strdup("0449"));
196 visioneer = g_list_append (visioneer, g_strdup("044c"));
197 visioneer = g_list_append (visioneer, g_strdup("0474"));
198 visioneer = g_list_append (visioneer, g_strdup("0475"));
199 visioneer = g_list_append (visioneer, g_strdup("0477"));
200 visioneer = g_list_append (visioneer, g_strdup("0478"));
201 visioneer = g_list_append (visioneer, g_strdup("0479"));
202 visioneer = g_list_append (visioneer, g_strdup("047a"));
203 visioneer = g_list_append (visioneer, g_strdup("047b"));
204 visioneer = g_list_append (visioneer, g_strdup("047c"));
205 visioneer = g_list_append (visioneer, g_strdup("048c"));
206 visioneer = g_list_append (visioneer, g_strdup("048d"));
207 visioneer = g_list_append (visioneer, g_strdup("048e"));
208 visioneer = g_list_append (visioneer, g_strdup("048f"));
209 visioneer = g_list_append (visioneer, g_strdup("0490"));
210 visioneer = g_list_append (visioneer, g_strdup("0491"));
211 visioneer = g_list_append (visioneer, g_strdup("0492"));
212 visioneer = g_list_append (visioneer, g_strdup("0493"));
213 visioneer = g_list_append (visioneer, g_strdup("0494"));
214 visioneer = g_list_append (visioneer, g_strdup("0495"));
215 visioneer = g_list_append (visioneer, g_strdup("0497"));
216 visioneer = g_list_append (visioneer, g_strdup("0498"));
217 visioneer = g_list_append (visioneer, g_strdup("0499"));
218 visioneer = g_list_append (visioneer, g_strdup("049a"));
219 visioneer = g_list_append (visioneer, g_strdup("049b"));
220 visioneer = g_list_append (visioneer, g_strdup("049c"));
221 visioneer = g_list_append (visioneer, g_strdup("049d"));
222 visioneer = g_list_append (visioneer, g_strdup("04a7"));
223 visioneer = g_list_append (visioneer, g_strdup("04ac"));
224 g_hash_table_insert (scanners,
225 g_strdup("04a7"),
226 visioneer);
227 GList* canon = NULL;
228 canon = g_list_append (canon, g_strdup("1601"));
229 canon = g_list_append (canon, g_strdup("1602"));
230 canon = g_list_append (canon, g_strdup("1603"));
231 canon = g_list_append (canon, g_strdup("1604"));
232 canon = g_list_append (canon, g_strdup("1606"));
233 canon = g_list_append (canon, g_strdup("1607"));
234 canon = g_list_append (canon, g_strdup("1608"));
235 canon = g_list_append (canon, g_strdup("1609"));
236 canon = g_list_append (canon, g_strdup("160a"));
237 canon = g_list_append (canon, g_strdup("160b"));
238 canon = g_list_append (canon, g_strdup("1706"));
239 canon = g_list_append (canon, g_strdup("1707"));
240 canon = g_list_append (canon, g_strdup("1708"));
241 canon = g_list_append (canon, g_strdup("1709"));
242 canon = g_list_append (canon, g_strdup("170a"));
243 canon = g_list_append (canon, g_strdup("170b"));
244 canon = g_list_append (canon, g_strdup("170c"));
245 canon = g_list_append (canon, g_strdup("170d"));
246 canon = g_list_append (canon, g_strdup("170e"));
247 canon = g_list_append (canon, g_strdup("1712"));
248 canon = g_list_append (canon, g_strdup("1713"));
249 canon = g_list_append (canon, g_strdup("1714"));
250 canon = g_list_append (canon, g_strdup("1715"));
251 canon = g_list_append (canon, g_strdup("1716"));
252 canon = g_list_append (canon, g_strdup("1717"));
253 canon = g_list_append (canon, g_strdup("1718"));
254 canon = g_list_append (canon, g_strdup("1719"));
255 canon = g_list_append (canon, g_strdup("171a"));
256 canon = g_list_append (canon, g_strdup("171b"));
257 canon = g_list_append (canon, g_strdup("171c"));
258 canon = g_list_append (canon, g_strdup("1721"));
259 canon = g_list_append (canon, g_strdup("1722"));
260 canon = g_list_append (canon, g_strdup("1723"));
261 canon = g_list_append (canon, g_strdup("1724"));
262 canon = g_list_append (canon, g_strdup("1725"));
263 canon = g_list_append (canon, g_strdup("1726"));
264 canon = g_list_append (canon, g_strdup("1727"));
265 canon = g_list_append (canon, g_strdup("1728"));
266 canon = g_list_append (canon, g_strdup("1729"));
267 canon = g_list_append (canon, g_strdup("172b"));
268 canon = g_list_append (canon, g_strdup("172c"));
269 canon = g_list_append (canon, g_strdup("172d"));
270 canon = g_list_append (canon, g_strdup("172e"));
271 canon = g_list_append (canon, g_strdup("172f"));
272 canon = g_list_append (canon, g_strdup("1730"));
273 canon = g_list_append (canon, g_strdup("1731"));
274 canon = g_list_append (canon, g_strdup("1732"));
275 canon = g_list_append (canon, g_strdup("1733"));
276 canon = g_list_append (canon, g_strdup("1734"));
277 canon = g_list_append (canon, g_strdup("1735"));
278 canon = g_list_append (canon, g_strdup("1736"));
279 canon = g_list_append (canon, g_strdup("173a"));
280 canon = g_list_append (canon, g_strdup("173b"));
281 canon = g_list_append (canon, g_strdup("173c"));
282 canon = g_list_append (canon, g_strdup("173d"));
283 canon = g_list_append (canon, g_strdup("173e"));
284 canon = g_list_append (canon, g_strdup("173f"));
285 canon = g_list_append (canon, g_strdup("1740"));
286 canon = g_list_append (canon, g_strdup("1741"));
287 canon = g_list_append (canon, g_strdup("1742"));
288 canon = g_list_append (canon, g_strdup("1901"));
289 canon = g_list_append (canon, g_strdup("1904"));
290 canon = g_list_append (canon, g_strdup("1905"));
291 canon = g_list_append (canon, g_strdup("1909"));
292 canon = g_list_append (canon, g_strdup("190a"));
293 canon = g_list_append (canon, g_strdup("2204"));
294 canon = g_list_append (canon, g_strdup("2206"));
295 canon = g_list_append (canon, g_strdup("2207"));
296 canon = g_list_append (canon, g_strdup("2208"));
297 canon = g_list_append (canon, g_strdup("220d"));
298 canon = g_list_append (canon, g_strdup("220e"));
299 canon = g_list_append (canon, g_strdup("2213"));
300 canon = g_list_append (canon, g_strdup("221c"));
301 canon = g_list_append (canon, g_strdup("2220"));
302 canon = g_list_append (canon, g_strdup("2222"));
303 canon = g_list_append (canon, g_strdup("262f"));
304 canon = g_list_append (canon, g_strdup("2630"));
305 canon = g_list_append (canon, g_strdup("263c"));
306 canon = g_list_append (canon, g_strdup("263d"));
307 canon = g_list_append (canon, g_strdup("263e"));
308 canon = g_list_append (canon, g_strdup("263f"));
309 canon = g_list_append (canon, g_strdup("264c"));
310 canon = g_list_append (canon, g_strdup("264d"));
311 canon = g_list_append (canon, g_strdup("264e"));
312 canon = g_list_append (canon, g_strdup("264f"));
313 canon = g_list_append (canon, g_strdup("2659"));
314 canon = g_list_append (canon, g_strdup("265d"));
315 canon = g_list_append (canon, g_strdup("265e"));
316 canon = g_list_append (canon, g_strdup("265f"));
317 canon = g_list_append (canon, g_strdup("2660"));
318 canon = g_list_append (canon, g_strdup("2684"));
319 canon = g_list_append (canon, g_strdup("2686"));
320 canon = g_list_append (canon, g_strdup("26a3"));
321 canon = g_list_append (canon, g_strdup("26b0"));
322 canon = g_list_append (canon, g_strdup("26b4"));
323 canon = g_list_append (canon, g_strdup("26b5"));
324 canon = g_list_append (canon, g_strdup("26ec"));
325 canon = g_list_append (canon, g_strdup("26ed"));
326 canon = g_list_append (canon, g_strdup("26ee"));
327 g_hash_table_insert (scanners,
328 g_strdup("04a9"),
329 canon);
330
331 GList* nikon = NULL;
332 nikon = g_list_append (nikon, g_strdup ("4000"));
333 nikon = g_list_append (nikon, g_strdup ("4001"));
334 nikon = g_list_append (nikon, g_strdup ("4002"));
335 g_hash_table_insert (scanners,
336 g_strdup("04b0"),
337 nikon);
338
339 GList* epson = NULL;
340
341 // for testing (its a printer not a scanner!)
342 //epson = g_list_append (epson, g_strdup ("0001"));
343
344 epson = g_list_append (epson, g_strdup("0101"));
345 epson = g_list_append (epson, g_strdup("0103"));
346 epson = g_list_append (epson, g_strdup("0104"));
347 epson = g_list_append (epson, g_strdup("0105"));
348 epson = g_list_append (epson, g_strdup("0106"));
349 epson = g_list_append (epson, g_strdup("0107"));
350 epson = g_list_append (epson, g_strdup("0109"));
351 epson = g_list_append (epson, g_strdup("010a"));
352 epson = g_list_append (epson, g_strdup("010b"));
353 epson = g_list_append (epson, g_strdup("010c"));
354 epson = g_list_append (epson, g_strdup("010e"));
355 epson = g_list_append (epson, g_strdup("010f"));
356 epson = g_list_append (epson, g_strdup("0110"));
357 epson = g_list_append (epson, g_strdup("0112"));
358 epson = g_list_append (epson, g_strdup("0114"));
359 epson = g_list_append (epson, g_strdup("011b"));
360 epson = g_list_append (epson, g_strdup("011c"));
361 epson = g_list_append (epson, g_strdup("011d"));
362 epson = g_list_append (epson, g_strdup("011e"));
363 epson = g_list_append (epson, g_strdup("011f"));
364 epson = g_list_append (epson, g_strdup("0120"));
365 epson = g_list_append (epson, g_strdup("0121"));
366 epson = g_list_append (epson, g_strdup("0122"));
367 epson = g_list_append (epson, g_strdup("0126"));
368 epson = g_list_append (epson, g_strdup("0128"));
369 epson = g_list_append (epson, g_strdup("0129"));
370 epson = g_list_append (epson, g_strdup("012a"));
371 epson = g_list_append (epson, g_strdup("012b"));
372 epson = g_list_append (epson, g_strdup("012c"));
373 epson = g_list_append (epson, g_strdup("0135"));
374 epson = g_list_append (epson, g_strdup("0801"));
375 epson = g_list_append (epson, g_strdup("0802"));
376 epson = g_list_append (epson, g_strdup("0805"));
377 epson = g_list_append (epson, g_strdup("0806"));
378 epson = g_list_append (epson, g_strdup("0807"));
379 epson = g_list_append (epson, g_strdup("0808"));
380 epson = g_list_append (epson, g_strdup("080c"));
381 epson = g_list_append (epson, g_strdup("080d"));
382 epson = g_list_append (epson, g_strdup("080e"));
383 epson = g_list_append (epson, g_strdup("080f"));
384 epson = g_list_append (epson, g_strdup("0810"));
385 epson = g_list_append (epson, g_strdup("0811"));
386 epson = g_list_append (epson, g_strdup("0813"));
387 epson = g_list_append (epson, g_strdup("0814"));
388 epson = g_list_append (epson, g_strdup("0815"));
389 epson = g_list_append (epson, g_strdup("0817"));
390 epson = g_list_append (epson, g_strdup("0818"));
391 epson = g_list_append (epson, g_strdup("0819"));
392 epson = g_list_append (epson, g_strdup("081a"));
393 epson = g_list_append (epson, g_strdup("081c"));
394 epson = g_list_append (epson, g_strdup("081d"));
395 epson = g_list_append (epson, g_strdup("081f"));
396 epson = g_list_append (epson, g_strdup("0820"));
397 epson = g_list_append (epson, g_strdup("0827"));
398 epson = g_list_append (epson, g_strdup("0828"));
399 epson = g_list_append (epson, g_strdup("0829"));
400 epson = g_list_append (epson, g_strdup("082a"));
401 epson = g_list_append (epson, g_strdup("082b"));
402 epson = g_list_append (epson, g_strdup("082e"));
403 epson = g_list_append (epson, g_strdup("082f"));
404 epson = g_list_append (epson, g_strdup("0830"));
405 epson = g_list_append (epson, g_strdup("0833"));
406 epson = g_list_append (epson, g_strdup("0834"));
407 epson = g_list_append (epson, g_strdup("0835"));
408 epson = g_list_append (epson, g_strdup("0836"));
409 epson = g_list_append (epson, g_strdup("0837"));
410 epson = g_list_append (epson, g_strdup("0838"));
411 epson = g_list_append (epson, g_strdup("0839"));
412 epson = g_list_append (epson, g_strdup("083a"));
413 epson = g_list_append (epson, g_strdup("083c"));
414 epson = g_list_append (epson, g_strdup("0841"));
415 epson = g_list_append (epson, g_strdup("0843"));
416 epson = g_list_append (epson, g_strdup("0844"));
417 epson = g_list_append (epson, g_strdup("0846"));
418 epson = g_list_append (epson, g_strdup("0847"));
419 epson = g_list_append (epson, g_strdup("0848"));
420 epson = g_list_append (epson, g_strdup("0849"));
421 epson = g_list_append (epson, g_strdup("084a"));
422 epson = g_list_append (epson, g_strdup("084c"));
423 epson = g_list_append (epson, g_strdup("084d"));
424 epson = g_list_append (epson, g_strdup("084f"));
425 epson = g_list_append (epson, g_strdup("0851"));
426 epson = g_list_append (epson, g_strdup("0854"));
427 epson = g_list_append (epson, g_strdup("0856"));
428 g_hash_table_insert (scanners,
429 g_strdup("04b8"),
430 epson);
431
432 GList* fujitsu = NULL;
433 fujitsu = g_list_append (fujitsu, g_strdup ("1029"));
434 fujitsu = g_list_append (fujitsu, g_strdup ("1041"));
435 fujitsu = g_list_append (fujitsu, g_strdup ("1042"));
436 fujitsu = g_list_append (fujitsu, g_strdup ("1078"));
437 fujitsu = g_list_append (fujitsu, g_strdup ("1095"));
438 fujitsu = g_list_append (fujitsu, g_strdup ("1096"));
439 fujitsu = g_list_append (fujitsu, g_strdup ("1097"));
440 fujitsu = g_list_append (fujitsu, g_strdup ("10ad"));
441 fujitsu = g_list_append (fujitsu, g_strdup ("10ae"));
442 fujitsu = g_list_append (fujitsu, g_strdup ("10af"));
443 fujitsu = g_list_append (fujitsu, g_strdup ("10c7"));
444 fujitsu = g_list_append (fujitsu, g_strdup ("10cf"));
445 fujitsu = g_list_append (fujitsu, g_strdup ("10e0"));
446 fujitsu = g_list_append (fujitsu, g_strdup ("10e1"));
447 fujitsu = g_list_append (fujitsu, g_strdup ("10e2"));
448 fujitsu = g_list_append (fujitsu, g_strdup ("10e6"));
449 fujitsu = g_list_append (fujitsu, g_strdup ("10e7"));
450 fujitsu = g_list_append (fujitsu, g_strdup ("10ef"));
451 fujitsu = g_list_append (fujitsu, g_strdup ("10f2"));
452 fujitsu = g_list_append (fujitsu, g_strdup ("10fe"));
453 fujitsu = g_list_append (fujitsu, g_strdup ("1135"));
454 fujitsu = g_list_append (fujitsu, g_strdup ("114a"));
455 fujitsu = g_list_append (fujitsu, g_strdup ("114d"));
456 fujitsu = g_list_append (fujitsu, g_strdup ("114e"));
457 fujitsu = g_list_append (fujitsu, g_strdup ("114f"));
458 fujitsu = g_list_append (fujitsu, g_strdup ("1150"));
459 fujitsu = g_list_append (fujitsu, g_strdup ("1155"));
460 fujitsu = g_list_append (fujitsu, g_strdup ("1156"));
461 fujitsu = g_list_append (fujitsu, g_strdup ("116f"));
462 fujitsu = g_list_append (fujitsu, g_strdup ("1174"));
463 fujitsu = g_list_append (fujitsu, g_strdup ("1175"));
464 fujitsu = g_list_append (fujitsu, g_strdup ("1176"));
465 fujitsu = g_list_append (fujitsu, g_strdup ("1177"));
466 fujitsu = g_list_append (fujitsu, g_strdup ("1178"));
467 fujitsu = g_list_append (fujitsu, g_strdup ("117f"));
468 fujitsu = g_list_append (fujitsu, g_strdup ("119d"));
469 fujitsu = g_list_append (fujitsu, g_strdup ("119e"));
470 fujitsu = g_list_append (fujitsu, g_strdup ("119f"));
471 fujitsu = g_list_append (fujitsu, g_strdup ("11a0"));
472 fujitsu = g_list_append (fujitsu, g_strdup ("11a2"));
473 fujitsu = g_list_append (fujitsu, g_strdup ("11ed"));
474 fujitsu = g_list_append (fujitsu, g_strdup ("11ee"));
475 fujitsu = g_list_append (fujitsu, g_strdup ("11ef"));
476 fujitsu = g_list_append (fujitsu, g_strdup ("11f1"));
477 fujitsu = g_list_append (fujitsu, g_strdup ("11f2"));
478 fujitsu = g_list_append (fujitsu, g_strdup ("11f3"));
479 fujitsu = g_list_append (fujitsu, g_strdup ("11f4"));
480 fujitsu = g_list_append (fujitsu, g_strdup ("11fc"));
481 g_hash_table_insert (scanners,
482 g_strdup("04c5"),
483 fujitsu);
484 GList* konica = NULL;
485 konica = g_list_append (konica, g_strdup ("0722"));
486 g_hash_table_insert (scanners,
487 g_strdup("04c8"),
488 konica);
489 GList* panasonic = NULL;
490 panasonic = g_list_append (panasonic, g_strdup ("1000"));
491 panasonic = g_list_append (panasonic, g_strdup ("1001"));
492 panasonic = g_list_append (panasonic, g_strdup ("1006"));
493 panasonic = g_list_append (panasonic, g_strdup ("1007"));
494 panasonic = g_list_append (panasonic, g_strdup ("1009"));
495 panasonic = g_list_append (panasonic, g_strdup ("100a"));
496 panasonic = g_list_append (panasonic, g_strdup ("100f"));
497 panasonic = g_list_append (panasonic, g_strdup ("1010"));
498 g_hash_table_insert (scanners,
499 g_strdup("04da"),
500 panasonic);
501
502 GList* samsung = NULL;
503
504 samsung = g_list_append (samsung, g_strdup ("341b"));
505 samsung = g_list_append (samsung, g_strdup ("341f"));
506 samsung = g_list_append (samsung, g_strdup ("3426"));
507 samsung = g_list_append (samsung, g_strdup ("342a"));
508 samsung = g_list_append (samsung, g_strdup ("342b"));
509 samsung = g_list_append (samsung, g_strdup ("342c"));
510 samsung = g_list_append (samsung, g_strdup ("3433"));
511 samsung = g_list_append (samsung, g_strdup ("3434"));
512 samsung = g_list_append (samsung, g_strdup ("343c"));
513 samsung = g_list_append (samsung, g_strdup ("3434"));
514 g_hash_table_insert (scanners,
515 g_strdup("04e8"),
516 samsung);
517
518 GList* pentax = NULL;
519 pentax = g_list_append (pentax, g_strdup ("2038"));
520 g_hash_table_insert (scanners,
521 g_strdup("04f9"),
522 pentax);
523
524 GList* apitek = NULL;
525 apitek = g_list_append (apitek, g_strdup ("0202"));
526 g_hash_table_insert (scanners,
527 g_strdup("0553"),
528 apitek);
529
530 GList* mustek = NULL;
531 mustek = g_list_append (mustek, g_strdup ("0001"));
532 mustek = g_list_append (mustek, g_strdup ("0002"));
533 mustek = g_list_append (mustek, g_strdup ("0006"));
534 mustek = g_list_append (mustek, g_strdup ("0008"));
535 mustek = g_list_append (mustek, g_strdup ("0010"));
536 mustek = g_list_append (mustek, g_strdup ("0210"));
537 mustek = g_list_append (mustek, g_strdup ("0218"));
538 mustek = g_list_append (mustek, g_strdup ("0219"));
539 mustek = g_list_append (mustek, g_strdup ("021a"));
540 mustek = g_list_append (mustek, g_strdup ("021b"));
541 mustek = g_list_append (mustek, g_strdup ("021c"));
542 mustek = g_list_append (mustek, g_strdup ("021d"));
543 mustek = g_list_append (mustek, g_strdup ("021e"));
544 mustek = g_list_append (mustek, g_strdup ("021f"));
545 mustek = g_list_append (mustek, g_strdup ("0409"));
546 g_hash_table_insert (scanners,
547 g_strdup("055f"),
548 mustek);
549 GList* artec = NULL;
550 artec = g_list_append (artec, g_strdup ("4002"));
551 artec = g_list_append (artec, g_strdup ("4003"));
552 artec = g_list_append (artec, g_strdup ("4004"));
553 artec = g_list_append (artec, g_strdup ("4005"));
554 artec = g_list_append (artec, g_strdup ("4006"));
555 artec = g_list_append (artec, g_strdup ("4007"));
556 artec = g_list_append (artec, g_strdup ("4009"));
557 artec = g_list_append (artec, g_strdup ("4010"));
558 artec = g_list_append (artec, g_strdup ("4011"));
559 g_hash_table_insert (scanners,
560 g_strdup("05d8"),
561 artec);
562
563 GList* microtek = NULL;
564 microtek = g_list_append (microtek, g_strdup ("0099"));
565 microtek = g_list_append (microtek, g_strdup ("009a"));
566 microtek = g_list_append (microtek, g_strdup ("00a3"));
567 microtek = g_list_append (microtek, g_strdup ("00b6"));
568 microtek = g_list_append (microtek, g_strdup ("30cf"));
569 microtek = g_list_append (microtek, g_strdup ("30d4"));
570 microtek = g_list_append (microtek, g_strdup ("40b3"));
571 microtek = g_list_append (microtek, g_strdup ("40b8"));
572 microtek = g_list_append (microtek, g_strdup ("40ca"));
573 microtek = g_list_append (microtek, g_strdup ("40cb"));
574 microtek = g_list_append (microtek, g_strdup ("40dd"));
575 microtek = g_list_append (microtek, g_strdup ("40ff"));
576 microtek = g_list_append (microtek, g_strdup ("80a3"));
577 g_hash_table_insert (scanners,
578 g_strdup("05da"),
579 microtek);
580
581 GList* avision = NULL;
582 avision = g_list_append (avision, g_strdup ("0268"));
583 avision = g_list_append (avision, g_strdup ("026a"));
584 avision = g_list_append (avision, g_strdup ("0a13"));
585 avision = g_list_append (avision, g_strdup ("0a15"));
586 avision = g_list_append (avision, g_strdup ("0a16"));
587 avision = g_list_append (avision, g_strdup ("0a18"));
588 avision = g_list_append (avision, g_strdup ("0a19"));
589 avision = g_list_append (avision, g_strdup ("0a23"));
590 avision = g_list_append (avision, g_strdup ("0a24"));
591 avision = g_list_append (avision, g_strdup ("0a25"));
592 avision = g_list_append (avision, g_strdup ("0a27"));
593 avision = g_list_append (avision, g_strdup ("0a2a"));
594 avision = g_list_append (avision, g_strdup ("0a2b"));
595 avision = g_list_append (avision, g_strdup ("0a2c"));
596 avision = g_list_append (avision, g_strdup ("0a2d"));
597 avision = g_list_append (avision, g_strdup ("0a2e"));
598 avision = g_list_append (avision, g_strdup ("0a2f"));
599 avision = g_list_append (avision, g_strdup ("0a33"));
600 avision = g_list_append (avision, g_strdup ("0a3a"));
601 avision = g_list_append (avision, g_strdup ("0a3c"));
602 avision = g_list_append (avision, g_strdup ("0a40"));
603 avision = g_list_append (avision, g_strdup ("0a41"));
604 avision = g_list_append (avision, g_strdup ("0a45"));
605 avision = g_list_append (avision, g_strdup ("0a4d"));
606 avision = g_list_append (avision, g_strdup ("0a4e"));
607 avision = g_list_append (avision, g_strdup ("0a4f"));
608 avision = g_list_append (avision, g_strdup ("0a5e"));
609 avision = g_list_append (avision, g_strdup ("0a61"));
610 avision = g_list_append (avision, g_strdup ("0a65"));
611 avision = g_list_append (avision, g_strdup ("0a66"));
612 avision = g_list_append (avision, g_strdup ("0a68"));
613 avision = g_list_append (avision, g_strdup ("0a82"));
614 avision = g_list_append (avision, g_strdup ("0a84"));
615 avision = g_list_append (avision, g_strdup ("0a93"));
616 avision = g_list_append (avision, g_strdup ("0a94"));
617 avision = g_list_append (avision, g_strdup ("0aa1"));
618 avision = g_list_append (avision, g_strdup ("1a35"));
619 g_hash_table_insert (scanners,
620 g_strdup("0638"),
621 avision);
622 GList* minolta = NULL;
623 minolta = g_list_append (minolta, g_strdup ("4004"));
624 minolta = g_list_append (minolta, g_strdup ("400d"));
625 minolta = g_list_append (minolta, g_strdup ("400e"));
626 g_hash_table_insert (scanners,
627 g_strdup("0686"),
628 minolta);
629
630 GList* agfa = NULL;
631 agfa = g_list_append (agfa, g_strdup ("0001"));
632 agfa = g_list_append (agfa, g_strdup ("0002"));
633 agfa = g_list_append (agfa, g_strdup ("0100"));
634 agfa = g_list_append (agfa, g_strdup ("2061"));
635 agfa = g_list_append (agfa, g_strdup ("208d"));
636 agfa = g_list_append (agfa, g_strdup ("208f"));
637 agfa = g_list_append (agfa, g_strdup ("2091"));
638 agfa = g_list_append (agfa, g_strdup ("2093"));
639 agfa = g_list_append (agfa, g_strdup ("2095"));
640 agfa = g_list_append (agfa, g_strdup ("2097"));
641 agfa = g_list_append (agfa, g_strdup ("20fd"));
642 agfa = g_list_append (agfa, g_strdup ("20ff"));
643 g_hash_table_insert (scanners,
644 g_strdup("06bd"),
645 minolta);
646
647 GList* umax_2 = NULL;
648 umax_2 = g_list_append (umax_2, g_strdup ("0020"));
649 g_hash_table_insert (scanners,
650 g_strdup("06dc"),
651 umax_2);
652
653 GList* plustek = NULL;
654
655 plustek = g_list_append (plustek, g_strdup ("0001"));
656 plustek = g_list_append (plustek, g_strdup ("0010"));
657 plustek = g_list_append (plustek, g_strdup ("0011"));
658 plustek = g_list_append (plustek, g_strdup ("0013"));
659 plustek = g_list_append (plustek, g_strdup ("0015"));
660 plustek = g_list_append (plustek, g_strdup ("0017"));
661 plustek = g_list_append (plustek, g_strdup ("0400"));
662 plustek = g_list_append (plustek, g_strdup ("0401"));
663 plustek = g_list_append (plustek, g_strdup ("0402"));
664 plustek = g_list_append (plustek, g_strdup ("0403"));
665 plustek = g_list_append (plustek, g_strdup ("040b"));
666 plustek = g_list_append (plustek, g_strdup ("040e"));
667 plustek = g_list_append (plustek, g_strdup ("0412"));
668 plustek = g_list_append (plustek, g_strdup ("0413"));
669 plustek = g_list_append (plustek, g_strdup ("0422"));
670 plustek = g_list_append (plustek, g_strdup ("0454"));
671 plustek = g_list_append (plustek, g_strdup ("045f"));
672 plustek = g_list_append (plustek, g_strdup ("0462"));
673 plustek = g_list_append (plustek, g_strdup ("0900"));
674 g_hash_table_insert (scanners,
675 g_strdup("07b3"),
676 plustek);
677
678 GList* corex = NULL;
679 corex = g_list_append (corex, g_strdup ("0002"));
680 corex = g_list_append (corex, g_strdup ("0005"));
681 g_hash_table_insert (scanners,
682 g_strdup("08f0"),
683 corex);
684
685 GList* xerox = NULL;
686 xerox = g_list_append (xerox, g_strdup ("3d5d"));
687 xerox = g_list_append (xerox, g_strdup ("3da4"));
688 xerox = g_list_append (xerox, g_strdup ("420c"));
689 xerox = g_list_append (xerox, g_strdup ("4265"));
690 xerox = g_list_append (xerox, g_strdup ("4293"));
691 xerox = g_list_append (xerox, g_strdup ("4294"));
692 g_hash_table_insert (scanners,
693 g_strdup("0924"),
694 xerox);
695
696 GList* pentax_2 = NULL;
697 pentax_2 = g_list_append (pentax_2, g_strdup ("3210"));
698 g_hash_table_insert (scanners,
699 g_strdup("0a17"),
700 pentax_2);
701
702 GList* portable = NULL;
703 portable = g_list_append (portable, g_strdup ("1000"));
704 g_hash_table_insert (scanners,
705 g_strdup("0a53"),
706 portable);
707
708 GList* syscan = NULL;
709 syscan = g_list_append (syscan, g_strdup ("4600"));
710 syscan = g_list_append (syscan, g_strdup ("4802"));
711 syscan = g_list_append (syscan, g_strdup ("4803"));
712 syscan = g_list_append (syscan, g_strdup ("480c"));
713 syscan = g_list_append (syscan, g_strdup ("4810"));
714 syscan = g_list_append (syscan, g_strdup ("6620"));
715 g_hash_table_insert (scanners,
716 g_strdup("0a82"),
717 syscan);
718
719 GList* canon_2 = NULL;
720 canon_2 = g_list_append (canon_2, g_strdup ("160c"));
721 canon_2 = g_list_append (canon_2, g_strdup ("160f"));
722 canon_2 = g_list_append (canon_2, g_strdup ("1614"));
723 canon_2 = g_list_append (canon_2, g_strdup ("1617"));
724 canon_2 = g_list_append (canon_2, g_strdup ("1618"));
725 canon_2 = g_list_append (canon_2, g_strdup ("161a"));
726 canon_2 = g_list_append (canon_2, g_strdup ("161b"));
727 canon_2 = g_list_append (canon_2, g_strdup ("161d"));
728 canon_2 = g_list_append (canon_2, g_strdup ("1620"));
729 canon_2 = g_list_append (canon_2, g_strdup ("1622"));
730 canon_2 = g_list_append (canon_2, g_strdup ("1623"));
731 canon_2 = g_list_append (canon_2, g_strdup ("1624"));
732 canon_2 = g_list_append (canon_2, g_strdup ("1626"));
733 canon_2 = g_list_append (canon_2, g_strdup ("162b"));
734 canon_2 = g_list_append (canon_2, g_strdup ("1638"));
735 canon_2 = g_list_append (canon_2, g_strdup ("1639"));
736 g_hash_table_insert (scanners,
737 g_strdup("1083"),
738 canon_2);
739
740 GList* digital = NULL;
741 digital = g_list_append (digital, g_strdup ("0001"));
742 g_hash_table_insert (scanners,
743 g_strdup("1183"),
744 digital);
745
746 GList* konica_2 = NULL;
747 konica_2 = g_list_append (konica_2, g_strdup ("2089"));
748 g_hash_table_insert (scanners,
749 g_strdup("132b"),
750 konica_2);
751
752 GList* umax = NULL;
753 umax = g_list_append (umax, g_strdup ("0010"));
754 umax = g_list_append (umax, g_strdup ("0030"));
755 umax = g_list_append (umax, g_strdup ("0050"));
756 umax = g_list_append (umax, g_strdup ("0060"));
757 umax = g_list_append (umax, g_strdup ("0070"));
758 umax = g_list_append (umax, g_strdup ("0130"));
759 umax = g_list_append (umax, g_strdup ("0160"));
760 umax = g_list_append (umax, g_strdup ("0230"));
761 g_hash_table_insert (scanners,
762 g_strdup("1606"),
763 umax);
764
765 GList* docketport = NULL;
766 docketport = g_list_append (docketport, g_strdup ("4810"));
767 g_hash_table_insert (scanners,
768 g_strdup("1dcc"),
769 docketport);
770
771 GList* dell = NULL;
772 dell = g_list_append (dell, g_strdup ("5105"));
773 dell = g_list_append (dell, g_strdup ("5124"));
774 dell = g_list_append (dell, g_strdup ("5250"));
775 g_hash_table_insert (scanners,
776 g_strdup("413c"),
777 dell);
778}
0779
=== modified file 'src/udev-mgr.c'
--- src/udev-mgr.c 2011-07-19 18:53:15 +0000
+++ src/udev-mgr.c 2011-08-09 11:36:39 +0000
@@ -17,22 +17,120 @@
17with this program. If not, see <http://www.gnu.org/licenses/>.17with this program. If not, see <http://www.gnu.org/licenses/>.
18*/18*/
1919
20#include <gudev/gudev.h>
21
22// TEMP
23#include <stdio.h>
24#include <string.h>
25#include <stdlib.h>
26#include <stdarg.h>
27
20#include "udev-mgr.h"28#include "udev-mgr.h"
29#include "sane-rules.h"
30
31static void udevice_mgr_device_list_iterator (gpointer data,
32 gpointer userdata);
33static void udev_mgr_uevent_cb (GUdevClient *client,
34 gchar *action,
35 GUdevDevice *device,
36 gpointer user_data);
37static void udev_mgr_update_menuitems (UdevMgr* self);
38static void udev_mgr_check_if_usb_device_is_supported (UdevMgr* self,
39 GUdevDevice *device,
40 UdevMgrDeviceAction action);
41static void udev_mgr_handle_webcam (UdevMgr* self,
42 GUdevDevice* device,
43 UdevMgrDeviceAction action);
44static void udev_mgr_handle_scsi_device (UdevMgr* self,
45 GUdevDevice* device,
46 UdevMgrDeviceAction action);
47
48static void udev_mgr_cleanup_lists(gpointer data, gpointer self);
49static void udev_mgr_cleanup_entries(gpointer data, gpointer self);
50
51
52static void debug_device (UdevMgr* self,
53 GUdevDevice* device,
54 UdevMgrDeviceAction action);
55
56
57struct _UdevMgr
58{
59 GObject parent_instance;
60 DbusmenuMenuitem* scanner_item;
61 DbusmenuMenuitem* webcam_item;
62 GUdevClient* client;
63 GHashTable* supported_usb_scanners;
64 GHashTable* supported_scsi_scanners;
65 GHashTable* scanners_present;
66 GHashTable* webcams_present;
67};
68
69const char *subsystems[3] = {"usb", "scsi", "video4linux"};
70const gchar* usb_subsystem = "usb";
71const gchar* scsi_subsystem = "scsi";
72const gchar* video4linux_subsystem = "video4linux";
2173
2274
23G_DEFINE_TYPE (UdevMgr, udev_mgr, G_TYPE_OBJECT);75G_DEFINE_TYPE (UdevMgr, udev_mgr, G_TYPE_OBJECT);
2476
25static void77static void
26udev_mgr_init (UdevMgr *object)78udev_mgr_init (UdevMgr* self)
27{79{
28 /* TODO: Add initialization code here */80 self->client = NULL;
81 self->supported_usb_scanners = NULL;
82 self->scanners_present = NULL;
83 self->webcams_present = NULL;
84 self->client = g_udev_client_new (subsystems);
85 self->supported_usb_scanners = g_hash_table_new_full (g_str_hash,
86 g_str_equal,
87 g_free,
88 (GDestroyNotify)udev_mgr_cleanup_lists);
89 self->supported_scsi_scanners = g_hash_table_new_full (g_str_hash,
90 g_str_equal,
91 g_free,
92 (GDestroyNotify)udev_mgr_cleanup_lists);
93 self->scanners_present = g_hash_table_new_full (g_str_hash,
94 g_str_equal,
95 g_free,
96 g_free);
97 self->webcams_present = g_hash_table_new_full (g_str_hash,
98 g_str_equal,
99 g_free,
100 g_free);
101
102 // load into memory all supported scanners ...
103 populate_usb_scanners (self->supported_usb_scanners);
104 populate_scsi_scanners (self->supported_scsi_scanners);
105 g_signal_connect (G_OBJECT (self->client),
106 "uevent",
107 G_CALLBACK (udev_mgr_uevent_cb),
108 self);
109}
110
111static void
112udev_mgr_cleanup_lists(gpointer data, gpointer self)
113{
114 GList* scanners = (GList*)data;
115 g_list_foreach (scanners, udev_mgr_cleanup_entries, NULL);
116 g_list_free(scanners);
117}
118
119static void
120udev_mgr_cleanup_entries(gpointer data, gpointer self)
121{
122 gchar* entry = (gchar*)data;
123 g_free(entry);
29}124}
30125
31static void126static void
32udev_mgr_finalize (GObject *object)127udev_mgr_finalize (GObject *object)
33{128{
34 /* TODO: Add deinitalization code here */129 UdevMgr* self = UDEV_MGR (object);
35130 g_hash_table_destroy (self->supported_scsi_scanners);
131 g_hash_table_destroy (self->supported_usb_scanners);
132 g_hash_table_destroy (self->scanners_present);
133 g_hash_table_destroy (self->webcams_present);
36 G_OBJECT_CLASS (udev_mgr_parent_class)->finalize (object);134 G_OBJECT_CLASS (udev_mgr_parent_class)->finalize (object);
37}135}
38136
@@ -40,7 +138,319 @@
40udev_mgr_class_init (UdevMgrClass *klass)138udev_mgr_class_init (UdevMgrClass *klass)
41{139{
42 GObjectClass* object_class = G_OBJECT_CLASS (klass);140 GObjectClass* object_class = G_OBJECT_CLASS (klass);
43
44 object_class->finalize = udev_mgr_finalize;141 object_class->finalize = udev_mgr_finalize;
45}142}
46143
144static void
145udevice_mgr_device_list_iterator (gpointer data, gpointer userdata)
146{
147 g_return_if_fail (G_UDEV_IS_DEVICE (data));
148 g_return_if_fail (UDEV_IS_MGR (userdata));
149
150 UdevMgr* self = UDEV_MGR (userdata);
151
152 GUdevDevice* device = G_UDEV_DEVICE (data);
153
154 const gchar* subsystem = NULL;
155 subsystem = g_udev_device_get_subsystem (device);
156
157 if (g_strcmp0 (subsystem, "usb") == 0){
158 udev_mgr_check_if_usb_device_is_supported (self, device, ADD);
159 }
160 else if (g_strcmp0 (subsystem, "video4linux") == 0){
161 udev_mgr_handle_webcam (self, device, ADD);
162 }
163 else if (g_strcmp0 (subsystem, "scsi") == 0){
164 udev_mgr_handle_scsi_device (self, device, ADD);
165 }
166
167 g_object_unref (device);
168}
169
170
171static void udev_mgr_update_menuitems (UdevMgr* self)
172{
173 dbusmenu_menuitem_property_set_bool (self->scanner_item,
174 DBUSMENU_MENUITEM_PROP_VISIBLE,
175 g_hash_table_size (self->scanners_present) > 0);
176
177 dbusmenu_menuitem_property_set_bool (self->webcam_item,
178 DBUSMENU_MENUITEM_PROP_VISIBLE,
179 g_hash_table_size (self->webcams_present) > 0);
180
181}
182
183static void udev_mgr_uevent_cb (GUdevClient *client,
184 gchar *action,
185 GUdevDevice *device,
186 gpointer user_data)
187{
188 g_return_if_fail (UDEV_IS_MGR (user_data));
189 UdevMgr* self = UDEV_MGR (user_data);
190 g_return_if_fail (device != NULL);
191
192 g_debug ("just received a UEVENT with an action : %s", action);
193
194 UdevMgrDeviceAction udev_mgr_action = ADD;
195
196 if (g_strcmp0 (action, "remove") == 0){
197 udev_mgr_action = REMOVE;
198 }
199
200 const gchar* subsystem = NULL;
201 subsystem = g_udev_device_get_subsystem (device);
202
203 if (g_strcmp0 (subsystem, "usb") == 0){
204 udev_mgr_check_if_usb_device_is_supported (self,
205 device,
206 udev_mgr_action);
207 }
208 else if (g_strcmp0 (subsystem, "video4linux") == 0){
209 udev_mgr_handle_webcam (self, device, udev_mgr_action);
210 }
211 else if (g_strcmp0 (subsystem, "scsi") == 0){
212 udev_mgr_handle_scsi_device (self, device, udev_mgr_action);
213 }
214}
215
216
217static void
218udev_mgr_handle_webcam (UdevMgr* self,
219 GUdevDevice* device,
220 UdevMgrDeviceAction action)
221{
222 if (FALSE)
223 debug_device (self, device, action);
224
225 const gchar* vendor;
226 const gchar* product;
227
228 vendor = g_udev_device_get_property (device, "ID_VENDOR_ID");
229 product = g_udev_device_get_property (device, "ID_MODEL_ID");
230
231 if (action == REMOVE){
232 if (g_hash_table_lookup (self->webcams_present, product) == NULL){
233 g_warning ("Got a remove event on a webcam device but we don't have that device in our webcam cache");
234 return;
235 }
236 g_hash_table_remove (self->webcams_present,
237 product);
238
239 }
240 else {
241 if (g_hash_table_lookup (self->webcams_present, product) != NULL){
242 g_warning ("Got an ADD event on a webcam device but we already have that device in our webcam cache");
243 return;
244 }
245 g_hash_table_insert (self->webcams_present,
246 g_strdup (product),
247 g_strdup (vendor));
248 }
249 udev_mgr_update_menuitems (self);
250}
251
252static void
253debug_device (UdevMgr* self,
254 GUdevDevice* device,
255 UdevMgrDeviceAction action)
256{
257 const gchar* vendor;
258 const gchar* product;
259 const gchar* number;
260 const gchar* name;
261
262 vendor = g_udev_device_get_property (device, "ID_VENDOR_ID");
263 product = g_udev_device_get_property (device, "ID_MODEL_ID");
264 number = g_udev_device_get_number (device);
265 name = g_udev_device_get_name (device);
266
267 g_debug ("device vendor id %s , product id of %s , number of %s and name of %s",
268 g_strdup(vendor),
269 g_strdup(product),
270 g_strdup(number),
271 g_strdup(name));
272
273 const gchar *const *list;
274 const gchar *const *iter;
275 char propstr[500];
276 guint32 namelen = 0, i;
277
278 list = g_udev_device_get_property_keys(device);
279
280 for (iter = list; iter && *iter; iter++) {
281 if (strlen(*iter) > namelen)
282 namelen = strlen(*iter);
283 }
284 namelen++;
285
286 for (iter = list; iter && *iter; iter++) {
287 strcpy(propstr, *iter);
288 strcat(propstr, ":");
289 for (i = 0; i < namelen - strlen(*iter); i++)
290 strcat(propstr, " ");
291 strcat(propstr, g_udev_device_get_property(device, *iter));
292 g_debug("%s", propstr);
293 }
294}
295
296static void udev_mgr_handle_scsi_device (UdevMgr* self,
297 GUdevDevice* device,
298 UdevMgrDeviceAction action)
299{
300 const gchar* type = NULL;
301 type = g_udev_device_get_property (device, "TYPE");
302 // apparently anything thats type 3 and SCSI is a Scanner
303 if (g_strcmp0 (type, "6") == 0){
304 gchar* random_scanner_name = g_strdup_printf("%p--scanner", self);
305 g_hash_table_insert (self->scanners_present,
306 random_scanner_name,
307 g_strdup("Scanner"));
308 udev_mgr_update_menuitems (self);
309 return;
310 }
311
312 // We only care about type 3 for the special cases below
313 if (g_strcmp0 (type, "3") != 0){
314 return;
315 }
316
317 const gchar* vendor = NULL;
318 vendor = g_udev_device_get_property (device, "VENDOR");
319
320 if (vendor == NULL)
321 return;
322
323 GList* vendor_list = NULL;
324 vendor_list = g_hash_table_lookup (self->supported_scsi_scanners,
325 (gpointer)vendor);
326 if (vendor_list == NULL)
327 return;
328
329 const gchar* model_id = NULL;
330 model_id = g_udev_device_get_property (device, "MODEL");
331
332 if (model_id == NULL)
333 return;
334
335 GList* model_entry = NULL;
336 model_entry = g_list_find_custom (vendor_list,
337 model_id,
338 (GCompareFunc)g_strcmp0);
339
340 if (model_entry != NULL){
341 if (action == REMOVE){
342 if (g_hash_table_lookup (self->scanners_present, g_strdup(vendor)) == NULL){
343 g_warning ("Got an REMOVE event on a scanner device but we dont have that device in our scanners cache");
344 }
345 else{
346 g_hash_table_remove (self->scanners_present, vendor);
347 }
348 }
349 else{
350 if (g_hash_table_lookup (self->scanners_present, g_strdup(vendor)) != NULL){
351 g_warning ("Got an ADD event on a scanner device but we already have that device in our scanners cache");
352 }
353 else{
354 g_hash_table_insert (self->scanners_present,
355 g_strdup(vendor),
356 g_strdup(model_id));
357 }
358 }
359 udev_mgr_update_menuitems (self);
360 }
361}
362
363static void
364udev_mgr_check_if_usb_device_is_supported (UdevMgr* self,
365 GUdevDevice *device,
366 UdevMgrDeviceAction action)
367{
368 const gchar* vendor = NULL;
369 debug_device (self, device, action);
370
371 vendor = g_udev_device_get_property (device, "ID_VENDOR_ID");
372
373 if (vendor == NULL)
374 return;
375
376 //g_debug ("vendor = %s", vendor);
377
378 GList* vendor_list = NULL;
379 vendor_list = g_hash_table_lookup (self->supported_usb_scanners,
380 (gpointer)vendor);
381 if (vendor_list == NULL)
382 return;
383
384 const gchar* model_id = NULL;
385 model_id = g_udev_device_get_property (device, "ID_MODEL_ID");
386
387 if (model_id == NULL)
388 return;
389
390 GList* model_entry = NULL;
391 model_entry = g_list_find_custom(vendor_list, model_id, (GCompareFunc)g_strcmp0);
392
393 if (model_entry != NULL){
394 if (action == REMOVE){
395 if (g_hash_table_lookup (self->scanners_present, g_strdup(vendor)) == NULL){
396 g_warning ("Got an REMOVE event on a scanner device but we dont have that device in our scanners cache");
397 }
398 else{
399 g_hash_table_remove (self->scanners_present, vendor);
400 }
401 }
402 else{
403 if (g_hash_table_lookup (self->scanners_present, g_strdup(vendor)) != NULL){
404 g_warning ("Got an ADD event on a scanner device but we already have that device in our scanners cache");
405 }
406 else{
407 g_hash_table_insert (self->scanners_present,
408 g_strdup(vendor),
409 g_strdup(model_id));
410 }
411 }
412 udev_mgr_update_menuitems (self);
413 }
414}
415
416UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner,
417 DbusmenuMenuitem* webcam)
418{
419 UdevMgr* mgr = g_object_new (UDEV_TYPE_MGR, NULL);
420 mgr->scanner_item = scanner;
421 mgr->webcam_item = webcam;
422
423 // Check for USB devices
424 GList* usb_devices_available = NULL;
425 usb_devices_available = g_udev_client_query_by_subsystem (mgr->client,
426 usb_subsystem);
427 if (usb_devices_available != NULL){
428 g_list_foreach (usb_devices_available,
429 udevice_mgr_device_list_iterator,
430 mgr);
431
432 g_list_free (usb_devices_available);
433 }
434 // Check for webcams
435 GList* video_devices_available = NULL;
436 video_devices_available = g_udev_client_query_by_subsystem (mgr->client,
437 video4linux_subsystem);
438 if (video_devices_available != NULL){
439 g_list_foreach (video_devices_available,
440 udevice_mgr_device_list_iterator,
441 mgr);
442
443 g_list_free (video_devices_available);
444 }
445 // Check for SCSI devices
446 GList* scsi_devices_available = NULL;
447 scsi_devices_available = g_udev_client_query_by_subsystem (mgr->client,
448 scsi_subsystem);
449 if (scsi_devices_available != NULL){
450 g_list_foreach (scsi_devices_available,
451 udevice_mgr_device_list_iterator,
452 mgr);
453 g_list_free (scsi_devices_available);
454 }
455 return mgr;
456}
47457
=== modified file 'src/udev-mgr.h'
--- src/udev-mgr.h 2011-07-19 12:18:54 +0000
+++ src/udev-mgr.h 2011-08-09 11:36:39 +0000
@@ -21,6 +21,14 @@
21#define _UDEV_MGR_H_21#define _UDEV_MGR_H_
2222
23#include <glib-object.h>23#include <glib-object.h>
24#include <libdbusmenu-glib/client.h>
25
26#include <gtk/gtk.h>
27#if GTK_CHECK_VERSION(3, 0, 0)
28#include <libdbusmenu-gtk3/menuitem.h>
29#else
30#include <libdbusmenu-gtk/menuitem.h>
31#endif
2432
25G_BEGIN_DECLS33G_BEGIN_DECLS
2634
@@ -39,12 +47,15 @@
39 GObjectClass parent_class;47 GObjectClass parent_class;
40};48};
4149
42struct _UdevMgr
43{
44 GObject parent_instance;
45};
4650
47GType udev_mgr_get_type (void) G_GNUC_CONST;51GType udev_mgr_get_type (void) G_GNUC_CONST;
52UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner_item,
53 DbusmenuMenuitem* webcam_item);
54
55typedef enum {
56 ADD,
57 REMOVE
58}UdevMgrDeviceAction;
4859
49G_END_DECLS60G_END_DECLS
5061
5162
=== modified file 'src/user-menu-mgr.c'
--- src/user-menu-mgr.c 2011-07-18 11:19:38 +0000
+++ src/user-menu-mgr.c 2011-08-09 11:36:39 +0000
@@ -149,10 +149,9 @@
149149
150 for (u = users; u != NULL; u = g_list_next (u)) {150 for (u = users; u != NULL; u = g_list_next (u)) {
151 user = u->data;151 user = u->data;
152 g_debug ("%p: %s", user, user->real_name);
152 user->service = self->users_dbus_interface;153 user->service = self->users_dbus_interface;
153154
154 g_debug ("%i %s", (gint)user->uid, user->user_name);
155
156 if (g_strcmp0(user->user_name, "guest") == 0) {155 if (g_strcmp0(user->user_name, "guest") == 0) {
157 /* Check to see if the guest has sessions and so therefore should156 /* Check to see if the guest has sessions and so therefore should
158 get a check mark. */157 get a check mark. */
@@ -171,13 +170,26 @@
171170
172 if (self->user_count > MINIMUM_USERS && self->user_count < MAXIMUM_USERS) {171 if (self->user_count > MINIMUM_USERS && self->user_count < MAXIMUM_USERS) {
173 mi = dbusmenu_menuitem_new ();172 mi = dbusmenu_menuitem_new ();
174 dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_TYPE, USER_ITEM_TYPE);173 dbusmenu_menuitem_property_set (mi,
174 DBUSMENU_MENUITEM_PROP_TYPE,
175 USER_ITEM_TYPE);
175 if (user->real_name_conflict) {176 if (user->real_name_conflict) {
176 gchar * conflictedname = g_strdup_printf("%s (%s)", user->real_name, user->user_name);177 gchar * conflictedname = g_strdup_printf("%s (%s)", user->real_name, user->user_name);
177 dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, conflictedname);178 dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, conflictedname);
178 g_free(conflictedname);179 g_free(conflictedname);
179 } else {180 } else {
180 dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, user->real_name);181 //g_debug ("%i %s", (gint)user->uid, user->real_name);
182 //g_debug ("users uid = %i", (gint)user->uid);
183 //g_debug ("users real name = %s", user->real_name);
184 if (user == NULL){
185 g_debug ("USER pointer is NULL");
186 return;
187 }
188 g_debug ("%p: %s", user, user->real_name);
189
190 dbusmenu_menuitem_property_set (mi,
191 USER_ITEM_PROP_NAME,
192 user->real_name);
181 }193 }
182 dbusmenu_menuitem_property_set_bool (mi,194 dbusmenu_menuitem_property_set_bool (mi,
183 USER_ITEM_PROP_LOGGED_IN,195 USER_ITEM_PROP_LOGGED_IN,

Subscribers

People subscribed via source and target branches