~ubuntu-branches/ubuntu/lucid/hal/lucid-proposed

« back to all changes in this revision

Viewing changes to hald/linux/probing/probe-printer.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-12-03 01:21:24 UTC
  • mto: (1.1.18 squeeze)
  • mto: This revision was merged to the branch mainline in revision 165.
  • Revision ID: james.westby@ubuntu.com-20091203012124-3573qknop973uvc2
Tags: upstream-0.5.14
ImportĀ upstreamĀ versionĀ 0.5.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
                        cmd = *iter + 4;
133
133
        }
134
134
 
135
 
        dbus_error_init (&error);
136
 
 
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);
140
139
        }               
141
140
 
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);
145
146
        }
146
147
 
147
 
        if (serial != NULL)
 
148
        if (serial != NULL) {
 
149
                LIBHAL_FREE_DBUS_ERROR (&error);
148
150
                libhal_device_set_property_string (ctx, udi, "printer.serial", serial, &error);
 
151
        }
149
152
 
150
153
        if (desc != NULL) {
 
154
                LIBHAL_FREE_DBUS_ERROR (&error);
151
155
                libhal_device_set_property_string (ctx, udi, "printer.description", desc, &error);
152
156
        }
153
157
 
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);
 
163
                }
158
164
                g_strfreev (cmdset);
159
165
        }
160
166
 
166
172
        if (fd >= 0)
167
173
                close (fd);
168
174
 
 
175
        LIBHAL_FREE_DBUS_ERROR (&error);
 
176
 
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);
173
181
        }
174
182