From 04339ac28b0d806b21df7c1b8114e45a38d2f0eb Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 12 Dec 2016 21:28:38 +0100 Subject: [PATCH] let the models convert themselves to strings --- .../kotlin/com/simplemobiletools/gallery/models/Directory.kt | 5 +---- .../kotlin/com/simplemobiletools/gallery/models/Medium.kt | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt index c9be8d77a..a87dd4737 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt @@ -5,7 +5,7 @@ import com.simplemobiletools.gallery.helpers.SORT_BY_NAME import com.simplemobiletools.gallery.helpers.SORT_BY_SIZE import com.simplemobiletools.gallery.helpers.SORT_DESCENDING -class Directory(val path: String, val thumbnail: String, val name: String, var mediaCnt: Int, val date_modified: Long, val date_taken: Long, +data class Directory(val path: String, val thumbnail: String, val name: String, var mediaCnt: Int, val date_modified: Long, val date_taken: Long, var size: Long) : Comparable { companion object { var sorting: Int = 0 @@ -47,7 +47,4 @@ class Directory(val path: String, val thumbnail: String, val name: String, var m } return res } - - override fun toString() = "Directory {path=$path, thumbnail=$thumbnail, name=$name, mediaCnt=$mediaCnt, date_modified=$date_modified, " + - "date_taken=$date_taken, size $size}" } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt index eaf55074a..dd857bb5a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -6,7 +6,7 @@ import com.simplemobiletools.gallery.helpers.SORT_BY_SIZE import com.simplemobiletools.gallery.helpers.SORT_DESCENDING import java.io.Serializable -class Medium(val name: String, var path: String, val isVideo: Boolean, val date_modified: Long, val date_taken: Long, val size: Long) : Serializable, Comparable { +data class Medium(val name: String, var path: String, val isVideo: Boolean, val date_modified: Long, val date_taken: Long, val size: Long) : Serializable, Comparable { companion object { private val serialVersionUID = -6553149466975455L var sorting: Int = 0 @@ -52,6 +52,4 @@ class Medium(val name: String, var path: String, val isVideo: Boolean, val date_ } return res } - - override fun toString() = "Medium {name=$name, path=$path, isVideo=$isVideo, date_modified=$date_modified, date_taken=$date_taken, size=$size}" }