summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarcin Kazmierczak <marcin.kazmierczak@live.com>2012-02-22 15:03:12 +0100
committerJens Georg <jensg@openismus.com>2013-04-08 16:32:52 +0200
commitf31503fc774c665a77b24efed3cb5c7c8b332064 (patch)
tree2b92564424519eae4b27ea8f23171a91715862d2 /tests
parentc9c0a38f09eaf9933d3450b64ede387d4929845b (diff)
downloadrygel-f31503fc774c665a77b24efed3cb5c7c8b332064.tar.gz
core,tracker: Fix upload of files
core: MediaContainer: Add empty children counter. Add check_search_expression function, which set create_mode on true, when "upnp:createClass" operand was detected. SearchableContainer: Use check_search_expression in simple_search function to determine child counter. SimpleContainer: Use check_search_expression to search both in empty and non-empty children, during adding new item. tests: searchable-container-test: Add children counter to MediaContainer class. Add empty function check_search_expression in class MediaContainer. Previously it was impossible to add new item, when matched container was empty. For example user can't add picture, when don't have any picture. Now it's possible, because now search function return also empty children container, when search expression contains "upnp:createClass" operand. This works when HttpPost was used to upload file. https://bugzilla.gnome.org/show_bug.cgi?id=660885
Diffstat (limited to 'tests')
-rw-r--r--tests/rygel-searchable-container-test.vala8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/rygel-searchable-container-test.vala b/tests/rygel-searchable-container-test.vala
index 99ba4cba..39a723da 100644
--- a/tests/rygel-searchable-container-test.vala
+++ b/tests/rygel-searchable-container-test.vala
@@ -42,7 +42,11 @@ public class MediaObject : Object {
public class MediaContainer : MediaObject {
public string sort_criteria = "+dc:title";
- public uint child_count = 10;
+ public int child_count = 10;
+ public bool create_mode_enabled = false;
+ public int all_child_count {
+ get { return this.child_count; }
+ }
public async MediaObjects? get_children (
uint offset,
uint max_count,
@@ -59,6 +63,8 @@ public class MediaContainer : MediaObject {
return result;
}
+
+ internal void check_search_expression (SearchExpression? expression) {}
}
public class TestContainer : MediaContainer, Rygel.SearchableContainer {