[tepl] Totally remove metadata handling, start over



commit 2f21d526271a433466e4e546af9a358f80ee1f94
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Apr 16 20:24:05 2020 +0200

    Totally remove metadata handling, start over
    
    GVfs metadata makes everything more complicated, the need to have async
    APIs etc. Although it was almost finished and well unit tested, the new
    API was difficult to integrate in existing apps.
    
    So, drop GVfs metadata, start over with a simpler implementation.
    
    The only thing left is tepl_utils_metadata_key_is_valid() :-) But even
    that it will maybe be moved elsewhere, or made private.

 docs/reference/api-breaks.xml                      |   35 -
 docs/reference/tepl-docs.xml                       |    6 -
 docs/reference/tepl-sections.txt                   |   34 -
 meson.build                                        |    2 -
 meson_options.txt                                  |    8 -
 po/POTFILES.in                                     |    3 -
 tepl/meson.build                                   |    6 -
 tepl/tepl-file-metadata.c                          |  739 -------------
 tepl/tepl-file-metadata.h                          |   77 --
 tepl/tepl-init.c                                   |    2 -
 tepl/tepl-metadata-store.c                         | 1117 --------------------
 tepl/tepl-metadata-store.h                         |  105 --
 tepl/tepl-metadata.c                               |  402 -------
 tepl/tepl-metadata.h                               |   58 -
 tepl/tepl.h                                        |    2 -
 testsuite/meson.build                              |    2 -
 testsuite/test-file-metadata.c                     |  616 -----------
 testsuite/test-metadata-store.c                    |  483 ---------
 .../test-metadata-store/document-with-no-entry.xml |    4 -
 testsuite/test-metadata-store/empty-key.xml        |    5 -
 .../expected-to-fail-00-empty.xml                  |    0
 .../test-metadata-store/expected-to-fail-01.xml    |    2 -
 .../test-metadata-store/expected-to-fail-02.xml    |    4 -
 .../test-metadata-store/expected-to-fail-03.xml    |    5 -
 .../test-metadata-store/expected-to-fail-04.xml    |    5 -
 .../test-metadata-store/expected-to-fail-05.xml    |    5 -
 .../test-metadata-store/expected-to-fail-06.xml    |    5 -
 .../expected-to-fail-07-garbage.xml                |    1 -
 .../from-old-metadata-manager.xml                  |   10 -
 .../test-metadata-store/gcsvedit-one-entry.xml     |    5 -
 .../max-num-locations-after.xml                    |    5 -
 .../max-num-locations-before.xml                   |   11 -
 .../test-metadata-store/metadata-tag-only.xml      |    2 -
 .../test-metadata-store/new-format-version.xml     |    6 -
 .../one-entry-markup-escape.xml                    |    5 -
 35 files changed, 3777 deletions(-)
---
diff --git a/docs/reference/api-breaks.xml b/docs/reference/api-breaks.xml
index 4e39a12..98a933c 100644
--- a/docs/reference/api-breaks.xml
+++ b/docs/reference/api-breaks.xml
@@ -120,39 +120,4 @@
       </listitem>
     </itemizedlist>
   </chapter>
-
-  <chapter id="api-breaks-4-to-5-tepl">
-    <title>Tepl 4 -> Tepl 5</title>
-
-    <itemizedlist>
-      <listitem>
-        <para>
-          The <link linkend="TeplFileMetadata">TeplFileMetadata</link> API has
-          been re-worked to no longer depend on
-          <link linkend="TeplFile">TeplFile</link>, and to no longer do
-          synchronous I/O, only the async API has been kept.
-        </para>
-      </listitem>
-      <listitem>
-        <para>
-          The <code>tepl_file_get_file_metadata()</code> function has been
-          removed.
-        </para>
-      </listitem>
-      <listitem>
-        <para>
-          The <link linkend="tepl-tab-load-file">tepl_tab_load_file()</link>
-          function no longer loads the file metadata (but it was anyway an
-          implementation detail).
-        </para>
-      </listitem>
-      <listitem>
-        <para>
-          The <code>tepl_metadata_manager*()</code> functions have been removed,
-          they are superseded by
-          <link linkend="TeplMetadataStore">TeplMetadataStore</link>.
-        </para>
-      </listitem>
-    </itemizedlist>
-  </chapter>
 </part>
diff --git a/docs/reference/tepl-docs.xml b/docs/reference/tepl-docs.xml
index dea48e0..73222f9 100644
--- a/docs/reference/tepl-docs.xml
+++ b/docs/reference/tepl-docs.xml
@@ -49,12 +49,6 @@
       <xi:include href="xml/io-error-info-bars.xml"/>
     </chapter>
 
-    <chapter id="file-metadata">
-      <title>File Metadata</title>
-      <xi:include href="xml/file-metadata.xml"/>
-      <xi:include href="xml/metadata-store.xml"/>
-    </chapter>
-
     <chapter id="code-folding">
       <title>Code Folding</title>
       <xi:include href="xml/fold-region.xml"/>
diff --git a/docs/reference/tepl-sections.txt b/docs/reference/tepl-sections.txt
index ce4ccd5..985b5d0 100644
--- a/docs/reference/tepl-sections.txt
+++ b/docs/reference/tepl-sections.txt
@@ -163,21 +163,6 @@ tepl_newline_type_get_type
 tepl_compression_type_get_type
 </SECTION>
 
-<SECTION>
-<FILE>file-metadata</FILE>
-TeplFileMetadata
-tepl_file_metadata_new
-tepl_file_metadata_get
-tepl_file_metadata_set
-tepl_file_metadata_load_async
-tepl_file_metadata_load_finish
-tepl_file_metadata_save_async
-tepl_file_metadata_save_finish
-<SUBSECTION Standard>
-TEPL_TYPE_FILE_METADATA
-TeplFileMetadataClass
-</SECTION>
-
 <SECTION>
 <FILE>file-loader</FILE>
 TeplFileLoader
@@ -305,25 +290,6 @@ tepl_iter_get_line_indentation
 tepl_menu_shell_append_edit_actions
 </SECTION>
 
-<SECTION>
-<FILE>metadata-store</FILE>
-TeplMetadataStore
-tepl_metadata_store_get_singleton
-tepl_metadata_store_set_store_file
-tepl_metadata_store_set_max_number_of_locations
-tepl_metadata_store_save
-<SUBSECTION Standard>
-TEPL_IS_METADATA_STORE
-TEPL_IS_METADATA_STORE_CLASS
-TEPL_METADATA_STORE
-TEPL_METADATA_STORE_CLASS
-TEPL_METADATA_STORE_GET_CLASS
-TEPL_TYPE_METADATA_STORE
-TeplMetadataStoreClass
-TeplMetadataStorePrivate
-tepl_metadata_store_get_type
-</SECTION>
-
 <SECTION>
 <FILE>tab</FILE>
 TeplTab
diff --git a/meson.build b/meson.build
index b418888..1468b07 100644
--- a/meson.build
+++ b/meson.build
@@ -57,7 +57,6 @@ TEPL_DEPS = [TEPL_PUBLIC_DEPS, TEPL_PRIVATE_DEPS]
 config_data = configuration_data()
 GETTEXT_PACKAGE_NAME = 'tepl-' + TEPL_API_VERSION
 config_data.set_quoted('GETTEXT_PACKAGE', GETTEXT_PACKAGE_NAME)
-config_data.set10('ENABLE_GVFS_METADATA', get_option('gvfs_metadata'))
 configure_file(
   output: 'config.h',
   configuration: config_data
@@ -138,5 +137,4 @@ endif
 
 summary('API version', TEPL_API_VERSION)
 summary('Prefix', get_option('prefix'))
-summary('GVfs metadata', get_option('gvfs_metadata'))
 summary('API documentation', get_option('gtk_doc'))
diff --git a/meson_options.txt b/meson_options.txt
index 2068642..cad97dd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,11 +3,3 @@ option(
   type: 'boolean', value: false,
   description: 'Build API reference (requires gtk-doc)'
 )
-
-# Using GVfs to store metadata is recommended on platforms that support it.
-# Otherwise there is a fallback implementation, but it's less optimal.
-option(
-  'gvfs_metadata',
-  type: 'boolean', value: true,
-  description: 'Use GVfs to store additional file metadata'
-)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4434445..964a37d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -12,15 +12,12 @@ tepl/tepl-file.c
 tepl/tepl-file-content.c
 tepl/tepl-file-content-loader.c
 tepl/tepl-file-loader.c
-tepl/tepl-file-metadata.c
 tepl/tepl-file-saver.c
 tepl/tepl-info-bar.c
 tepl/tepl-init.c
 tepl/tepl-io-error-info-bars.c
 tepl/tepl-iter.c
 tepl/tepl-menu-shell.c
-tepl/tepl-metadata.c
-tepl/tepl-metadata-store.c
 tepl/tepl-notebook.c
 tepl/tepl-signal-group.c
 tepl/tepl-tab.c
diff --git a/tepl/meson.build b/tepl/meson.build
index 7df5dbf..a9226e9 100644
--- a/tepl/meson.build
+++ b/tepl/meson.build
@@ -8,7 +8,6 @@ tepl_public_headers = [
   'tepl-encoding.h',
   'tepl-file.h',
   'tepl-file-loader.h',
-  'tepl-file-metadata.h',
   'tepl-file-saver.h',
   'tepl-fold-region.h',
   'tepl-gutter-renderer-folds.h',
@@ -17,7 +16,6 @@ tepl_public_headers = [
   'tepl-io-error-info-bars.h',
   'tepl-iter.h',
   'tepl-menu-shell.h',
-  'tepl-metadata-store.h',
   'tepl-notebook.h',
   'tepl-tab.h',
   'tepl-tab-group.h',
@@ -35,7 +33,6 @@ tepl_public_c_files = [
   'tepl-encoding.c',
   'tepl-file.c',
   'tepl-file-loader.c',
-  'tepl-file-metadata.c',
   'tepl-file-saver.c',
   'tepl-fold-region.c',
   'tepl-gutter-renderer-folds.c',
@@ -44,7 +41,6 @@ tepl_public_c_files = [
   'tepl-io-error-info-bars.c',
   'tepl-iter.c',
   'tepl-menu-shell.c',
-  'tepl-metadata-store.c',
   'tepl-notebook.c',
   'tepl-tab.c',
   'tepl-tab-group.c',
@@ -61,7 +57,6 @@ TEPL_PRIVATE_HEADERS = [
   'tepl-file-content.h',
   'tepl-file-content-loader.h',
   'tepl-io-error-info-bar.h',
-  'tepl-metadata.h',
   'tepl-progress-info-bar.h',
   'tepl-signal-group.h',
   'tepl-tab-saving.h'
@@ -74,7 +69,6 @@ tepl_private_c_files = [
   'tepl-file-content.c',
   'tepl-file-content-loader.c',
   'tepl-io-error-info-bar.c',
-  'tepl-metadata.c',
   'tepl-progress-info-bar.c',
   'tepl-signal-group.c',
   'tepl-tab-saving.c'
diff --git a/tepl/tepl-init.c b/tepl/tepl-init.c
index 64d41da..578e060 100644
--- a/tepl/tepl-init.c
+++ b/tepl/tepl-init.c
@@ -21,7 +21,6 @@
 #include <amtk/amtk.h>
 #include <gtksourceview/gtksource.h>
 #include "tepl-abstract-factory.h"
-#include "tepl-metadata-store.h"
 
 /**
  * tepl_init:
@@ -75,7 +74,6 @@ tepl_finalize (void)
 
        if (!done)
        {
-               _tepl_metadata_store_unref_singleton ();
                _tepl_abstract_factory_unref_singleton ();
 
                /* Since Tepl depends on Amtk and GtkSourceView, it's better to
diff --git a/tepl/tepl.h b/tepl/tepl.h
index d9e59d0..1c15fbd 100644
--- a/tepl/tepl.h
+++ b/tepl/tepl.h
@@ -34,7 +34,6 @@
 #include <tepl/tepl-encoding.h>
 #include <tepl/tepl-file.h>
 #include <tepl/tepl-file-loader.h>
-#include <tepl/tepl-file-metadata.h>
 #include <tepl/tepl-file-saver.h>
 #include <tepl/tepl-fold-region.h>
 #include <tepl/tepl-gutter-renderer-folds.h>
@@ -43,7 +42,6 @@
 #include <tepl/tepl-io-error-info-bars.h>
 #include <tepl/tepl-iter.h>
 #include <tepl/tepl-menu-shell.h>
-#include <tepl/tepl-metadata-store.h>
 #include <tepl/tepl-notebook.h>
 #include <tepl/tepl-tab.h>
 #include <tepl/tepl-tab-group.h>
diff --git a/testsuite/meson.build b/testsuite/meson.build
index b978ee0..b3a1f63 100644
--- a/testsuite/meson.build
+++ b/testsuite/meson.build
@@ -5,11 +5,9 @@ unit_tests = [
   'test-file',
   'test-file-content',
   'test-file-loader',
-  'test-file-metadata',
   'test-file-saver',
   'test-fold-region',
   'test-info-bar',
-  'test-metadata-store',
   'test-notebook',
   'test-utils'
 ]


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