* hotlist.c: Add comments to avoid confusion between

done_hotlist() and hotlist_done().
(hotlist_done): Set l_hotlist to NULL.
(add2hotlist): Load hotlist if it's neither loaded nor loading.
This fixes Ctrl-x h. Fix compiler warning.
This commit is contained in:
Pavel Roskin 2001-07-09 06:43:45 +00:00
parent 48b3cb4154
commit 62ef1f47bd
2 changed files with 23 additions and 1 deletions

View File

@ -1,5 +1,11 @@
2001-07-09 Pavel Roskin <proski@gnu.org> 2001-07-09 Pavel Roskin <proski@gnu.org>
* hotlist.c: Add comments to avoid confusion between
done_hotlist() and hotlist_done().
(hotlist_done): Set l_hotlist to NULL.
(add2hotlist): Load hotlist if it's neither loaded nor loading.
This fixes Ctrl-x h. Fix compiler warning.
* hotlist.c: Make more variables and functions static. * hotlist.c: Make more variables and functions static.
2001-07-08 Pavel Roskin <proski@gnu.org> 2001-07-08 Pavel Roskin <proski@gnu.org>

View File

@ -664,9 +664,14 @@ static void init_movelist (int list_type, struct hotlist *item)
/* add listbox to the dialogs */ /* add listbox to the dialogs */
} }
/*
* Destroy the list dialog.
* Don't confuse with done_hotlist() for the list in memory.
*/
static void hotlist_done (void) static void hotlist_done (void)
{ {
destroy_dlg (hotlist_dlg); destroy_dlg (hotlist_dlg);
l_hotlist = NULL;
if (0) if (0)
update_panels (UP_OPTIMIZE, UP_KEEPSEL); update_panels (UP_OPTIMIZE, UP_KEEPSEL);
repaint_screen (); repaint_screen ();
@ -687,8 +692,15 @@ find_group_section (struct hotlist *grp)
static struct hotlist * static struct hotlist *
add2hotlist (char *label, char *directory, enum HotListType type, int pos) add2hotlist (char *label, char *directory, enum HotListType type, int pos)
{ {
struct hotlist *current;
struct hotlist *new; struct hotlist *new;
struct hotlist *current = NULL;
/*
* Hotlist is neither loaded nor loading.
* Must be called by "Ctrl-x a" before using hotlist.
*/
if (!current_group)
load_hotlist ();
if (l_hotlist && l_hotlist->current) if (l_hotlist && l_hotlist->current)
current = l_hotlist->current->data; current = l_hotlist->current->data;
@ -1569,6 +1581,10 @@ int save_hotlist (void)
return saved; return saved;
} }
/*
* Unload list from memory.
* Don't confuse with hotlist_done() for GUI.
*/
void done_hotlist (void) void done_hotlist (void)
{ {
if (hotlist){ if (hotlist){