[Android] Remove sort restoration in browsers

Geoffrey Métais git at videolan.org
Fri Apr 6 17:04:41 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Apr  6 17:04:21 2018 +0200| [817e583de20ef9a54d235cd7f000091cecdaf9b6] | committer: Geoffrey Métais

Remove sort restoration in browsers

> https://code.videolan.org/videolan/vlc-android/commit/817e583de20ef9a54d235cd7f000091cecdaf9b6
---

 vlc-android/src/org/videolan/vlc/viewmodels/HistoryProvider.kt       | 2 +-
 .../src/org/videolan/vlc/viewmodels/browser/BrowserProvider.kt       | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/HistoryProvider.kt b/vlc-android/src/org/videolan/vlc/viewmodels/HistoryProvider.kt
index 192f153bc..8d2ef0487 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/HistoryProvider.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/HistoryProvider.kt
@@ -18,7 +18,7 @@ class HistoryProvider: BaseModel<MediaWrapper>() {
     }
 
     fun moveUp(media: MediaWrapper) {
-        dataset.value = dataset.value?.apply {
+        dataset.value = dataset.value.apply {
             remove(media)
             add(0, media)
         }
diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/browser/BrowserProvider.kt b/vlc-android/src/org/videolan/vlc/viewmodels/browser/BrowserProvider.kt
index d08c8df51..0fbccb22e 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/browser/BrowserProvider.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/browser/BrowserProvider.kt
@@ -46,11 +46,6 @@ abstract class BrowserProvider(val url: String?, private val showHiddenFiles: Bo
         Handler(handlerThread.looper)
     }
 
-    init {
-        sort = VLCApplication.getSettings().getInt(sortKey, Medialibrary.SORT_ALPHA)
-        desc = VLCApplication.getSettings().getBoolean("${sortKey}_desc", false)
-    }
-
     protected open fun initBrowser(listener: EventListener = browserListener) {
         if (mediabrowser === null) mediabrowser = MediaBrowser(VLCInstance.get(), listener, browserHandler)
         else mediabrowser?.changeEventListener(listener)



More information about the Android mailing list