Skip to content

Commit

Permalink
distinguish tag and system tag
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <alper_ozturk@proton.me>
  • Loading branch information
alperozturk96 committed Jan 8, 2025
1 parent e5fb554 commit b9cff64
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.owncloud.android.lib.resources.files.model.GeoLocation
import com.owncloud.android.lib.resources.files.model.ImageDimension
import com.owncloud.android.lib.resources.shares.ShareType
import com.owncloud.android.lib.resources.shares.ShareeUser
import com.owncloud.android.lib.resources.systemTag.SystemTag
import org.apache.jackrabbit.webdav.MultiStatusResponse
import org.apache.jackrabbit.webdav.property.DavProperty
import org.apache.jackrabbit.webdav.property.DavPropertyName
Expand Down Expand Up @@ -86,7 +87,7 @@ class WebdavEntry constructor(ms: MultiStatusResponse, splitElement: String) {
private set
var lockToken: String? = null
private set
var tags = arrayOfNulls<Tag>(0)
var tags = arrayOfNulls<SystemTag>(0)
var imageDimension: ImageDimension? = null
var geoLocation: GeoLocation? = null
var hidden = false
Expand Down Expand Up @@ -464,10 +465,10 @@ class WebdavEntry constructor(ms: MultiStatusResponse, splitElement: String) {
}
}

private fun parseTag(element: Element): Tag {
private fun parseTag(element: Element): SystemTag {
val name = element.firstChild.textContent
val color = element.getAttribute("nc:color")
return Tag(name, color)
val color = "#" + element.getAttribute("nc:color")
return SystemTag(name, color)
}

private fun parseLockProperties(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ package com.owncloud.android.lib.resources.files.model

import android.os.Parcel
import android.os.Parcelable
import com.owncloud.android.lib.common.network.Tag
import com.owncloud.android.lib.common.network.WebdavEntry
import com.owncloud.android.lib.common.network.WebdavEntry.MountType
import com.owncloud.android.lib.resources.files.FileUtils
import com.owncloud.android.lib.resources.files.model.FileLockType.Companion.fromValue
import com.owncloud.android.lib.resources.shares.ShareeUser
import com.owncloud.android.lib.resources.systemTag.SystemTag
import java.io.Serializable

/**
Expand Down Expand Up @@ -51,7 +51,7 @@ class RemoteFile : Parcelable, Serializable {
var lockOwnerEditor: String? = null
var lockTimeout: Long = 0
var lockToken: String? = null
var tags: Array<Tag?>? = null
var tags: Array<SystemTag?>? = null
var imageDimension: ImageDimension? = null
var geoLocation: GeoLocation? = null
var hidden = false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <alper.ozturk@nextcloud.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

package com.owncloud.android.lib.resources.systemTag

data class SystemTag(val name: String, val color: String?)

0 comments on commit b9cff64

Please sign in to comment.