Commit 11fbe0fe authored by Paolo Borelli's avatar Paolo Borelli

Be more robust when closing the dialog

Gtk started to emit cursor-changed when the treeview is destroyed. I am
not sure if it is a Gtk bug or if it is intentional, but we should check
for errors returned by the getter function.
parent 93c1166c
......@@ -486,21 +486,25 @@ style_scheme_changed (GtkWidget *treeview,
GeditPreferencesDialog *dlg)
{
GtkTreePath *path;
GtkTreeIter iter;
gchar *id;
gtk_tree_view_get_cursor (GTK_TREE_VIEW (dlg->priv->schemes_treeview), &path, NULL);
gtk_tree_model_get_iter (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model),
&iter, path);
gtk_tree_path_free (path);
gtk_tree_model_get (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model),
&iter, ID_COLUMN, &id, -1);
if (path != NULL)
{
GtkTreeIter iter;
gchar *id;
g_settings_set_string (dlg->priv->editor, GEDIT_SETTINGS_SCHEME, id);
gtk_tree_model_get_iter (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model),
&iter, path);
gtk_tree_path_free (path);
gtk_tree_model_get (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model),
&iter, ID_COLUMN, &id, -1);
set_buttons_sensisitivity_according_to_scheme (dlg, id);
g_settings_set_string (dlg->priv->editor, GEDIT_SETTINGS_SCHEME, id);
g_free (id);
set_buttons_sensisitivity_according_to_scheme (dlg, id);
g_free (id);
}
}
static const gchar *
......
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