cbs: Set topics on EFcbmid change only if powered

This commit is contained in:
Denis Kenzior 2011-02-17 14:49:03 -06:00
parent 9e640a246a
commit 7f43fc0f69
1 changed files with 6 additions and 5 deletions

View File

@ -853,7 +853,6 @@ static void sim_cbmid_read_cb(int ok, int length, int record,
int i;
char *str;
GSList *contents = NULL;
char *topic_str;
if (!ok)
goto done;
@ -889,10 +888,12 @@ static void sim_cbmid_read_cb(int ok, int length, int record,
done:
if (cbs->efcbmid_update) {
topic_str = cbs_topics_to_str(cbs, cbs->topics);
cbs->driver->set_topics(cbs, topic_str,
cbs_set_powered_cb, cbs);
g_free(topic_str);
if (cbs->powered == TRUE) {
char *topic_str = cbs_topics_to_str(cbs, cbs->topics);
cbs->driver->set_topics(cbs, topic_str,
cbs_set_powered_cb, cbs);
g_free(topic_str);
}
cbs->efcbmid_update = FALSE;
} else