[gnome-builder] code-index: remove dead code



commit 8280d7a804ab920bf2358ebd661b4709040ac66b
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jan 18 06:38:05 2018 -0800

    code-index: remove dead code

 src/plugins/code-index/ide-code-index-index.c | 102 --------------------------
 src/plugins/code-index/ide-code-index-index.h |   6 --
 2 files changed, 108 deletions(-)
---
diff --git a/src/plugins/code-index/ide-code-index-index.c b/src/plugins/code-index/ide-code-index-index.c
index 101a8cf98..0bd88e7bb 100644
--- a/src/plugins/code-index/ide-code-index-index.c
+++ b/src/plugins/code-index/ide-code-index-index.c
@@ -206,108 +206,6 @@ ide_code_index_index_load (IdeCodeIndexIndex   *self,
   return TRUE;
 }
 
-/**
- * ide_code_index_index_load_if_nmod:
- * @self: a #IdeCodeIndexIndex
- * @directory: a #GFile of the directory to load
- * @files: (element-type Gio.File): a #GPtrArray of #GFile
- * @mod_time: the modified time
- * @cancellable: (nullable): a #GCancellable or %NULL
- * @error: a location for a #GError, or %NULL
- *
- * This function will load index from directory if it is not modified. This
- * fuction will only load if all "files" (GPtrArray) and only those "files" are
- * there in index.
- *
- * Returns: %TRUE if there were no modifications; otherwise %FALSE. It is possible
- *   for %FALSE to be returned and @error will not be set.
- *
- * Thread safety: You may call this function from a thread, given that the thread has
- *   it's own reference to @self.
- */
-gboolean
-ide_code_index_index_load_if_nmod (IdeCodeIndexIndex  *self,
-                                   GFile              *directory,
-                                   GPtrArray          *files,
-                                   GTimeVal            mod_time,
-                                   GCancellable       *cancellable,
-                                   GError            **error)
-{
-  g_autoptr(DirectoryIndex) dir_index = NULL;
-  g_autoptr(GFileInfo) file_info = NULL;
-  g_autoptr(GFile) names_file = NULL;
-  g_autofree gchar *dir_name = NULL;
-  GTimeVal index_mod_time;
-  gpointer value = NULL;
-
-  g_return_val_if_fail (IDE_IS_CODE_INDEX_INDEX (self), FALSE);
-  g_return_val_if_fail (G_IS_FILE (directory), FALSE);
-  g_return_val_if_fail (files != NULL, FALSE);
-
-  if (!(dir_index = directory_index_new (directory, cancellable, error)))
-    return FALSE;
-
-  /*
-   * Return false if current number of files in directory != number of files that are
-   * indexed previously in the same directory.
-   */
-  if (dzl_fuzzy_index_get_metadata_uint32 (dir_index->symbol_names, "n_files") != files->len)
-    return FALSE;
-
-  /* Return false if files are modified after they are indexed. */
-  names_file = g_file_get_child (directory, "SymbolNames");
-  file_info = g_file_query_info (names_file,
-                                 G_FILE_ATTRIBUTE_TIME_MODIFIED,
-                                 G_FILE_QUERY_INFO_NONE,
-                                 cancellable,
-                                 error);
-  if (file_info == NULL)
-    return FALSE;
-
-  g_file_info_get_modification_time (file_info, &index_mod_time);
-
-  if ((mod_time.tv_sec > index_mod_time.tv_sec) ||
-     ((mod_time.tv_sec == index_mod_time.tv_sec) &&
-      (mod_time.tv_usec > index_mod_time.tv_usec)))
-    return FALSE;
-
-  /* Return false if all current files in directory are not there in index. */
-  for (guint i = 0; i < files->len; i++)
-    {
-      GFile *file = g_ptr_array_index (files, i);
-      g_autofree gchar *path = g_file_get_path (file);
-
-      if (!dzl_fuzzy_index_get_metadata_uint32 (dir_index->symbol_names, path))
-        return FALSE;
-    }
-
-  dir_name = g_file_get_path (directory);
-
-  g_mutex_lock (&self->mutex);
-
-  if (g_hash_table_lookup_extended (self->directories, dir_name, NULL, &value))
-    {
-      guint i = GPOINTER_TO_UINT (value);
-
-      g_assert (i < self->indexes->len);
-      g_assert (self->indexes->len > 0);
-
-      directory_index_free (g_ptr_array_index (self->indexes, i));
-      g_ptr_array_index (self->indexes, i) = g_steal_pointer (&dir_index);
-    }
-  else
-    {
-      g_hash_table_insert (self->directories,
-                           g_steal_pointer (&dir_name),
-                           GUINT_TO_POINTER (self->indexes->len));
-      g_ptr_array_add (self->indexes, g_steal_pointer (&dir_index));
-    }
-
-  g_mutex_unlock (&self->mutex);
-
-  return TRUE;
-}
-
 /* Create a new IdeCodeIndexSearchResult based on match from fuzzy index */
 static IdeCodeIndexSearchResult *
 ide_code_index_index_create_search_result (IdeContext       *context,
diff --git a/src/plugins/code-index/ide-code-index-index.h b/src/plugins/code-index/ide-code-index-index.h
index 9c1a20c11..b486cf381 100644
--- a/src/plugins/code-index/ide-code-index-index.h
+++ b/src/plugins/code-index/ide-code-index-index.h
@@ -27,12 +27,6 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (IdeCodeIndexIndex, ide_code_index_index, IDE, CODE_INDEX_INDEX, IdeObject)
 
 IdeCodeIndexIndex *ide_code_index_index_new             (IdeContext           *context);
-gboolean           ide_code_index_index_load_if_nmod    (IdeCodeIndexIndex    *self,
-                                                         GFile                *directory,
-                                                         GPtrArray            *files,
-                                                         GTimeVal              mod_time,
-                                                         GCancellable         *cancellable,
-                                                         GError              **error);
 gboolean           ide_code_index_index_load            (IdeCodeIndexIndex    *self,
                                                          GFile                *directory,
                                                          GCancellable         *cancellable,


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