[rygel] ruih: Fix style issues in FilterEntry
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] ruih: Fix style issues in FilterEntry
- Date: Sat, 8 Nov 2014 12:25:28 +0000 (UTC)
commit fec47d8adb7d48282efbc26c5a8c741b13e3a945
Author: Jens Georg <mail jensge org>
Date: Sun Oct 19 15:18:55 2014 +0200
ruih: Fix style issues in FilterEntry
Signed-off-by: Jens Georg <mail jensge org>
src/librygel-ruih/rygel-ruih-filter-entry.vala | 21 +++++++++----------
.../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 3b14b34..4e3ee56 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 3b0aeaa..a6a54c0 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
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]