+ const char *idaver;
+ const char *root;
+ int rc;
+
+ /* scan the request */
+ switch (json_object_get_type(req)) {
+ case json_type_string:
+ idaver = json_object_get_string(req);
+ root = rootdir;
+ break;
+ case json_type_object:
+ idaver = j_string_at(req, "id", NULL);
+ if (idaver != NULL) {
+ root = j_string_at(req, "root", rootdir);
+ break;
+ }
+ default:
+ jbus_reply_error_s(smsg, error_bad_request);
+ return;
+ }
+
+ /* install the widget */
+ rc = uninstall_widget(idaver, root);
+ if (rc)
+ jbus_reply_error_s(smsg, "\"uninstallation had error\"");
+ else {
+ jbus_send_signal_s(jbus, "changed", "true");
+ jbus_reply_s(smsg, "true");
+ }