[gtksourceview] Completion: remove model_cancel()



commit 5872818c600b50a3cec215b2476b9d7ee9286746
Author: SÃbastien Wilmet <swilmet gnome org>
Date:   Mon Jan 21 16:29:01 2013 +0100

    Completion: remove model_cancel()

 gtksourceview/gtksourcecompletion.c      |    3 --
 gtksourceview/gtksourcecompletionmodel.c |    6 ----
 gtksourceview/gtksourcecompletionmodel.h |    3 --
 tests/test-completion-model.c            |   44 ------------------------------
 4 files changed, 0 insertions(+), 56 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 8fb01e8..b714c6a 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -1936,9 +1936,6 @@ cancel_completion (GtkSourceCompletion *completion)
 		/* Inform providers of cancellation through the context */
 		_gtk_source_completion_context_cancel (completion->priv->context);
 
-		/* Let the model know we are cancelling the population */
-		gtk_source_completion_model_cancel (completion->priv->model_proposals);
-
 		g_object_unref (completion->priv->context);
 		completion->priv->context = NULL;
 
diff --git a/gtksourceview/gtksourcecompletionmodel.c b/gtksourceview/gtksourcecompletionmodel.c
index d13f407..beef801 100644
--- a/gtksourceview/gtksourcecompletionmodel.c
+++ b/gtksourceview/gtksourcecompletionmodel.c
@@ -845,12 +845,6 @@ gtk_source_completion_model_add_proposals (GtkSourceCompletionModel    *model,
 	g_list_foreach (proposals, (GFunc)add_proposal, provider_node);
 }
 
-void
-gtk_source_completion_model_cancel (GtkSourceCompletionModel *model)
-{
-	g_return_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model));
-}
-
 /* Get/set visible providers */
 
 static void
diff --git a/gtksourceview/gtksourcecompletionmodel.h b/gtksourceview/gtksourcecompletionmodel.h
index 0b92999..af4b599 100644
--- a/gtksourceview/gtksourcecompletionmodel.h
+++ b/gtksourceview/gtksourcecompletionmodel.h
@@ -82,9 +82,6 @@ void     gtk_source_completion_model_end_populate               (GtkSourceComple
 								 GtkSourceCompletionProvider *provider);
 
 G_GNUC_INTERNAL
-void     gtk_source_completion_model_cancel			(GtkSourceCompletionModel    *model);
-
-G_GNUC_INTERNAL
 gboolean gtk_source_completion_model_is_empty			(GtkSourceCompletionModel    *model,
 								 gboolean                     only_visible);
 
diff --git a/tests/test-completion-model.c b/tests/test-completion-model.c
index 51c5b8b..acba596 100644
--- a/tests/test-completion-model.c
+++ b/tests/test-completion-model.c
@@ -693,47 +693,6 @@ test_iters (void)
 	test_iters_impl (TRUE);
 }
 
-static void
-test_cancel (void)
-{
-	GtkSourceCompletionModel *model = gtk_source_completion_model_new ();
-	GtkSourceCompletionProvider *provider;
-	GList *list_providers = NULL;
-	GList *proposals = NULL;
-	GList *all_providers = NULL;
-	GList *all_list_proposals = NULL;
-
-	/* Cancel out of a population, when the model is empty */
-	gtk_source_completion_model_cancel (model);
-	g_assert (gtk_source_completion_model_is_empty (model, FALSE));
-
-	/* Cancel during a population.
-	 * The contents of the model after the cancellation depends on the
-	 * implementation. Thus we don't check the contents.
-	 */
-	provider = GTK_SOURCE_COMPLETION_PROVIDER (test_provider_new ());
-	proposals = create_proposals ();
-	list_providers = g_list_append (NULL, provider);
-
-	gtk_source_completion_model_begin_populate (model, list_providers);
-	gtk_source_completion_model_add_proposals (model, provider, proposals);
-	gtk_source_completion_model_cancel (model);
-
-	/* Normal population */
-	create_providers (&all_providers, &all_list_proposals);
-	populate_model (model, all_providers, all_list_proposals);
-	check_all_providers_with_and_without_headers (model, all_providers, all_list_proposals);
-
-	/* Cancel out of a population, when the model is not empty */
-	gtk_source_completion_model_cancel (model);
-	check_all_providers_with_and_without_headers (model, all_providers, all_list_proposals);
-
-	g_object_unref (model);
-	g_list_free_full (list_providers, g_object_unref);
-	g_list_free_full (proposals, g_object_unref);
-	free_providers (all_providers, all_list_proposals);
-}
-
 int
 main (int argc, char **argv)
 {
@@ -769,8 +728,5 @@ main (int argc, char **argv)
 	g_test_add_func ("/CompletionModel/iters",
 			 test_iters);
 
-	g_test_add_func ("/CompletionModel/cancel",
-			 test_cancel);
-
 	return g_test_run ();
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]