[gtksourceview] Completion: rearrange the code of get_selected_proposal()
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Completion: rearrange the code of get_selected_proposal()
- Date: Fri, 15 Feb 2013 22:05:29 +0000 (UTC)
commit 94ee4abe5b943b43d65a0da35fc46a6d08aba449
Author: SÃbastien Wilmet <swilmet gnome org>
Date: Fri Feb 15 22:47:10 2013 +0100
Completion: rearrange the code of get_selected_proposal()
gtksourceview/gtksourcecompletion.c | 57 ++++++++++++++++------------------
1 files changed, 27 insertions(+), 30 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 6ef9174..6fb92fe 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -244,43 +244,40 @@ get_selected_proposal (GtkSourceCompletion *completion,
GtkSourceCompletionProposal **proposal)
{
GtkTreeIter piter;
- GtkTreeModel *model;
GtkTreeSelection *selection;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (completion->priv->tree_view_proposals));
- if (gtk_tree_selection_get_selected (selection, NULL, &piter))
+ if (!gtk_tree_selection_get_selected (selection, NULL, &piter))
{
- if (gtk_source_completion_model_iter_is_header (completion->priv->model_proposals, &piter))
- {
- return FALSE;
- }
-
- model = GTK_TREE_MODEL (completion->priv->model_proposals);
+ return FALSE;
+ }
- if (proposal)
- {
- gtk_tree_model_get (model, &piter,
- GTK_SOURCE_COMPLETION_MODEL_COLUMN_PROPOSAL,
- proposal, -1);
- }
+ if (gtk_source_completion_model_iter_is_header (completion->priv->model_proposals, &piter))
+ {
+ return FALSE;
+ }
- if (provider)
- {
- gtk_tree_model_get (model, &piter,
- GTK_SOURCE_COMPLETION_MODEL_COLUMN_PROVIDER,
- provider, -1);
- }
+ if (iter != NULL)
+ {
+ *iter = piter;
+ }
- if (iter != NULL)
- {
- *iter = piter;
- }
+ if (provider != NULL)
+ {
+ gtk_tree_model_get (GTK_TREE_MODEL (completion->priv->model_proposals), &piter,
+ GTK_SOURCE_COMPLETION_MODEL_COLUMN_PROVIDER, provider,
+ -1);
+ }
- return TRUE;
+ if (proposal != NULL)
+ {
+ gtk_tree_model_get (GTK_TREE_MODEL (completion->priv->model_proposals), &piter,
+ GTK_SOURCE_COMPLETION_MODEL_COLUMN_PROPOSAL, proposal,
+ -1);
}
- return FALSE;
+ return TRUE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]