[rygel-gst-0-10-plugins] SqlFactory: More cleanup



commit bb9fd70998a5a481535e08af7256d4ed83ec4ce2
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Feb 1 13:54:16 2013 +0100

    SqlFactory: More cleanup

 src/media-export/rygel-media-export-sql-factory.c |   46 +--------------------
 src/media-export/rygel-media-export-sql-factory.h |    6 ---
 2 files changed, 2 insertions(+), 50 deletions(-)
---
diff --git a/src/media-export/rygel-media-export-sql-factory.c b/src/media-export/rygel-media-export-sql-factory.c
index 538ba7c..d90cb01 100644
--- a/src/media-export/rygel-media-export-sql-factory.c
+++ b/src/media-export/rygel-media-export-sql-factory.c
@@ -26,13 +26,6 @@
 
 G_DEFINE_TYPE (RygelMediaExportSQLFactory, rygel_media_export_sql_factory, G_TYPE_OBJECT)
 
-
-#define RYGEL_MEDIA_EXPORT_TYPE_DETAIL_COLUMN (rygel_media_export_detail_column_get_type ())
-
-#define RYGEL_MEDIA_EXPORT_TYPE_SQL_STRING (rygel_media_export_sql_string_get_type ())
-
-
-
 #define RYGEL_MEDIA_EXPORT_SQL_FACTORY_SAVE_META_DATA_STRING \
   "INSERT OR REPLACE INTO meta_data " \
   "(size, mime_type, width, height, class, " \
@@ -218,39 +211,10 @@ G_DEFINE_TYPE (RygelMediaExportSQLFactory, rygel_media_export_sql_factory, G_TYP
 #define RYGEL_MEDIA_EXPORT_SQL_FACTORY_STATISTICS_STRING \
   "SELECT class, count(1) FROM meta_data GROUP BY class"
 
-const gchar *rygel_media_export_sql_factory_make (RygelMediaExportSQLFactory *self, RygelMediaExportSQLString query);
-
 RygelMediaExportSQLFactory *rygel_media_export_sql_factory_construct (GType object_type);
 
-
-GType rygel_media_export_detail_column_get_type (void) {
-  static volatile gsize rygel_media_export_detail_column_type_id__volatile = 0;
-  if (g_once_init_enter (&rygel_media_export_detail_column_type_id__volatile)) {
-    static const GEnumValue values[] = {{RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TYPE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TYPE", "type"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TITLE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TITLE", "title"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SIZE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SIZE", "size"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_MIME_TYPE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_MIME_TYPE", "mime-type"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_WIDTH, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_WIDTH", "width"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_HEIGHT, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_HEIGHT", "height"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CLASS, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CLASS", "class"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_AUTHOR, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_AUTHOR", "author"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ALBUM, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ALBUM", "album"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DATE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DATE", "date"}, {RYGEL_MED
 IA_EXPORT_DETAIL_COLUMN_BITRATE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITRATE", "bitrate"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SAMPLE_FREQ, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_SAMPLE_FREQ", "sample-freq"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITS_PER_SAMPLE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_BITS_PER_SAMPLE", "bits-per-sample"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CHANNELS, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_CHANNELS", "channels"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TRACK, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TRACK", "track"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_COLOR_DEPTH, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_COLOR_DEPTH", "color-depth"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DURATION, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DURATION", "duration"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ID, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_ID", "id"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_PARENT, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_PARENT", "parent"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_TIMESTAMP, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN
 _TIMESTAMP", "timestamp"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_URI, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_URI", "uri"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DLNA_PROFILE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DLNA_PROFILE", "dlna-profile"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_GENRE, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_GENRE", "genre"}, {RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DISC, "RYGEL_MEDIA_EXPORT_DETAIL_COLUMN_DISC", "disc"}, {0, NULL, NULL}};
-    GType rygel_media_export_detail_column_type_id;
-    rygel_media_export_detail_column_type_id = g_enum_register_static ("RygelMediaExportDetailColumn", values);
-    g_once_init_leave (&rygel_media_export_detail_column_type_id__volatile, rygel_media_export_detail_column_type_id);
-  }
-  return rygel_media_export_detail_column_type_id__volatile;
-}
-
-
-GType rygel_media_export_sql_string_get_type (void) {
-  static volatile gsize rygel_media_export_sql_string_type_id__volatile = 0;
-  if (g_once_init_enter (&rygel_media_export_sql_string_type_id__volatile)) {
-    static const GEnumValue values[] = {{RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA, "RYGEL_MEDIA_EXPORT_SQL_STRING_SAVE_METADATA", "save-metadata"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT, "RYGEL_MEDIA_EXPORT_SQL_STRING_INSERT", "insert"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE, "RYGEL_MEDIA_EXPORT_SQL_STRING_DELETE", "delete"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT", "get-object"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_CHILDREN", "get-children"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER", "get-objects-by-filter"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECTS_BY_FILTER_WITH_ANCESTOR", "get-objects-by-filter-with-ancestor"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER", "get-object-count
 -by-filter"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_OBJECT_COUNT_BY_FILTER_WITH_ANCESTOR", "get-object-count-by-filter-with-ancestor"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN, "RYGEL_MEDIA_EXPORT_SQL_STRING_GET_META_DATA_COLUMN", "get-meta-data-column"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT, "RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_COUNT", "child-count"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS, "RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS", "exists"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS, "RYGEL_MEDIA_EXPORT_SQL_STRING_CHILD_IDS", "child-ids"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA, "RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_METADATA", "table-metadata"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE, "RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE", "table-closure"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE, "RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_CLOSURE", "trigger-closure"}, {RYGEL_MEDIA_EX
 PORT_SQL_STRING_TRIGGER_COMMON, "RYGEL_MEDIA_EXPORT_SQL_STRING_TRIGGER_COMMON", "trigger-common"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON, "RYGEL_MEDIA_EXPORT_SQL_STRING_INDEX_COMMON", "index-common"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA, "RYGEL_MEDIA_EXPORT_SQL_STRING_SCHEMA", "schema"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE, "RYGEL_MEDIA_EXPORT_SQL_STRING_EXISTS_CACHE", "exists-cache"}, {RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS, "RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS", "statistics"}, {0, NULL, NULL}};
-    GType rygel_media_export_sql_string_type_id;
-    rygel_media_export_sql_string_type_id = g_enum_register_static ("RygelMediaExportSQLString", values);
-    g_once_init_leave (&rygel_media_export_sql_string_type_id__volatile, rygel_media_export_sql_string_type_id);
-  }
-  return rygel_media_export_sql_string_type_id__volatile;
-}
-
-
 const gchar*
 rygel_media_export_sql_factory_make (RygelMediaExportSQLFactory *self, RygelMediaExportSQLString query) {
-  const gchar *result = NULL;
-
   g_return_val_if_fail (self, NULL);
 
   switch (query) {
@@ -332,8 +296,7 @@ rygel_media_export_sql_factory_make (RygelMediaExportSQLFactory *self, RygelMedi
     }
     case RYGEL_MEDIA_EXPORT_SQL_STRING_TABLE_CLOSURE:
     {
-      result = RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TABLE;
-      return result;
+      return RYGEL_MEDIA_EXPORT_SQL_FACTORY_CREATE_CLOSURE_TABLE;
     }
     case RYGEL_MEDIA_EXPORT_SQL_STRING_STATISTICS:
     {
@@ -347,13 +310,8 @@ rygel_media_export_sql_factory_make (RygelMediaExportSQLFactory *self, RygelMedi
 }
 
 RygelMediaExportSQLFactory*
-rygel_media_export_sql_factory_construct (GType object_type) {
-  return RYGEL_MEDIA_EXPORT_SQL_FACTORY (g_object_new (object_type, NULL));
-}
-
-RygelMediaExportSQLFactory*
 rygel_media_export_sql_factory_new (void) {
-  return rygel_media_export_sql_factory_construct (RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY);
+  RYGEL_MEDIA_EXPORT_SQL_FACTORY (g_object_new (RYGEL_MEDIA_EXPORT_TYPE_SQL_FACTORY, NULL));  
 }
 
 static void
diff --git a/src/media-export/rygel-media-export-sql-factory.h b/src/media-export/rygel-media-export-sql-factory.h
index 6e2779e..ffbe868 100644
--- a/src/media-export/rygel-media-export-sql-factory.h
+++ b/src/media-export/rygel-media-export-sql-factory.h
@@ -101,12 +101,6 @@ typedef enum  {
 } RygelMediaExportSQLString;
 
 GType
-rygel_media_export_detail_column_get_type (void) G_GNUC_CONST;
-
-GType
-rygel_media_export_sql_string_get_type (void) G_GNUC_CONST;
-
-GType
 rygel_media_export_sql_factory_get_type (void) G_GNUC_CONST;
 
 RygelMediaExportSQLFactory *



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