Kaydet (Commit) 3e54b879 authored tarafından Enrico Tröger's avatar Enrico Tröger

Fixed weird behaviour of the recent files list.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@500 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 0be04e9c
2006-06-28 Enrico Tröger <enrico.troeger@uvena.de>
* src/utils.c, src/keyfile.c: Fixed weird behaviour of the recent
files list.
2006-06-27 Enrico Troeger <enrico.troeger@uvena.de>
* data/filetypes.php, data/filetypes.pascal, src/callbacks.c,
......
......@@ -55,8 +55,7 @@ void configuration_save(void)
if (!config_exists)
{
gchar *start_comm = g_malloc(100);
g_snprintf(start_comm, 100, _("%s configuration file, edit as you need"), PACKAGE);
gchar *start_comm = g_strdup_printf(_("%s configuration file, edit as you need"), PACKAGE);
g_key_file_set_comment(config, NULL, NULL, start_comm, NULL);
g_free(start_comm);
}
......@@ -140,11 +139,14 @@ void configuration_save(void)
{
if (! g_queue_is_empty(app->recent_queue))
{
recent_files[i] = g_queue_pop_head(app->recent_queue);
// copy the values, this is necessary when this function is called from the
// preferences dialog or when quitting is canceled to keep the queue intact
recent_files[i] = g_strdup(g_queue_peek_nth(app->recent_queue, i));
}
else
{
recent_files[i] = NULL;
break;
}
}
// There is a bug in GTK2.6 g_key_file_set_string_list, we must NULL terminate.
......
......@@ -131,7 +131,6 @@ void utils_update_statusbar(gint idx, gint pos)
line = sci_get_line_from_position(doc_list[idx].sci, pos);
col = sci_get_col_from_position(doc_list[idx].sci, pos);
// currently text need in German and C locale about 150 chars
text = g_strdup_printf(_("%c line: % 4d column: % 3d selection: % 4d %s mode: %s%s cur. function: %s encoding: %s filetype: %s"),
(doc_list[idx].changed) ? 42 : 32,
(line + 1), (col + 1),
......@@ -1929,7 +1928,7 @@ void utils_update_recent_menu(void)
if (g_list_length(children) > app->mru_length)
{
children = g_list_nth(children, app->mru_length - 1);
while (children)
while (children != NULL)
{
if (GTK_IS_WIDGET(children->data)) gtk_widget_destroy(GTK_WIDGET(children->data));
children = g_list_next(children);
......@@ -1939,7 +1938,8 @@ void utils_update_recent_menu(void)
filename = g_queue_peek_head(app->recent_queue);
tmp = gtk_menu_item_new_with_label(filename);
gtk_widget_show(tmp);
gtk_menu_shell_insert(GTK_MENU_SHELL(recent_menu), tmp, 0);
//gtk_menu_shell_insert(GTK_MENU_SHELL(recent_menu), tmp, 0);
gtk_container_add(GTK_CONTAINER(recent_menu), tmp);
g_signal_connect((gpointer) tmp, "activate",
G_CALLBACK(on_recent_file_activate), (gpointer) filename);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment