[widgets] allow NULL for 'command' (FS#175)

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
marco candrian 2008-04-23 05:35:55 +02:00 committed by Julien Danjou
parent 62e3eb758b
commit ce17b1457e
4 changed files with 9 additions and 3 deletions

View File

@ -222,7 +222,7 @@ uicb_widget_tell(int screen, char *arg)
p_delete(&command); p_delete(&command);
} }
else else
status = WIDGET_ERROR_NOVALUE; status = widget->tell(widget, property, NULL);
switch(status) switch(status)
{ {

View File

@ -285,6 +285,9 @@ graph_tell(Widget *widget, char *property, char *command)
if(!d->data_items) if(!d->data_items)
return WIDGET_ERROR_CUSTOM; /* error already printed on _new */ return WIDGET_ERROR_CUSTOM; /* error already printed on _new */
if(command == NULL)
return WIDGET_ERROR_NOVALUE;
if(!a_strcmp(property, "data")) if(!a_strcmp(property, "data"))
{ {
title = strtok(command, " "); title = strtok(command, " ");

View File

@ -70,8 +70,8 @@ iconbox_tell(Widget *widget, char *property, char *command)
Bool b; Bool b;
Data *d = widget->data; Data *d = widget->data;
if(!property || !command) if(command == NULL)
return WIDGET_ERROR; return WIDGET_ERROR_NOVALUE;
if(!a_strcmp(property, "image")) if(!a_strcmp(property, "image"))
{ {

View File

@ -393,6 +393,9 @@ progressbar_tell(Widget *widget, char *property, char *command)
if(!d->data_items) if(!d->data_items)
return WIDGET_ERROR_CUSTOM; /* error already printed on _new */ return WIDGET_ERROR_CUSTOM; /* error already printed on _new */
if(command == NULL)
return WIDGET_ERROR_NOVALUE;
if(!a_strcmp(property, "data")) if(!a_strcmp(property, "data"))
{ {
title = strtok(command, " "); title = strtok(command, " ");