import Qt 4.7 import com.nokia.meego 1.0 Item { property string catid : parent.catid property bool inEditMode: false width: parent.width; height: parent.height; signal feedClicked(string feedid) function reload() { feeds.xml = catid == "" ? "" : controller.getFeedsXml(catid); //feeds.reload() //console.log(feeds.xml) } //Component.onCompleted: { console.log(catid + "/" + parent.catid); console.log(feeds.xml) } //onCatidChanged: console.log("catid changed: "+catid) ListView { id: feedList; model: feeds; delegate: feedDelegate; z: 6 width: parent.width; height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height; /*x: 0;*/ cacheBuffer: 100; flickDeceleration: 1500 clip: true } ProgressBar { id: updateBarFeeds minimumValue: 0 maximumValue: 100 value: window.updateProgressValue visible: window.isUpdateInProgress anchors.bottom: parent.bottom z: 8 width: parent.width } XmlListModel { id: feeds //source: catid == "" ? "" : "http://localhost:8000/feeds/" + catid //+ "?onlyUnread=" + parent.hideReadArticles xml: catid == "" ? "" : controller.getFeedsXml(catid) query: "/xml/feed" XmlRole { name: "title"; query: "feedname/string()" } XmlRole { name: "feedid"; query: "feedid/string()"; isKey: true } XmlRole { name: "unread"; query: "unread/string()"; isKey: true } XmlRole { name: "updatedDate"; query: "updatedDate/string()" } XmlRole { name: "icon"; query: "icon/string()" } XmlRole { name: "updating"; query: "updating/string()"; isKey: true } //XmlRole { name: "url"; query: "url/string()"; } } Component { id: feedDelegate Item { //Component.onCompleted: console.log("item:"+feedid + " "+ visible + " "+ height + " " + width) id: wrapper; //width: wrapper.ListView.view.width; visible: (unread == "0" && settings.hideReadFeeds) ? false : true //visible: true height: (visible) ? 86 : 0 width: parent.width Item { id: moveMe Rectangle { color: settings.backColour; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: wrapper.width; y: 1 } Rectangle { x: 3; y: 4; width: 77; height: 77; color: "#000000"; smooth: true Image { width:32; height: 32; anchors.verticalCenter: parent.verticalCenter; anchors.horizontalCenter: parent.horizontalCenter; source: (icon == "False") ? "common/images/feedingit.png" : icon // (updating=="True")? "common/images/loading.png" : (icon == "False") ? "common/images/feedingit.png" : icon; // NumberAnimation on rotation { // from: 0; to: 360; running: (updating=="True"); loops: Animation.Infinite; duration: 900 // } } } Column { x: 92; width: wrapper.ListView.view.width - 95; y: 5; spacing: 2 Text { text: title; color: settings.mainTextColour; width: parent.width; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: settings.mainShadowColour; font.pointSize: settings.mainTextSize } Text { text: updatedDate + " / " + qsTr("%1 unread items").arg(unread); color: (unread=="0") ? settings.mainTextColour : settings.secondaryTextColour; width: parent.width; font.bold: false; elide: Text.ElideRight; //style: Text.Raised; styleColor: settings.mainShadowColour; font.pointSize: settings.secondaryTextSize } //Text { text: feedname; width: parent.width; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" } } //// Item { //// x: wrapper.ListView.view.width - 128; y: 12 //// height: 58; width: 58; //// //anchors.horizontalCenter: parent.horizontalCenter; //// Image { source: "common/images/wmEditIcon.png" } //// MouseArea { //// anchors.fill: parent; onClicked: { container.feedEdit(feedname, feedid, url); } //// } //// visible: inEditMode //// } // Item { // x: wrapper.ListView.view.width - 64; y: 12 // height: 58; width: 58; // //anchors.horizontalCenter: parent.horizontalCenter; // Image { source: "common/images/delete.png" } // MouseArea { // anchors.fill: parent; onClicked: { container.feedDeleted(feedid); } // } // visible: inEditMode // } } MouseArea { anchors.fill: wrapper; onClicked: { //controller.feedClicked(model.feed) feedClicked(feedid) } onPressAndHold: { window.longPressFeed(feedid) } } } } }