SVN commit 1227501 by mart: only one datasource M +1 -1 MessageWidget.qml M +11 -11 main.qml --- trunk/playground/base/plasma/declarative-applets/replacements/microblog/contents/ui/MessageWidget.qml #1227500:1227501 @@ -33,7 +33,7 @@ anchors.top: padding.top width: 32 height: 32 - image: imagesDataSource.data["UserImages:"+serviceUrl][model['User']] + image: dataSource.data["UserImages:"+serviceUrl][model['User']] } Text { id: infoLabel --- trunk/playground/base/plasma/declarative-applets/replacements/microblog/contents/ui/main.qml #1227500:1227501 @@ -46,9 +46,12 @@ userName = plasmoid.readConfig("userName") password = plasmoid.readConfig("password") - messagesDataSource.connectedSources = ["TimelineWithFriends:"+userName+"@"+serviceUrl] - imagesDataSource.connectedSources = ["UserImages:"+serviceUrl] - var service = messagesDataSource.serviceForSource(messagesDataSource.connectedSources[0]) + if (!serviceUrl || !userName || !password) { + return + } + + dataSource.connectedSources = ["TimelineWithFriends:"+userName+"@"+serviceUrl, "UserImages:"+serviceUrl] + var service = dataSource.serviceForSource(dataSource.connectedSources[0]) var operation = service.operationDescription("auth"); operation.password = plasmoid.readConfig("password") service.startOperationCall(operation); @@ -57,7 +60,7 @@ } PlasmaCore.DataSource { - id: messagesDataSource + id: dataSource engine: "microblog" interval: 50000 @@ -66,12 +69,9 @@ } } - //Split images and messages: even if a datasource can take multiple sources, their data must have the same keys - PlasmaCore.DataSource { - id: imagesDataSource - engine: "microblog" - interval: 5000 - } + /*MainWidget { + anchors.fill: parent + }*/ ListView { id: entryList @@ -79,7 +79,7 @@ clip: true spacing: 5 model: PlasmaCore.DataModel { - dataSource: messagesDataSource + dataSource: dataSource keyRoleFilter: "[\\d]*" } header: PostingWidget {}