[anjuta/new-assistance] language-support-cpp-java: Removed the cancel stuff because queries cannot be cancelled
- From: Johannes Schmid <jhs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [anjuta/new-assistance] language-support-cpp-java: Removed the cancel stuff because queries cannot be cancelled
- Date: Mon, 23 Nov 2009 08:41:25 +0000 (UTC)
commit 008dad26559dd4cb674a045b48de87b31b709d9d
Author: Johannes Schmid <jhs gnome org>
Date: Mon Nov 23 09:27:34 2009 +0100
language-support-cpp-java: Removed the cancel stuff because queries cannot be cancelled
anyway and it was just causing problems.
.../language-support-cpp-java/cpp-java-assist.c | 26 ++++----------------
plugins/symbol-db/symbol-db-search-command.c | 8 +++++-
po/POTFILES.in | 1 +
3 files changed, 13 insertions(+), 22 deletions(-)
---
diff --git a/plugins/language-support-cpp-java/cpp-java-assist.c b/plugins/language-support-cpp-java/cpp-java-assist.c
index f763909..ecb74e6 100644
--- a/plugins/language-support-cpp-java/cpp-java-assist.c
+++ b/plugins/language-support-cpp-java/cpp-java-assist.c
@@ -75,9 +75,6 @@ struct _CppJavaAssistPriv {
gboolean editor_only;
IAnjutaIterable* start_iter;
- GCancellable* cancel_system;
- GCancellable* cancel_file;
- GCancellable* cancel_project;
gboolean async_file : 1;
gboolean async_system : 1;
gboolean async_project : 1;
@@ -354,7 +351,7 @@ cpp_java_assist_update_autocomplete (CppJavaAssist *assist)
DEBUG_PRINT ("Populating %d proposals", length);
- if (length <= max_completions)
+ if (1) //length <= max_completions)
{
GList *node, *suggestions = NULL;
@@ -398,23 +395,16 @@ cpp_java_assist_create_word_completion_cache (CppJavaAssist *assist)
cpp_java_assist_destroy_completion_cache (assist);
if (assist->priv->async_file)
{
- g_cancellable_cancel (assist->priv->cancel_file);
assist->priv->async_file = FALSE;
}
- g_cancellable_reset (assist->priv->cancel_file);
if (assist->priv->async_system)
{
- g_cancellable_cancel (assist->priv->cancel_system);
assist->priv->async_system = FALSE;
}
- g_cancellable_reset (assist->priv->cancel_system);
if (assist->priv->async_project)
{
- g_cancellable_cancel (assist->priv->cancel_project);
assist->priv->async_project = FALSE;
}
- g_cancellable_reset (assist->priv->cancel_project);
-
if (!assist->priv->pre_word || strlen(assist->priv->pre_word) < 3)
return;
@@ -432,7 +422,7 @@ cpp_java_assist_create_word_completion_cache (CppJavaAssist *assist)
IANJUTA_SYMBOL_TYPE_UNDEF,
TRUE,
IANJUTA_SYMBOL_FIELD_SIMPLE|IANJUTA_SYMBOL_FIELD_TYPE,
- pattern, file, -1, -1, assist->priv->cancel_file,
+ pattern, file, -1, -1, NULL,
notify, (IAnjutaSymbolManagerSearchCallback) on_query_data, assist,
NULL);
g_object_unref (file);
@@ -447,7 +437,7 @@ cpp_java_assist_create_word_completion_cache (CppJavaAssist *assist)
TRUE,
IANJUTA_SYMBOL_FIELD_SIMPLE|IANJUTA_SYMBOL_FIELD_TYPE,
pattern, IANJUTA_SYMBOL_MANAGER_SEARCH_FS_PUBLIC, -1, -1,
- assist->priv->cancel_project,
+ NULL,
notify, (IAnjutaSymbolManagerSearchCallback) on_query_data, assist,
NULL);
}
@@ -460,7 +450,7 @@ cpp_java_assist_create_word_completion_cache (CppJavaAssist *assist)
TRUE,
IANJUTA_SYMBOL_FIELD_SIMPLE|IANJUTA_SYMBOL_FIELD_TYPE,
pattern, IANJUTA_SYMBOL_MANAGER_SEARCH_FS_PUBLIC, -1, -1,
- assist->priv->cancel_system,
+ NULL,
notify, (IAnjutaSymbolManagerSearchCallback) on_query_data, assist,
NULL);
}
@@ -670,7 +660,7 @@ cpp_java_assist_calltip (CppJavaAssist *assist,
cpp_java_assist_show_calltip (assist, call_context,
iter);
g_free (assist->priv->calltip_context);
- assist->priv->calltip_context = g_strdup(call_context);
+ assist->priv->calltip_context = g_strdup(call_context);
}
}
else
@@ -837,9 +827,6 @@ static void
cpp_java_assist_init (CppJavaAssist *assist)
{
assist->priv = g_new0 (CppJavaAssistPriv, 1);
- assist->priv->cancel_file = g_cancellable_new();
- assist->priv->cancel_project = g_cancellable_new();
- assist->priv->cancel_system = g_cancellable_new();
}
static void
@@ -852,9 +839,6 @@ cpp_java_assist_finalize (GObject *object)
{
g_free (assist->priv->calltip_context);
assist->priv->calltip_context = NULL;
- g_object_unref (assist->priv->cancel_file);
- g_object_unref (assist->priv->cancel_project);
- g_object_unref (assist->priv->cancel_system);
}
g_free (assist->priv);
G_OBJECT_CLASS (cpp_java_assist_parent_class)->finalize (object);
diff --git a/plugins/symbol-db/symbol-db-search-command.c b/plugins/symbol-db/symbol-db-search-command.c
index f3e1640..72ecc72 100644
--- a/plugins/symbol-db/symbol-db-search-command.c
+++ b/plugins/symbol-db/symbol-db-search-command.c
@@ -45,6 +45,8 @@ struct _SymbolDBSearchCommandPriv {
* freed
*/
SymbolDBEngineIterator *iterator_result;
+
+ gboolean cancelled;
};
@@ -58,6 +60,7 @@ sdb_search_command_init (SymbolDBSearchCommand *object)
object->priv->gfile = NULL;
object->priv->session_packages = NULL;
object->priv->pattern = NULL;
+ object->priv->cancelled = FALSE;
}
static void
@@ -85,6 +88,9 @@ do_search_file (SymbolDBSearchCommand *sdbsc)
gchar *abs_file_path;
priv = sdbsc->priv;
+
+ if (priv->cancelled)
+ return NULL;
abs_file_path = g_file_get_path (priv->gfile);
@@ -173,7 +179,7 @@ sdb_search_command_run (AnjutaCommand *command)
static void
sdb_search_command_cancel(AnjutaCommand* command)
{
- /* FIXME: Cancel the query if possible */
+ command->priv->cancelled = TRUE;
}
static void
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 6830902..c3ca737 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -233,6 +233,7 @@ plugins/debug-manager/watch.c
plugins/debug-manager/anjuta-debug-manager.schemas.in
[type: gettext/glade]plugins/language-support-cpp-java/anjuta-language-cpp-java.ui
plugins/language-support-cpp-java/plugin.c
+plugins/language-support-cpp-java/cpp-java-assist.c
plugins/sourceview/plugin.c
[type: gettext/ini]plugins/gdb/anjuta-gdb.plugin.in
[type: gettext/ini]plugins/git/git.plugin.in
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]