anjuta r4498 - in trunk: . plugins/search plugins/sourceview plugins/symbol-db plugins/symbol-db/test



Author: jhs
Date: Sun Dec 28 10:43:07 2008
New Revision: 4498
URL: http://svn.gnome.org/viewvc/anjuta?rev=4498&view=rev

Log:
2008-12-28  Johannes  Schmid <jhs gnome org>

	* plugins/search/search-replace.c (search_and_replace):
	Removed comment
	* plugins/sourceview/sourceview.c (set_select), (iselect_set):
	#545127 â When searching down can't see below search result

Modified:
   trunk/ChangeLog
   trunk/plugins/search/search-replace.c
   trunk/plugins/sourceview/sourceview.c
   trunk/plugins/symbol-db/symbol-db-engine-core.c
   trunk/plugins/symbol-db/test/Makefile.am

Modified: trunk/plugins/search/search-replace.c
==============================================================================
--- trunk/plugins/search/search-replace.c	(original)
+++ trunk/plugins/search/search-replace.c	Sun Dec 28 10:43:07 2008
@@ -370,12 +370,6 @@
 		{		
 			fb->pos = se->start_pos;
 			offset = 0;
-/* NO - there's no reason for user to expect existing marks to be removed.
-	And that can easily be done manually by user if so desired.
-			if (s->action == SA_BOOKMARK && IANJUTA_IS_MARKABLE (fb->te))
-				ianjuta_markable_delete_all_markers(IANJUTA_MARKABLE(fb->te), 
-				                                    IANJUTA_MARKABLE_LINEMARKER, NULL);
-*/
 		//FIXME enable clearing of marks by some means other than a 0-match search
 			if (s->action == SA_HIGHLIGHT)	
 				ianjuta_indicable_clear (IANJUTA_INDICABLE(fb->te), NULL); 				

Modified: trunk/plugins/sourceview/sourceview.c
==============================================================================
--- trunk/plugins/sourceview/sourceview.c	(original)
+++ trunk/plugins/sourceview/sourceview.c	Sun Dec 28 10:43:07 2008
@@ -1313,9 +1313,14 @@
 static void
 set_select(Sourceview* sv, GtkTextIter* start_iter, GtkTextIter* end_iter)
 {
-	gtk_text_buffer_select_range (GTK_TEXT_BUFFER (sv->priv->document), start_iter, end_iter);
-	gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(sv->priv->view),
-								 gtk_text_buffer_get_insert(GTK_TEXT_BUFFER(sv->priv->document)));
+	GtkTextBuffer* buffer = GTK_TEXT_BUFFER (sv->priv->document);
+	gtk_text_buffer_select_range (buffer, start_iter, end_iter);
+	gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (sv->priv->view),
+								  gtk_text_buffer_get_insert (buffer),
+								  0.25,
+								  FALSE,
+								  0.0,
+								  0.0);
 }
 
 /* IAnjutaEditorSelection */
@@ -1401,12 +1406,9 @@
 			 GError** e)
 {
 	Sourceview* sv = ANJUTA_SOURCEVIEW(edit);
-	gtk_text_buffer_select_range (GTK_TEXT_BUFFER (sv->priv->document),
-								  sourceview_cell_get_iter (SOURCEVIEW_CELL (istart)),
-								  sourceview_cell_get_iter (SOURCEVIEW_CELL (iend)));
-	gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW (sv->priv->view),
-												 sourceview_cell_get_iter (SOURCEVIEW_CELL (istart)),
-												 0, FALSE, 0, 0);
+	set_select(sv,
+			   sourceview_cell_get_iter (SOURCEVIEW_CELL (istart)),
+			   sourceview_cell_get_iter (SOURCEVIEW_CELL (iend)));
 }
 															
 

Modified: trunk/plugins/symbol-db/symbol-db-engine-core.c
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-engine-core.c	(original)
+++ trunk/plugins/symbol-db/symbol-db-engine-core.c	Sun Dec 28 10:43:07 2008
@@ -1122,7 +1122,6 @@
 		/* insert or update a symbol */
 		sdb_engine_add_new_symbol (dbe, &tag_entry, file_defined_id,
 								   force_sym_update);
-		
 		tags_total_DEBUG ++;
 		tag_entry.file = NULL;
 	}
@@ -4600,6 +4599,7 @@
 	gint update_flag;
 	GValue *ret_value;
 	gboolean ret_bool;
+	GTimer* timer = g_timer_new();
 		
 	g_return_val_if_fail (dbe != NULL, -1);
 	priv = dbe->priv;
@@ -4632,24 +4632,28 @@
 	}
 	
 	type_id = sdb_engine_add_new_sym_type (dbe, tag_entry);
-
+	DEBUG_PRINT ("add_symbol type_id: %f", g_timer_elapsed (timer, NULL));
 	/* scope_definition_id tells what scope this symbol defines
 	 * this call *MUST BE DONE AFTER* sym_type table population.
 	 */
 	scope_definition_id = sdb_engine_add_new_scope_definition (dbe, tag_entry,
 															   type_id);
 
+	DEBUG_PRINT ("add_symbol scope_definition_id: %f", g_timer_elapsed (timer, NULL));
 	/* the container scopes can be: union, struct, typeref, class, namespace etc.
 	 * this field will be parse in the second pass.
 	 */
 	scope_id = 0;
 
 	kind_id = sdb_engine_add_new_sym_kind (dbe, tag_entry);
+	DEBUG_PRINT ("add_symbol kind_id: %f", g_timer_elapsed (timer, NULL));
 	
 	access_kind_id = sdb_engine_add_new_sym_access (dbe, tag_entry);
+	DEBUG_PRINT ("add_symbol access_kind_id: %f", g_timer_elapsed (timer, NULL));
 	implementation_kind_id =
 		sdb_engine_add_new_sym_implementation (dbe, tag_entry);
-	
+	DEBUG_PRINT ("add_symbol implementation_kind_id: %f", g_timer_elapsed (timer, NULL));
+	DEBUG_PRINT ("add_symbol ids: %f", g_timer_elapsed (timer, NULL));
 	/* ok: was the symbol updated [at least on it's type_id/name]? 
 	 * There are 3 cases:
 	 * #1. The symbol remain the same [at least on unique index key]. We will 
@@ -4662,7 +4666,7 @@
 	 *     a second stage because of the 'tmp_flag = 0'. Triggers will remove 
 	 *     also scope_ids and other things.
 	 */
-
+	
 	
 	if (update_flag == FALSE)
 	{
@@ -4718,8 +4722,6 @@
 		MP_RETURN_OBJ_INT (priv, value3);
 		MP_RETURN_OBJ_INT (priv, value4);
 	}
-		 
-
 	/* ok then, parse the symbol id value */
 	if (symbol_id <= 0)
 	{
@@ -4788,7 +4790,7 @@
 
 		MP_SET_HOLDER_BATCH_INT(priv, param, symbol_id, ret_bool, ret_value);
 	}
-	
+	DEBUG_PRINT ("add_symbol init: %f", g_timer_elapsed (timer, NULL));
 	/* common params */
 
 	/* fileposition parameter */
@@ -4872,12 +4874,15 @@
 	
 	MP_SET_HOLDER_BATCH_INT(priv, param, update_flag, ret_bool, ret_value);
 	
+	DEBUG_PRINT ("add_symbol batch: %f", g_timer_elapsed (timer, NULL));
+	
 	/* execute the query with parametes just set */
 	gint nrows;
 	nrows = gda_connection_statement_execute_non_select (priv->db_connection, 
 													 (GdaStatement*)stmt, 
 													 (GdaSet*)plist, &last_inserted,
 													 NULL);
+	DEBUG_PRINT ("add_symbol query: %f", g_timer_elapsed (timer, NULL));
 	
 	if (sym_was_updated == FALSE)
 	{
@@ -4919,6 +4924,8 @@
 	if (table_id > 0)
 		sdb_engine_add_new_tmp_heritage_scope (dbe, tag_entry, table_id);
 	
+	DEBUG_PRINT ("add_symbol end: %f", g_timer_elapsed (timer, NULL));
+	g_timer_destroy (timer);
 	return table_id;
 }
 

Modified: trunk/plugins/symbol-db/test/Makefile.am
==============================================================================
--- trunk/plugins/symbol-db/test/Makefile.am	(original)
+++ trunk/plugins/symbol-db/test/Makefile.am	Sun Dec 28 10:43:07 2008
@@ -1,6 +1,7 @@
 
 bin_PROGRAMS = \
-	benchmark 
+	benchmark \
+	test-symbol-db 
 	
 
 AM_CPPFLAGS = \
@@ -22,8 +23,9 @@
 	main.c       \
 	../readtags.c       \
 	../readtags.h       \
-	../symbol-db-engine.c       \
-	../symbol-db-engine.h       \
+	../symbol-db-engine-core.c       \
+	../symbol-db-engine-queries.c       \
+	../symbol-db-engine-utils.c  \
 	../symbol-db-engine-iterator.c       \
 	../symbol-db-engine-iterator.h \
 	../symbol-db-engine-iterator-node.c \
@@ -39,10 +41,10 @@
 	benchmark.c       \
 	../readtags.c       \
 	../readtags.h       \
-	../symbol-db-engine.c       \
-	../symbol-db-engine.h       \
+	../symbol-db-engine-core.c       \
+	../symbol-db-engine-queries.c       \
 	../symbol-db-engine-iterator.c       \
-	../symbol-db-engine-iterator.h \
+	../symbol-db-engine-utils.c \
 	../symbol-db-engine-iterator-node.c \
 	../symbol-db-engine-iterator-node.h \
 	../symbol-db-view.h \



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