135
dbus_error_init (&error);
137
135
if (mfg != NULL) {
138
136
libhal_device_set_property_string (ctx, udi, "info.vendor", mfg, &error);
137
LIBHAL_FREE_DBUS_ERROR (&error);
139
138
libhal_device_set_property_string (ctx, udi, "printer.vendor", mfg, &error);
142
141
if (model != NULL) {
142
LIBHAL_FREE_DBUS_ERROR (&error);
143
143
libhal_device_set_property_string (ctx, udi, "info.product", model, &error);
144
LIBHAL_FREE_DBUS_ERROR (&error);
144
145
libhal_device_set_property_string (ctx, udi, "printer.product", model, &error);
148
if (serial != NULL) {
149
LIBHAL_FREE_DBUS_ERROR (&error);
148
150
libhal_device_set_property_string (ctx, udi, "printer.serial", serial, &error);
150
153
if (desc != NULL) {
154
LIBHAL_FREE_DBUS_ERROR (&error);
151
155
libhal_device_set_property_string (ctx, udi, "printer.description", desc, &error);
154
158
if (cmd != NULL) {
155
159
char **cmdset = g_strsplit (cmd, ",", 0);
156
for (iter = cmdset; *iter != NULL; iter++)
160
for (iter = cmdset; *iter != NULL; iter++) {
161
LIBHAL_FREE_DBUS_ERROR (&error);
157
162
libhal_device_property_strlist_append (ctx, udi, "printer.commandset", *iter, &error);
158
164
g_strfreev (cmdset);
175
LIBHAL_FREE_DBUS_ERROR (&error);
169
177
if (ctx != NULL) {
170
dbus_error_init (&error);
171
178
libhal_ctx_shutdown (ctx, &error);
179
LIBHAL_FREE_DBUS_ERROR (&error);
172
180
libhal_ctx_free (ctx);