|
@@ -321,12 +321,13 @@ static int process_view(clish_shell_t *shell, clish_xmlnode_t *element,
|
|
|
void *parent)
|
|
|
{
|
|
|
clish_view_t *view;
|
|
|
+ clish_view_restore_e restore;
|
|
|
int res = -1;
|
|
|
|
|
|
char *name = clish_xmlnode_fetch_attr(element, "name");
|
|
|
char *prompt = clish_xmlnode_fetch_attr(element, "prompt");
|
|
|
char *depth = clish_xmlnode_fetch_attr(element, "depth");
|
|
|
- char *restore = clish_xmlnode_fetch_attr(element, "restore");
|
|
|
+ char *restore_name = clish_xmlnode_fetch_attr(element, "restore");
|
|
|
char *access = clish_xmlnode_fetch_attr(element, "access");
|
|
|
|
|
|
/* Check syntax */
|
|
@@ -347,13 +348,9 @@ static int process_view(clish_shell_t *shell, clish_xmlnode_t *element,
|
|
|
clish_view__set_depth(view, res);
|
|
|
}
|
|
|
|
|
|
- if (restore) {
|
|
|
- if (!lub_string_nocasecmp(restore, "depth"))
|
|
|
- clish_view__set_restore(view, CLISH_RESTORE_DEPTH);
|
|
|
- else if (!lub_string_nocasecmp(restore, "view"))
|
|
|
- clish_view__set_restore(view, CLISH_RESTORE_VIEW);
|
|
|
- else
|
|
|
- clish_view__set_restore(view, CLISH_RESTORE_NONE);
|
|
|
+ if (restore_name) {
|
|
|
+ restore = clish_view_restore_resolve(restore_name);
|
|
|
+ clish_view__set_restore(view, restore);
|
|
|
}
|
|
|
|
|
|
if (access)
|
|
@@ -365,7 +362,7 @@ error:
|
|
|
clish_xml_release(name);
|
|
|
clish_xml_release(prompt);
|
|
|
clish_xml_release(depth);
|
|
|
- clish_xml_release(restore);
|
|
|
+ clish_xml_release(restore_name);
|
|
|
clish_xml_release(access);
|
|
|
|
|
|
parent = parent; /* Happy compiler */
|