[rygel] Make all const members upper case



commit 4ee285ce76cdbf5fa737809bc15722b64553fa78
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Oct 25 10:12:04 2012 +0200

    Make all const members upper case

 src/librygel-server/rygel-media-art-store.vala     |   16 ++++++++--------
 .../rygel-search-criteria-parser.vala              |    4 ++--
 .../gstreamer/rygel-gst-transcoder.vala            |    4 ++--
 .../rygel-media-export-media-cache-upgrader.vala   |    4 ++--
 .../rygel-media-export-media-cache.vala            |    4 ++--
 .../rygel-media-export-root-container.vala         |    8 ++++----
 .../rygel-media-export-sql-factory.vala            |    4 ++--
 .../mediathek/rygel-mediathek-rss-container.vala   |    4 ++--
 src/rygel/rygel-cmdline-config.vala                |    4 ++--
 9 files changed, 26 insertions(+), 26 deletions(-)
---
diff --git a/src/librygel-server/rygel-media-art-store.vala b/src/librygel-server/rygel-media-art-store.vala
index a1065b6..5160760 100644
--- a/src/librygel-server/rygel-media-art-store.vala
+++ b/src/librygel-server/rygel-media-art-store.vala
@@ -33,10 +33,10 @@ internal errordomain MediaArtStoreError {
  */
 public class Rygel.MediaArtStore : GLib.Object {
     private const string PLACEHOLDER_HASH = "7215ee9c7d9dc229d2921a40e899ec5f";
-    private const string invalid_chars = "()[]<>{}_! #$^&*+=|\\/\"'?~";
-    private const string convert_chars = "\t";
-    private const string block_pattern = "%s[^%s]*%s";
-    private const string[] blocks = { "()", "{}", "[]", "<>" };
+    private const string INVALID_CHARS = "()[]<>{}_! #$^&*+=|\\/\"'?~";
+    private const string CONVERT_CHARS = "\t";
+    private const string BLOCK_PATTERN = "%s[^%s]*%s";
+    private const string[] BLOCKS = { "()", "{}", "[]", "<>" };
     private static MediaArtStore media_art_store;
     private static bool first_time = true;
     private Regex char_remove_regex;
@@ -133,15 +133,15 @@ public class Rygel.MediaArtStore : GLib.Object {
 
         this.directory = dir;
         try {
-            var regex_string = Regex.escape_string (invalid_chars);
+            var regex_string = Regex.escape_string (INVALID_CHARS);
             char_remove_regex = new Regex ("[%s]".printf (regex_string));
-            regex_string = Regex.escape_string (convert_chars);
+            regex_string = Regex.escape_string (CONVERT_CHARS);
             char_convert_regex = new Regex ("[%s]".printf (regex_string));
             space_compress_regex = new Regex ("\\s+");
             block_regexes = new Regex[0];
 
-            foreach (var block in blocks) {
-                var block_re = block_pattern.printf (
+            foreach (var block in BLOCKS) {
+                var block_re = BLOCK_PATTERN.printf (
                                   Regex.escape_string ("%C".printf (block[0])),
                                   Regex.escape_string ("%C".printf (block[1])),
                                   Regex.escape_string ("%C".printf (block[1])));
diff --git a/src/librygel-server/rygel-search-criteria-parser.vala b/src/librygel-server/rygel-search-criteria-parser.vala
index 99d1f8f..17f62ff 100644
--- a/src/librygel-server/rygel-search-criteria-parser.vala
+++ b/src/librygel-server/rygel-search-criteria-parser.vala
@@ -77,7 +77,7 @@ internal class Rygel.SearchCriteriaParser : Object, StateMachine {
 
     private Scanner scanner;
 
-    private const SearchCriteriaToken[] tokens = {
+    private const SearchCriteriaToken[] TOKENS = {
         { "=",              SearchCriteriaSymbol.EQ },
         { "!=",             SearchCriteriaSymbol.NEQ },
         { "<",              SearchCriteriaSymbol.LESS },
@@ -111,7 +111,7 @@ internal class Rygel.SearchCriteriaParser : Object, StateMachine {
                                                CharacterSet.LATINC;
         scanner.config.symbol_2_token        = true;
 
-        foreach (var token in tokens) {
+        foreach (var token in TOKENS) {
             scanner.scope_add_symbol (0,
                                       token.str_symbol,
                                       ((int) token.symbol).to_pointer ());
diff --git a/src/media-engines/gstreamer/rygel-gst-transcoder.vala b/src/media-engines/gstreamer/rygel-gst-transcoder.vala
index 73e68b5..1faea72 100644
--- a/src/media-engines/gstreamer/rygel-gst-transcoder.vala
+++ b/src/media-engines/gstreamer/rygel-gst-transcoder.vala
@@ -144,7 +144,7 @@ internal abstract class Rygel.GstTranscoder : Rygel.Transcoder {
         return;
     }
 
-    private const string description = "Encoder and decoder are not " +
+    private const string DESCRIPTION = "Encoder and decoder are not " +
                                        "compatible";
 
     private void on_no_more_pads (Element decodebin) {
@@ -155,7 +155,7 @@ internal abstract class Rygel.GstTranscoder : Rygel.Transcoder {
             var error = new IOError.FAILED ("Could not link");
             var message = new Message.error (bin,
                                              error,
-                                             description);
+                                             DESCRIPTION);
 
 
             var bus = bin.get_bus ();
diff --git a/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala b/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
index a1690bd..c1f540e 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache-upgrader.vala
@@ -44,7 +44,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
         current_version = this.database.query_value (
                                         "SELECT version FROM schema_info");
 
-        return current_version < int.parse (SQLFactory.schema_version);
+        return current_version < int.parse (SQLFactory.SCHEMA_VERSION);
     }
 
     public void fix_schema () throws Error {
@@ -82,7 +82,7 @@ internal class Rygel.MediaExport.MediaCacheUpgrader {
 
     public void upgrade (int old_version) {
         debug ("Older schema detected. Upgrading...");
-        int current_version = int.parse (SQLFactory.schema_version);
+        int current_version = int.parse (SQLFactory.SCHEMA_VERSION);
         while (old_version < current_version) {
             if (this.database != null) {
                 switch (old_version) {
diff --git a/src/plugins/media-export/rygel-media-export-media-cache.vala b/src/plugins/media-export/rygel-media-export-media-cache.vala
index d55c9ae..19c2674 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -448,7 +448,7 @@ public class Rygel.MediaExport.MediaCache : Object {
     private void open_db (string name) throws Error {
         this.db = new Database (name);
         int old_version = -1;
-        int current_version = int.parse (SQLFactory.schema_version);
+        int current_version = int.parse (SQLFactory.SCHEMA_VERSION);
 
         try {
             var upgrader = new MediaCacheUpgrader (this.db, this.sql);
@@ -475,7 +475,7 @@ public class Rygel.MediaExport.MediaCache : Object {
                                                 "sqlite_master WHERE rowid=1");
                 if (rows == 0) {
                     debug ("Empty database, creating new schema version %s",
-                            SQLFactory.schema_version);
+                            SQLFactory.SCHEMA_VERSION);
                     if (!create_schema ()) {
                         this.db = null;
 
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index 235d3e7..7362d13 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -26,12 +26,12 @@ internal struct Rygel.MediaExport.FolderDefinition {
     string definition;
 }
 
-const Rygel.MediaExport.FolderDefinition[] virtual_folders_default = {
+const Rygel.MediaExport.FolderDefinition[] VIRTUAL_FOLDERS_DEFAULT = {
     { N_("Year"), "dc:date,?" },
     { N_("All"),  "" }
 };
 
-const Rygel.MediaExport.FolderDefinition[] virtual_folders_music = {
+const Rygel.MediaExport.FolderDefinition[] VIRTUAL_FOLDERS_MUSIC = {
     { N_("Artist"), "upnp:artist,?,upnp:album,?" },
     { N_("Album"),  "upnp:album,?" },
     { N_("Genre"),  "dc:genre,?" }
@@ -421,7 +421,7 @@ public class Rygel.MediaExport.RootContainer : Rygel.MediaExport.DBContainer {
         try {
             this.add_virtual_containers_for_class (_("Music"),
                                                    Rygel.MusicItem.UPNP_CLASS,
-                                                   virtual_folders_music);
+                                                   VIRTUAL_FOLDERS_MUSIC);
             this.add_virtual_containers_for_class (_("Pictures"),
                                                    PhotoItem.UPNP_CLASS);
             this.add_virtual_containers_for_class (_("Videos"),
@@ -465,7 +465,7 @@ public class Rygel.MediaExport.RootContainer : Rygel.MediaExport.DBContainer {
         container.id = "virtual-parent:" + item_class;
         this.media_db.save_container (container);
 
-        foreach (var definition in virtual_folders_default) {
+        foreach (var definition in VIRTUAL_FOLDERS_DEFAULT) {
             this.add_folder_definition (container, item_class, definition);
         }
 
diff --git a/src/plugins/media-export/rygel-media-export-sql-factory.vala b/src/plugins/media-export/rygel-media-export-sql-factory.vala
index 02f9e63..a7a7b08 100644
--- a/src/plugins/media-export/rygel-media-export-sql-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-sql-factory.vala
@@ -161,7 +161,7 @@ internal class Rygel.MediaExport.SQLFactory : Object {
         "WHERE _column IS NOT NULL %s ORDER BY _column COLLATE CASEFOLD " +
     "LIMIT ?,?";
 
-    internal const string schema_version = "11";
+    internal const string SCHEMA_VERSION = "11";
     internal const string CREATE_META_DATA_TABLE_STRING =
     "CREATE TABLE meta_data (size INTEGER NOT NULL, " +
                             "mime_type TEXT NOT NULL, " +
@@ -197,7 +197,7 @@ internal class Rygel.MediaExport.SQLFactory : Object {
                           "uri TEXT, " +
                           "flags TEXT);" +
     "INSERT INTO schema_info (version) VALUES ('" +
-    SQLFactory.schema_version + "'); ";
+    SQLFactory.SCHEMA_VERSION + "'); ";
 
     private const string CREATE_CLOSURE_TABLE =
     "CREATE TABLE closure (ancestor TEXT, descendant TEXT, depth INTEGER)";
diff --git a/src/plugins/mediathek/rygel-mediathek-rss-container.vala b/src/plugins/mediathek/rygel-mediathek-rss-container.vala
index ff9905a..b546b4f 100644
--- a/src/plugins/mediathek/rygel-mediathek-rss-container.vala
+++ b/src/plugins/mediathek/rygel-mediathek-rss-container.vala
@@ -25,7 +25,7 @@ using Soup;
 using Xml;
 
 public class Rygel.Mediathek.RssContainer : Rygel.SimpleContainer {
-    private const string uri_template = "http://www.zdf.de/ZDFmediathek/"; +
+    private const string URI_TEMPLATE = "http://www.zdf.de/ZDFmediathek/"; +
                                         "content/%u?view=rss";
     private uint content_id;
     private Soup.Date last_modified = null;
@@ -37,7 +37,7 @@ public class Rygel.Mediathek.RssContainer : Rygel.SimpleContainer {
               "ZDF Mediathek RSS feed %u".printf (id));
 
         this.content_id = id;
-        this.feed_uri = uri_template.printf (id);
+        this.feed_uri = URI_TEMPLATE.printf (id);
         this.sort_criteria = "-dc:date,+dc:title";
         this.update.begin ();
     }
diff --git a/src/rygel/rygel-cmdline-config.vala b/src/rygel/rygel-cmdline-config.vala
index 461ab53..94b2a86 100644
--- a/src/rygel/rygel-cmdline-config.vala
+++ b/src/rygel/rygel-cmdline-config.vala
@@ -66,7 +66,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration {
     private static CmdlineConfig config;
 
     // Command-line options
-	const OptionEntry[] options = {
+	const OptionEntry[] OPTIONS = {
         { "version", 0, 0, OptionArg.NONE, ref version,
           "Display version number", null },
         { "network-interface", 'n', 0, OptionArg.STRING, ref iface,
@@ -119,7 +119,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration {
         var opt_context = new OptionContext (parameter_string);
         opt_context.set_help_enabled (true);
         opt_context.set_ignore_unknown_options (true);
-        opt_context.add_main_entries (options, null);
+        opt_context.add_main_entries (OPTIONS, null);
 
         try {
             opt_context.parse (ref args);



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