diff options
author | Jens Georg <mail@jensge.org> | 2014-10-19 15:18:55 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2014-11-08 13:20:55 +0100 |
commit | fec47d8adb7d48282efbc26c5a8c741b13e3a945 (patch) | |
tree | 8fc22b95834f0ce6a272e3835aaeec2c2cd292ba /src/librygel-ruih | |
parent | d3df7943aba6c10279096d10e0ba98a969fdc620 (diff) | |
download | rygel-fec47d8adb7d48282efbc26c5a8c741b13e3a945.tar.gz |
ruih: Fix style issues in FilterEntry
Signed-off-by: Jens Georg <mail@jensge.org>
Diffstat (limited to 'src/librygel-ruih')
-rw-r--r-- | src/librygel-ruih/rygel-ruih-filter-entry.vala | 21 | ||||
-rw-r--r-- | src/librygel-ruih/rygel-ruih-wildcard-filter-entry.vala | 4 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/librygel-ruih/rygel-ruih-filter-entry.vala b/src/librygel-ruih/rygel-ruih-filter-entry.vala index 3b14b34c..4e3ee566 100644 --- a/src/librygel-ruih/rygel-ruih-filter-entry.vala +++ b/src/librygel-ruih/rygel-ruih-filter-entry.vala @@ -29,11 +29,11 @@ protected class FilterEntry { private static const string LIFETIME = "lifetime"; - string entry_name = null; - string entry_value = null; + private string entry_name = null; + private string entry_value = null; public FilterEntry (string name, string value) { - string temp = name; + var temp = name; // Get rid of extra " in name temp = temp.replace ("\"", ""); entry_name = temp; @@ -49,8 +49,8 @@ protected class FilterEntry { entry_value = temp; } - public bool matches (string name, string value) { - if (entry_name == null && entry_value == null) { + public virtual bool matches (string name, string value) { + if (this.entry_name == null && this.entry_value == null) { return false; } @@ -58,17 +58,16 @@ protected class FilterEntry { if (entry_value != null) { if (entry_name == LIFETIME) { // Lifetime value can be negative as well. - if (int.parse (entry_value) == int.parse (value)) { - return true; - } else { - return false; - } + return int.parse (entry_value) == int.parse (value); } + var result = Regex.match_simple (entry_value, value, RegexCompileFlags.CASELESS); + return result; } } + return false; } -}
\ No newline at end of file +} diff --git a/src/librygel-ruih/rygel-ruih-wildcard-filter-entry.vala b/src/librygel-ruih/rygel-ruih-wildcard-filter-entry.vala index 3b0aeaa3..a6a54c00 100644 --- a/src/librygel-ruih/rygel-ruih-wildcard-filter-entry.vala +++ b/src/librygel-ruih/rygel-ruih-wildcard-filter-entry.vala @@ -31,7 +31,7 @@ protected class WildCardFilterEntry : FilterEntry { base ("*","*"); } - public new bool matches (string name, string value) { + public override bool matches (string name, string value) { return true; } -}
\ No newline at end of file +} |