summaryrefslogtreecommitdiffstats
path: root/demos/declarative/twitter/content/UserModel.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/twitter/content/UserModel.qml')
-rw-r--r--demos/declarative/twitter/content/UserModel.qml26
1 files changed, 26 insertions, 0 deletions
diff --git a/demos/declarative/twitter/content/UserModel.qml b/demos/declarative/twitter/content/UserModel.qml
new file mode 100644
index 0000000..c146b84
--- /dev/null
+++ b/demos/declarative/twitter/content/UserModel.qml
@@ -0,0 +1,26 @@
+import Qt 4.6
+
+//This "model" gets the user information about the searched user. Mainly for the icon.
+//Copied from RssModel
+
+Item { id: wrapper
+ property var model: xmlModel
+ property string user : ""
+ property int status: xmlModel.status
+ function reload() { xmlModel.reload(); }
+XmlListModel {
+ id: xmlModel
+
+ source: {if(user!="") {"http://twitter.com/users/show.xml?screen_name="+user;}else{"";}}
+ query: "/user"
+
+ XmlRole { name: "name"; query: "name/string()" }
+ XmlRole { name: "screenName"; query: "screen_name/string()" }
+ XmlRole { name: "image"; query: "profile_image_url/string()" }
+ XmlRole { name: "location"; query: "location/string()" }
+ XmlRole { name: "description"; query: "description/string()" }
+ XmlRole { name: "followers"; query: "followers_count/string()" }
+ //XmlRole { name: "protected"; query: "protected/bool()" }
+ //TODO: Could also get the user's color scheme, timezone and a few other things
+}
+}