From e257e533446bde7ca9ba9ba108a8b78fc52d58d2 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Thu, 18 Apr 2019 10:43:52 +0200 Subject: Update the mediaplayer example Added a 'Refresh' button to reload the content of the library. This is useful when a new USB devices is atttached. Also better handle the removal of a USB device and reset the File browser view. Change-Id: Iab16e213f9022f63ebdfacd087a8eb92a2080b9b Reviewed-by: Robert Griebl --- examples/ivimedia/mediaplayer/main.qml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples') diff --git a/examples/ivimedia/mediaplayer/main.qml b/examples/ivimedia/mediaplayer/main.qml index 7977ea6..91ccc3e 100644 --- a/examples/ivimedia/mediaplayer/main.qml +++ b/examples/ivimedia/mediaplayer/main.qml @@ -186,6 +186,7 @@ ApplicationWindow { RowLayout { Label { text: "filter:" } TextField { id: filterEdit } + Button { text: "Refresh"; onClicked: searchModel.reload(); } } ListView { @@ -281,6 +282,11 @@ ApplicationWindow { model: MediaDeviceDiscoveryModel { id: discoveryModel + + onDeviceRemoved: { + if (device === filterModel.serviceObject) + browseView.model = discoveryModel + } } SearchAndBrowseModel { -- cgit v1.2.1