SF.net SVN: geany:[3598] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Tue Feb 24 18:27:01 UTC 2009


Revision: 3598
          http://geany.svn.sourceforge.net/geany/?rev=3598&view=rev
Author:   eht16
Date:     2009-02-24 18:27:01 +0000 (Tue, 24 Feb 2009)

Log Message:
-----------
Don't let the tagmanager automatically reparse files if they seem to be changed on disk (affects all files in the current session, not the current one). This should speed up file saving a little bit, especially with remote files.
Remove now unnecessary calls to tm_workspace_update().

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/document.c
    trunk/tagmanager/include/tm_source_file.h
    trunk/tagmanager/include/tm_work_object.h
    trunk/tagmanager/tm_project.c
    trunk/tagmanager/tm_source_file.c
    trunk/tagmanager/tm_tag.c
    trunk/tagmanager/tm_work_object.c
    trunk/tagmanager/tm_workspace.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-02-24 18:26:33 UTC (rev 3597)
+++ trunk/ChangeLog	2009-02-24 18:27:01 UTC (rev 3598)
@@ -11,6 +11,15 @@
    path at startup to avoid unwanted directory locking(closes #2626124).
  * src/encoding.c:
    Fix broken selection of "Document->Set Encoding" menu items.
+ * src/document.c, tagmanager/include/tm_source_file.h,
+   tagmanager/include/tm_work_object.h, tagmanager/tm_project.c,
+   tagmanager/tm_source_file.c, tagmanager/tm_tag.c,
+   tagmanager/tm_work_object.c, tagmanager/tm_workspace.c:
+   Don't let the tagmanager automatically reparse files if they
+   seem to be changed on disk (affects all files in the current session,
+   not the current one). This should speed up file saving a little bit,
+   especially with remote files.
+   Remove now unnecessary calls to tm_workspace_update().
 
 
 2009-02-20  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2009-02-24 18:26:33 UTC (rev 3597)
+++ trunk/src/document.c	2009-02-24 18:27:01 UTC (rev 3598)
@@ -1784,8 +1784,6 @@
 		/* update filetype-related things */
 		document_set_filetype(doc, doc->file_type);
 
-		tm_workspace_update(TM_WORK_OBJECT(app->tm_workspace), TRUE, TRUE, FALSE);
-
 		document_update_tab_label(doc);
 
 		msgwin_status_add(_("File %s saved."), doc->file_name);
@@ -2814,7 +2812,6 @@
 
 	force_close_all();
 
-	tm_workspace_update(TM_WORK_OBJECT(app->tm_workspace), TRUE, TRUE, FALSE);
 	return TRUE;
 }
 

Modified: trunk/tagmanager/include/tm_source_file.h
===================================================================
--- trunk/tagmanager/include/tm_source_file.h	2009-02-24 18:26:33 UTC (rev 3597)
+++ trunk/tagmanager/include/tm_source_file.h	2009-02-24 18:27:01 UTC (rev 3598)
@@ -68,7 +68,7 @@
  also lost. The language parameter is automatically set the first time the file
  is parsed.
  \param source_file The source file to update.
- \param force Whether the cache is to be ignored.
+ \param force Ignored. The source file is always updated.
  \param recurse This parameter is ignored for source files and is only there for consistency.
  \param update_parent If set to TRUE, sends an update signal to parent if required. You should
  always set this to TRUE if you are calling this function directly.

Modified: trunk/tagmanager/include/tm_work_object.h
===================================================================
--- trunk/tagmanager/include/tm_work_object.h	2009-02-24 18:26:33 UTC (rev 3597)
+++ trunk/tagmanager/include/tm_work_object.h	2009-02-24 18:27:01 UTC (rev 3598)
@@ -37,7 +37,7 @@
 	char *file_name; /*!< Full file name (inc. path) of the work object */
 	char *short_name; /*!< Just the name of the file (without the path) */
 	struct _TMWorkObject *parent;
-	time_t analyze_time; /*!< Time when the object was last analyzed */
+	time_t analyze_time; /*!< UNUSED Time when the object was last analyzed */
 	GPtrArray *tags_array; /*!< Tags obtained by parsing the object */
 } TMWorkObject;
 
@@ -117,15 +117,6 @@
 time_t tm_get_file_timestamp(const char *file_name);
 
 /*
- Checks if the work object has been modified since the last update by comparing
- the timestamp stored in the work object structure with the modification time
- of the physical file.
- \param work_object Pointer to the work object.
- \return TRUE if the file has changed since last update, FALSE otherwise.
-*/
-gboolean tm_work_object_is_changed(TMWorkObject *work_object);
-
-/*
  Destroys a work object's data without freeing the structure itself. It should
  be called by the deallocator function of classes derived from TMWorkObject. The
  user shouldn't have to call this function.

Modified: trunk/tagmanager/tm_project.c
===================================================================
--- trunk/tagmanager/tm_project.c	2009-02-24 18:26:33 UTC (rev 3597)
+++ trunk/tagmanager/tm_project.c	2009-02-24 18:27:01 UTC (rev 3598)
@@ -350,7 +350,7 @@
 			tm_project_recreate_tags_array(project);
 		}
 	}
-	work_object->analyze_time = time(NULL);
+	/* work_object->analyze_time = time(NULL); */
 	if ((work_object->parent) && (update_parent))
 		tm_workspace_update(work_object->parent, TRUE, FALSE, FALSE);
 	return update_tags;
@@ -407,7 +407,6 @@
 			else
 			{
 				source_file->work_object.parent = TM_WORK_OBJECT(project);
-				source_file->work_object.analyze_time = tag->atts.file.timestamp;
 				source_file->lang = tag->atts.file.lang;
 				source_file->inactive = tag->atts.file.inactive;
 				if (!project->file_list)

Modified: trunk/tagmanager/tm_source_file.c
===================================================================
--- trunk/tagmanager/tm_source_file.c	2009-02-24 18:26:33 UTC (rev 3597)
+++ trunk/tagmanager/tm_source_file.c	2009-02-24 18:27:01 UTC (rev 3598)
@@ -239,11 +239,11 @@
 gboolean tm_source_file_update(TMWorkObject *source_file, gboolean force
   , gboolean __unused__ recurse, gboolean update_parent)
 {
-	if (force || (tm_work_object_is_changed(source_file)))
+	if (force)
 	{
 		tm_source_file_parse(TM_SOURCE_FILE(source_file));
 		tm_tags_sort(source_file->tags_array, NULL, FALSE);
-		source_file->analyze_time = time(NULL);
+		/* source_file->analyze_time = tm_get_file_timestamp(source_file->file_name); */
 		if ((source_file->parent) && update_parent)
 		{
 			tm_work_object_update(source_file->parent, TRUE, FALSE, TRUE);
@@ -268,7 +268,7 @@
 
 	tm_source_file_buffer_parse (TM_SOURCE_FILE(source_file), text_buf, buf_size);
 	tm_tags_sort(source_file->tags_array, NULL, FALSE);
-	source_file->analyze_time = time(NULL);
+	/* source_file->analyze_time = time(NULL); */
 	if ((source_file->parent) && update_parent)
 	{
 #ifdef TM_DEBUG

Modified: trunk/tagmanager/tm_tag.c
===================================================================
--- trunk/tagmanager/tm_tag.c	2009-02-24 18:26:33 UTC (rev 3597)
+++ trunk/tagmanager/tm_tag.c	2009-02-24 18:27:01 UTC (rev 3598)
@@ -135,7 +135,7 @@
 		{
 			tag->name = g_strdup(file->work_object.file_name);
 			tag->type = tm_tag_file_t;
-			tag->atts.file.timestamp = file->work_object.analyze_time;
+			/* tag->atts.file.timestamp = file->work_object.analyze_time; */
 			tag->atts.file.lang = file->lang;
 			tag->atts.file.inactive = FALSE;
 			return TRUE;

Modified: trunk/tagmanager/tm_work_object.c
===================================================================
--- trunk/tagmanager/tm_work_object.c	2009-02-24 18:26:33 UTC (rev 3597)
+++ trunk/tagmanager/tm_work_object.c	2009-02-24 18:27:01 UTC (rev 3598)
@@ -158,6 +158,7 @@
 	return TRUE;
 }
 
+/*
 time_t tm_get_file_timestamp(const char *file_name)
 {
 	struct stat s;
@@ -166,7 +167,6 @@
 
 	if (0 != g_stat(file_name, &s))
 	{
-		/*g_warning("Unable to stat %s", file_name);*/
 		return (time_t) 0;
 	}
 	else
@@ -177,6 +177,7 @@
 {
 	return (gboolean) (work_object->analyze_time < tm_get_file_timestamp(work_object->file_name));
 }
+*/
 
 TMWorkObject *tm_work_object_new(guint type, const char *file_name, gboolean create)
 {

Modified: trunk/tagmanager/tm_workspace.c
===================================================================
--- trunk/tagmanager/tm_workspace.c	2009-02-24 18:26:33 UTC (rev 3597)
+++ trunk/tagmanager/tm_workspace.c	2009-02-24 18:27:01 UTC (rev 3598)
@@ -533,7 +533,7 @@
 	}
 	if (update_tags)
 		tm_workspace_recreate_tags_array();
-	workspace->analyze_time = time(NULL);
+	/* workspace->analyze_time = time(NULL); */
 	return update_tags;
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list