From kde-commits Sat Apr 09 20:04:37 2011 From: Marco Martin Date: Sat, 09 Apr 2011 20:04:37 +0000 To: kde-commits Subject: playground/base/plasma/declarative-applets/replacements/microblog/contents/ui Message-Id: <20110409200437.778EAAC8D1 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=130237952903099 SVN commit 1227508 by mart: split in subcomponents, easier for the device profiles A BasicComponents (directory) A BasicComponents/MessageWidget.qml MessageWidget.qml#1227501 [License: LGPL (v2+)] A BasicComponents/PostingWidget.qml PostingWidget.qml#1217044 [License: LGPL (v2+)] A BasicComponents/qmldir A ComplexComponents (directory) A ComplexComponents/MessageList.qml [License: LGPL (v2+)] A ComplexComponents/qmldir A MainWidget (directory) A MainWidget/MainWidget.qml [License: LGPL (v2+)] A MainWidget/qmldir D MessageWidget.qml D PostingWidget.qml M +8 -21 main.qml --- trunk/playground/base/plasma/declarative-applets/replacements/microblog/contents/ui/main.qml #1227507:1227508 @@ -22,6 +22,8 @@ import org.kde.plasma.components 0.1 as PlasmaComponents import org.kde.qtextracomponents 0.1 as QtExtraComponents +import "plasmapackage:/ui/MainWidget" + Item { id: main width: 200 @@ -38,6 +40,7 @@ Component.onCompleted: { plasmoid.addEventListener('ConfigChanged', configChanged); plasmoid.configurationRequired = true + configChanged() } function configChanged() @@ -50,8 +53,8 @@ return } - dataSource.connectedSources = ["TimelineWithFriends:"+userName+"@"+serviceUrl, "UserImages:"+serviceUrl] - var service = dataSource.serviceForSource(dataSource.connectedSources[0]) + microblogSource.connectedSources = ["TimelineWithFriends:"+userName+"@"+serviceUrl, "UserImages:"+serviceUrl] + var service = microblogSource.serviceForSource(microblogSource.connectedSources[0]) var operation = service.operationDescription("auth"); operation.password = plasmoid.readConfig("password") service.startOperationCall(operation); @@ -60,7 +63,7 @@ } PlasmaCore.DataSource { - id: dataSource + id: microblogSource engine: "microblog" interval: 50000 @@ -69,23 +72,7 @@ } } - /*MainWidget { - anchors.fill: parent - }*/ - - ListView { - id: entryList - anchors.fill: parent - clip: true - spacing: 5 - model: PlasmaCore.DataModel { - dataSource: dataSource - keyRoleFilter: "[\\d]*" + MainWidget { + anchors.fill: main } - header: PostingWidget {} - - delegate: MessageWidget { - width: entryList.width } - } -}