[gobject-introspection] Revert "sourcescanner: Avoid scanning files when doing a macro scan"



commit ce1e2a2cc609b2e9e36c741e72bcfa5859ed6b62
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Thu Oct 17 16:14:11 2013 +0200

    Revert "sourcescanner: Avoid scanning files when doing a macro scan"
    
    This reverts commit 77fcc8fa47d63f58b2c3f6216a0493e42f6d44b3.
    Will be not needed in about 2 patches...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710320

 giscanner/sourcescanner.c |   27 +++++++++++----------------
 1 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/giscanner/sourcescanner.c b/giscanner/sourcescanner.c
index 830d21c..90db294 100644
--- a/giscanner/sourcescanner.c
+++ b/giscanner/sourcescanner.c
@@ -262,9 +262,11 @@ gi_source_scanner_set_macro_scan (GISourceScanner  *scanner,
   scanner->macro_scan = macro_scan;
 }
 
-static gboolean
-already_has_current_file (GISourceScanner *scanner)
+void
+gi_source_scanner_add_symbol (GISourceScanner  *scanner,
+                             GISourceSymbol   *symbol)
 {
+  gboolean found_filename = FALSE;
   GList *l;
   GFile *current_file;
 
@@ -276,24 +278,15 @@ already_has_current_file (GISourceScanner *scanner)
       GFile *file = g_file_new_for_path (l->data);
 
       if (g_file_equal (file, current_file))
-        {
+       {
+         found_filename = TRUE;
           g_object_unref (file);
-          return TRUE;
-        }
-
+         break;
+       }
       g_object_unref (file);
     }
 
-  g_object_unref (current_file);
-
-  return FALSE;
-}
-
-void
-gi_source_scanner_add_symbol (GISourceScanner  *scanner,
-                             GISourceSymbol   *symbol)
-{
-  if (scanner->macro_scan || already_has_current_file (scanner))
+  if (found_filename || scanner->macro_scan)
     scanner->symbols = g_slist_prepend (scanner->symbols,
                                        gi_source_symbol_ref (symbol));
   g_assert (symbol->source_filename != NULL);
@@ -315,6 +308,8 @@ gi_source_scanner_add_symbol (GISourceScanner  *scanner,
     default:
       break;
     }
+
+    g_object_unref (current_file);
 }
 
 GSList *


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