[devhelp/wip/swilmet/various-code-improvements: 2/2] 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: 2/2] book-tree: add some internal checks
- Date: Thu, 12 Nov 2015 10:41:18 +0000 (UTC)
commit 9800cf6473181b48d0dee7bcaf49356e2c48b1d5
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 33d5599..2d331fb 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]