[totem-pl-parser/wip/hadess/bindings-fixes] plparser: Fix TotemPlParserMetadata in bindings




commit 8f25bd2a7b0ebaf2d8df02ee5ed0d4057ede1cf4
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 11 18:39:54 2022 +0100

    plparser: Fix TotemPlParserMetadata in bindings
    
    Remove TotemPlParserMetadata as a separate type. It will only be
    exposes in C, not in bindings.
    
    This fixes gjs warnings such as:
    (gjs:2781): Gjs-WARNING **: 21:48:14.325: JS ERROR: Error: No introspection information found for 
TotemPlParserMetadata
    
    Closes: #22

 plparse/totem-pl-parser.c | 25 ++-----------------------
 plparse/totem-pl-parser.h |  5 -----
 2 files changed, 2 insertions(+), 28 deletions(-)
---
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index cf8ef82..8a1c7b0 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -408,7 +408,7 @@ totem_pl_parser_class_init (TotemPlParserClass *klass)
                              G_STRUCT_OFFSET (TotemPlParserClass, entry_parsed),
                              NULL, NULL,
                              _totemplparser_marshal_VOID__STRING_BOXED,
-                             G_TYPE_NONE, 2, G_TYPE_STRING, TOTEM_TYPE_PL_PARSER_METADATA);
+                             G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_HASH_TABLE);
        /**
         * TotemPlParser::playlist-started:
         * @parser: the object which received the signal
@@ -428,7 +428,7 @@ totem_pl_parser_class_init (TotemPlParserClass *klass)
                              G_STRUCT_OFFSET (TotemPlParserClass, playlist_started),
                              NULL, NULL,
                              _totemplparser_marshal_VOID__STRING_BOXED,
-                             G_TYPE_NONE, 2, G_TYPE_STRING, TOTEM_TYPE_PL_PARSER_METADATA);
+                             G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_HASH_TABLE);
        /**
         * TotemPlParser::playlist-ended:
         * @parser: the object which received the signal
@@ -2775,24 +2775,3 @@ totem_pl_parser_can_parse_from_uri (const char *uri, gboolean debug)
 {
        return totem_pl_parser_is_videosite (uri, debug);
 }
-
-#ifndef TOTEM_PL_PARSER_MINI
-GType
-totem_pl_parser_metadata_get_type (void)
-{
-       static gsize g_define_type_id__volatile = 0;
-       if (g_once_init_enter (&g_define_type_id__volatile))
-       {
-               /* NOTE: This is equivalent to the definition for GHashTable in gboxed.c, in that it uses the 
same copy/free functions.
-                * This means that if we box a TotemPlParserMetadata inside a GValue, we can safely unbox it 
as a GHashTable (and vice-versa).
-                * This means we can hide TotemPlParserMetadata from introspection, and just pretend it's 
actually been a GHashTable all along. */
-               GType g_define_type_id = g_boxed_type_register_static (
-                   g_intern_static_string ("TotemPlParserMetadata"),
-                   (GBoxedCopyFunc) g_hash_table_ref,
-                   (GBoxedFreeFunc) g_hash_table_unref);
-               g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
-       }
-       return g_define_type_id__volatile;
-}
-#endif /* !TOTEM_PL_PARSER_MINI */
-
diff --git a/plparse/totem-pl-parser.h b/plparse/totem-pl-parser.h
index 7cee4d1..655feaf 100644
--- a/plparse/totem-pl-parser.h
+++ b/plparse/totem-pl-parser.h
@@ -427,11 +427,6 @@ TotemPlParser *totem_pl_parser_new (void);
  */
 typedef GHashTable TotemPlParserMetadata;
 
-GType totem_pl_parser_metadata_get_type (void) G_GNUC_CONST;
-#define TOTEM_TYPE_PL_PARSER_METADATA (totem_pl_parser_metadata_get_type())
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(TotemPlParserMetadata, g_hash_table_destroy)
-
 G_END_DECLS
 
 #endif /* TOTEM_PL_PARSER_H */


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