[Android] BrowserProvider: Remove dead code

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


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Apr  6 17:28:40 2018 +0200| [46d0caefab8ce4845817ebf2b44a6b10a0c1fcc8] | committer: Geoffrey Métais

BrowserProvider: Remove dead code

> https://code.videolan.org/videolan/vlc-android/commit/46d0caefab8ce4845817ebf2b44a6b10a0c1fcc8
---

 vlc-android/src/org/videolan/vlc/viewmodels/BaseModel.kt | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/BaseModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/BaseModel.kt
index f9d046226..d93c862d9 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/BaseModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/BaseModel.kt
@@ -84,17 +84,6 @@ abstract class BaseModel<T : MediaLibraryItem> : ViewModel(), RefreshModel {
                 is MediaAddition -> addMedia(update.media as T)
                 is MediaListAddition -> addMedia(update.mediaList as List<T>)
                 is Remove -> removeMedia(update.media as T)
-                is Sort -> {
-                    if (canSortBy(update.sort)) {
-                        desc = when (sort) {
-                            Medialibrary.SORT_DEFAULT -> update.sort == Medialibrary.SORT_ALPHA
-                            update.sort -> !desc
-                            else -> false
-                        }
-                        sort = update.sort
-                        updateList()
-                    }
-                }
             }
         }
     }
@@ -109,8 +98,8 @@ abstract class BaseModel<T : MediaLibraryItem> : ViewModel(), RefreshModel {
                 else -> false
             }
             this.sort = sort
+            refresh()
         }
-        refresh()
     }
 
     fun remove(mw: T) = updateActor.offer(Remove(mw))
@@ -159,6 +148,5 @@ object Refresh : Update()
 data class MediaUpdate(val mediaList: List<MediaLibraryItem>) : Update()
 data class MediaListAddition(val mediaList: List<MediaLibraryItem>) : Update()
 data class MediaAddition(val media: MediaLibraryItem) : Update()
-data class Sort(val sort: Int) : Update()
 data class Remove(val media: MediaLibraryItem) : Update()
 data class Filter(val query: String?) : Update()



More information about the Android mailing list