C: Views: fixed a bug when trying to add a comment after changing the
file name of a finished view
This commit is contained in:
@ -1068,6 +1068,16 @@ static int finish_view(Obiview_p view)
|
|||||||
if (save_view(view) < 0)
|
if (save_view(view) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
// Add the time in the view comments
|
||||||
|
time_t t;
|
||||||
|
t = time(&t);
|
||||||
|
if (obi_view_add_comment(view, "Date created", strtok(ctime(&t), "\n")) < 0)
|
||||||
|
{
|
||||||
|
obi_set_errno(OBIVIEW_ERROR);
|
||||||
|
obidebug(1, "\nError adding the date of creation when finishing a view");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (rename_finished_view(view) < 0)
|
if (rename_finished_view(view) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1093,16 +1103,6 @@ static int finish_view(Obiview_p view)
|
|||||||
(column->header)->finished = true;
|
(column->header)->finished = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the time in the view comments
|
|
||||||
time_t t;
|
|
||||||
t = time(&t);
|
|
||||||
if (obi_view_add_comment(view, "Date created", strtok(ctime(&t), "\n")) < 0)
|
|
||||||
{
|
|
||||||
obi_set_errno(OBIVIEW_ERROR);
|
|
||||||
obidebug(1, "\nError adding the date of creation when finishing a view");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Flag the view as finished
|
// Flag the view as finished
|
||||||
(view->infos)->finished = true;
|
(view->infos)->finished = true;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user