summaryrefslogtreecommitdiff
path: root/src/audacious/history.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/audacious/history.c')
-rw-r--r--src/audacious/history.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/audacious/history.c b/src/audacious/history.c
index b09903f..4dde368 100644
--- a/src/audacious/history.c
+++ b/src/audacious/history.c
@@ -36,8 +36,6 @@ static void history_save (void)
if (! modified)
return;
- config_clear_section ("history");
-
GList * node = history.head;
for (int i = 0; i < MAX_ENTRIES; i ++)
{
@@ -46,7 +44,7 @@ static void history_save (void)
char name[32];
snprintf (name, sizeof name, "entry%d", i);
- set_string ("history", name, node->data);
+ set_str ("history", name, node->data);
node = node->next;
}
@@ -63,11 +61,11 @@ static void history_load (void)
{
char name[32];
snprintf (name, sizeof name, "entry%d", i);
- char * path = get_string ("history", name);
+ char * path = get_str ("history", name);
if (! path[0])
{
- g_free (path);
+ str_unref (path);
break;
}
@@ -85,7 +83,7 @@ void history_cleanup (void)
hook_dissociate ("config save", (HookFunction) history_save);
- g_queue_foreach (& history, (GFunc) g_free, NULL);
+ g_queue_foreach (& history, (GFunc) str_unref, NULL);
g_queue_clear (& history);
loaded = FALSE;
@@ -108,11 +106,11 @@ void history_add (const char * path)
next = node->next;
if (! strcmp (node->data, path))
{
- g_free (node->data);
+ str_unref (node->data);
g_queue_delete_link (& history, node);
}
}
- g_queue_push_head (& history, g_strdup (path));
+ g_queue_push_head (& history, str_get (path));
modified = TRUE;
}