Fix segfaults when using 'Send Selection to Terminal' and the VTE

is not loaded, and when using Ctrl-A after enabling the 'Load VTE'
pref (patch by Dimitar Zhekov, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5470 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2010-12-07 13:02:46 +00:00
parent 6d464cbeb0
commit d65d3adcc4
5 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2010-12-07 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/keybindings.c, src/callbacks.c, src/vte.h, src/main.c:
Fix segfaults when using 'Send Selection to Terminal' and the VTE
is not loaded, and when using Ctrl-A after enabling the 'Load VTE'
pref (patch by Dimitar Zhekov, thanks).
2010-12-06 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/document.c:

View File

@ -2168,7 +2168,7 @@ on_send_selection_to_vte1_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
#ifdef HAVE_VTE
if (vte_info.load_vte)
if (vte_info.have_vte)
vte_send_selection_to_vte();
#endif
}

View File

@ -2445,7 +2445,7 @@ static gboolean cb_func_select_action(guint key_id)
}
/* special case for Select All in the VTE widget */
#ifdef HAVE_VTE
else if (key_id == GEANY_KEYS_SELECT_ALL && vte_info.load_vte && focusw == vc->vte)
else if (key_id == GEANY_KEYS_SELECT_ALL && vte_info.have_vte && focusw == vc->vte)
{
vte_select_all();
return TRUE;

View File

@ -213,7 +213,7 @@ static void apply_settings(void)
gtk_notebook_set_show_tabs(GTK_NOTEBOOK(main_widgets.notebook), interface_prefs.show_notebook_tabs);
#ifdef HAVE_VTE
if (! vte_info.load_vte)
if (! vte_info.have_vte)
gtk_widget_hide(ui_lookup_widget(main_widgets.window, "send_selection_to_vte1"));
#else
gtk_widget_hide(ui_lookup_widget(main_widgets.window, "send_selection_to_vte1"));

View File

@ -30,8 +30,8 @@
typedef struct
{
gboolean load_vte;
gboolean have_vte;
gboolean load_vte; /* this is the preference, NOT the current instance VTE state */
gboolean have_vte; /* use this field to check if the current instance has VTE */
gchar *lib_vte;
gchar *dir;
} VteInfo;