summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-06-29 19:45:11 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-06-29 20:03:36 -0700
commit52808e4ca68eeabaccbdef4566e1ecf9bf4c9db3 (patch)
treee8ce5659138a532bdbe8602a686719ef1a4ddab1
parent04ae48a26ece6b6e21010f3d187f173837f99c23 (diff)
mediaplayer: qml: switch to libqtappfw Qt model generationflounder_5.99.2flounder/5.99.25.99.2
Remove playlist creation logic out of QML and use a Qt model generated from libqtappfw Bug-AGL: SPEC-1430 Change-Id: I716de188fce85d824c0bf519964e0b58b9ed8f3f Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--app/MediaPlayer.qml22
-rw-r--r--app/main.cpp2
2 files changed, 3 insertions, 21 deletions
diff --git a/app/MediaPlayer.qml b/app/MediaPlayer.qml
index 7dfaf06..99ed3ea 100644
--- a/app/MediaPlayer.qml
+++ b/app/MediaPlayer.qml
@@ -133,20 +133,6 @@ ApplicationWindow {
Connections {
target: mediaplayer
- onPlaylistChanged: {
- playlist_model.clear();
-
- for (var i = 0; i < playlist.list.length; i++) {
- var item = playlist.list[i]
-
- playlist_model.append({ "index": item.index, "artist": item.artist ? item.artist : '', "title": item.title ? item.title : '' })
-
- if (item.selected) {
- playlistview.currentIndex = i
- }
- }
- }
-
onMetadataChanged: {
player.title = metadata.title
player.album = metadata.album
@@ -182,10 +168,6 @@ ApplicationWindow {
}
}
- ListModel {
- id: playlist_model
- }
-
ColumnLayout {
anchors.fill: parent
Item {
@@ -392,7 +374,7 @@ ApplicationWindow {
text: 'PLAYLIST'
opacity: 0.5
}
- model: playlist_model
+ model: MediaplayerModel
currentIndex: -1
delegate: MouseArea {
@@ -423,7 +405,7 @@ ApplicationWindow {
//}
}
onClicked: {
- mediaplayer.picktrack(playlistview.model.get(index).index)
+ mediaplayer.picktrack(playlistview.model[index].index)
}
}
diff --git a/app/main.cpp b/app/main.cpp
index 4713fdb..67bbab4 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
}
});
- context->setContextProperty("mediaplayer", new Mediaplayer(bindingAddress));
+ context->setContextProperty("mediaplayer", new Mediaplayer(bindingAddress, context));
context->setContextProperty("bluetooth_connection", new Bluetooth(bindingAddress));
usleep(300000);