Skip to content
Snippets Groups Projects
Verified Commit 1ce59fa0 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Making sure that all serialized data is actually serializable

parent eff4df64
No related branches found
No related tags found
No related merge requests found
...@@ -102,9 +102,9 @@ class NetworkSetupNetworkSlide : ServiceBoundSlideFragment() { ...@@ -102,9 +102,9 @@ class NetworkSetupNetworkSlide : ServiceBoundSlideFragment() {
} }
override fun getData(data: Bundle) { override fun getData(data: Bundle) {
data.putSerializable( data.putInt(
"identity", "identity",
identityAdapter.getItemId(this.identity.selectedItemPosition) identityAdapter.getItemId(this.identity.selectedItemPosition).toInt()
) )
val networkId = (network.selectedItem as? INetwork.NetworkInfo)?.networkId val networkId = (network.selectedItem as? INetwork.NetworkInfo)?.networkId
if (networkId != null) { if (networkId != null) {
......
...@@ -22,12 +22,15 @@ package de.kuschku.libquassel.protocol.coresetup ...@@ -22,12 +22,15 @@ package de.kuschku.libquassel.protocol.coresetup
import de.kuschku.libquassel.protocol.* import de.kuschku.libquassel.protocol.*
import java.io.Serializable import java.io.Serializable
class CoreSetupBackendConfigElement : Serializable { class CoreSetupBackendConfigElement(
val key: String val key: String,
val displayName: String val displayName: String,
private val typeId: Int defaultValue: QVariant_
private val customType: String ) : Serializable {
private val rawDefaultValue: Any? private val typeId = defaultValue.type.id
private val customType = defaultValue.type.serializableName
private val rawDefaultValue = defaultValue.data as? Serializable
val defaultValue: QVariant_ val defaultValue: QVariant_
get() { get() {
val type = Type.of(typeId) val type = Type.of(typeId)
...@@ -41,14 +44,6 @@ class CoreSetupBackendConfigElement : Serializable { ...@@ -41,14 +44,6 @@ class CoreSetupBackendConfigElement : Serializable {
} }
} }
constructor(key: String, displayName: String, defaultValue: QVariant_) {
this.key = key
this.displayName = displayName
this.typeId = defaultValue.type.id
this.customType = defaultValue.type.serializableName
this.rawDefaultValue = defaultValue.data
}
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (this === other) return true if (this === other) return true
if (javaClass != other?.javaClass) return false if (javaClass != other?.javaClass) return false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment