diff options
author | Charles Yin <charles.yin@nokia.com> | 2012-02-29 11:48:06 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-14 01:31:08 +0100 |
commit | 6b8c356401259675204126897a563cf020bd68f4 (patch) | |
tree | 4547d92e94c8660ff7c05dc06e62ba2340fc99f2 /examples/quick/canvas/twitterfriends/cache.js | |
parent | 665f860d9aaccd222c7fa8e309f087be35768022 (diff) |
Refactor canvas examples by following the new example guidelines.
Change-Id: I1cc749ad11b8439239ba739f40e99b78af7351ab
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'examples/quick/canvas/twitterfriends/cache.js')
-rw-r--r-- | examples/quick/canvas/twitterfriends/cache.js | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/examples/quick/canvas/twitterfriends/cache.js b/examples/quick/canvas/twitterfriends/cache.js deleted file mode 100644 index 6c8a1cd71a..0000000000 --- a/examples/quick/canvas/twitterfriends/cache.js +++ /dev/null @@ -1,42 +0,0 @@ -var UserCache = function() { - this._users = []; -} - - -UserCache.prototype.getById = function(id){ - for (var i=0; i < this._users.length; i++){ - var user = this._users[i]; - if (user.twitterId == id) { - return user; - } - } -} -UserCache.prototype.getByName = function(name){ - for (var i=0; i < this._users.length; i++){ - var user = this._users[i]; - if (user.name == name) - return user; - } -} - -UserCache.prototype.add = function(user){ - this._users[this._users.length] = user; -} - - -var cache = new UserCache; - -function getById(id) { - return cache.getById(id); -} - -function getByName(name) { - return cache.getByName(name); -} - -function createTwitterUser(canvas) { - var user = Qt.createQmlObject("import QtQuick 2.0; TwitterUser{}", canvas); - user.canvas = canvas; - cache.add(user); - return user; -} |