Merge pull request #82 from JosephMcc/prefs-fix1
prefs-dialog: Fix a crash when removing style schemes
This commit is contained in:
commit
5498344d82
|
@ -62,7 +62,6 @@
|
||||||
|
|
||||||
static GtkWidget *preferences_dialog = NULL;
|
static GtkWidget *preferences_dialog = NULL;
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ID_COLUMN = 0,
|
ID_COLUMN = 0,
|
||||||
|
@ -467,10 +466,14 @@ style_scheme_changed (GtkWidget *treeview,
|
||||||
XedPreferencesDialog *dlg)
|
XedPreferencesDialog *dlg)
|
||||||
{
|
{
|
||||||
GtkTreePath *path;
|
GtkTreePath *path;
|
||||||
|
|
||||||
|
gtk_tree_view_get_cursor (GTK_TREE_VIEW (dlg->priv->schemes_treeview), &path, NULL);
|
||||||
|
|
||||||
|
if (path != NULL)
|
||||||
|
{
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
gchar *id;
|
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_model_get_iter (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model), &iter, path);
|
||||||
gtk_tree_path_free (path);
|
gtk_tree_path_free (path);
|
||||||
gtk_tree_model_get (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model), &iter, ID_COLUMN, &id, -1);
|
gtk_tree_model_get (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model), &iter, ID_COLUMN, &id, -1);
|
||||||
|
@ -481,6 +484,7 @@ style_scheme_changed (GtkWidget *treeview,
|
||||||
|
|
||||||
g_free (id);
|
g_free (id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static const gchar *
|
static const gchar *
|
||||||
ensure_color_scheme_id (XedPreferencesDialog *dlg,
|
ensure_color_scheme_id (XedPreferencesDialog *dlg,
|
||||||
|
|
Loading…
Reference in New Issue