Skip to content

Commit

Permalink
Use prop_create_check()
Browse files Browse the repository at this point in the history
  • Loading branch information
andoma committed Jul 14, 2011
1 parent 8b57973 commit 9a50c86
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/navigator.c
Expand Up @@ -455,10 +455,15 @@ nav_open_errorf(prop_t *root, const char *fmt, ...)
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);

prop_t *src = prop_create(root, "model");
prop_set_string(prop_create(src, "type"), "openerror");
prop_set_int(prop_create(src, "loading"), 0);
prop_set_string(prop_create(src, "error"), buf);
prop_set_int(prop_create(root, "directClose"), 1);
prop_t *model = prop_create_check(root, "model");

if(model != NULL) {
prop_set_string(prop_create(model, "type"), "openerror");
prop_set_int(prop_create(model, "loading"), 0);
prop_set_string(prop_create(model, "error"), buf);
prop_set_int(prop_create(model, "directClose"), 1);
}

prop_ref_dec(model);
return 0;
}

0 comments on commit 9a50c86

Please sign in to comment.