[devhelp/wip/swilmet/various-code-improvements: 3/3] book-tree: add some internal checks
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp/wip/swilmet/various-code-improvements: 3/3] book-tree: add some internal checks
- Date: Wed, 11 Nov 2015 20:01:23 +0000 (UTC)
commit 4c77a242303fbf207bd8954e71b692f2dfd9e651
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Nov 11 20:47:28 2015 +0100
book-tree: add some internal checks
src/dh-book-tree.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/dh-book-tree.c b/src/dh-book-tree.c
index ece73fb..b1fe650 100644
--- a/src/dh-book-tree.c
+++ b/src/dh-book-tree.c
@@ -611,7 +611,6 @@ book_tree_init_selection (DhBookTree *tree)
GtkTreeSelection *selection;
GtkTreeIter iter;
gboolean iter_found = FALSE;
- DhLink *link;
priv = dh_book_tree_get_instance_private (tree);
@@ -643,12 +642,18 @@ book_tree_init_selection (DhBookTree *tree)
}
if (iter_found) {
+ DhLink *link;
+
gtk_tree_model_get (GTK_TREE_MODEL (priv->store),
&iter,
COL_LINK, &link,
-1);
+
priv->selected_link = link;
gtk_tree_selection_select_iter (selection, &iter);
+
+ if (dh_link_get_link_type (link) != DH_LINK_TYPE_BOOK)
+ g_warn_if_reached ();
}
g_signal_handlers_unblock_by_func (selection,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]