Skip to content

Commit

Permalink
Deduplicator: Use "X files" instead of "copies", with similar files i…
Browse files Browse the repository at this point in the history
…n the mix, it's not really a copy anymore...
  • Loading branch information
darken committed Nov 8, 2023
1 parent 1c49211 commit 2cc27bd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions app-common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,9 @@
<string name="general_timeunit_days">Days</string>
<string name="general_progress_ready">Ready</string>
<string name="general_progress_done">Done</string>

<plurals name="result_x_files">
<item quantity="one">%s file</item>
<item quantity="other">%s files</item>
</plurals>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ChecksumGroupHeaderVH(parent: ViewGroup) :

previewImage.loadFilePreview(group.preview)

countValue.text = context.getQuantityString2(R.plurals.deduplicator_result_x_duplicates, group.count)
countValue.text = context.getQuantityString2(eu.darken.sdmse.common.R.plurals.result_x_files, group.count)
sizeValue.text = Formatter.formatFileSize(context, group.averageSize.roundToLong())

viewAction.setOnClickListener { item.onViewActionClick(item) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class ClusterHeaderVH(parent: ViewGroup) :
val cluster = item.cluster

methodChecksumCount.text = context.getQuantityString2(
R.plurals.deduplicator_result_x_duplicates,
eu.darken.sdmse.common.R.plurals.result_x_files,
cluster.groups.filterIsInstance<ChecksumDuplicate.Group>().sumOf { it.count }
)

methodPhashValue.text = context.getQuantityString2(
R.plurals.deduplicator_result_x_duplicates,
eu.darken.sdmse.common.R.plurals.result_x_files,
cluster.groups.filterIsInstance<PHashDuplicate.Group>().sumOf { it.count }
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PHashGroupHeaderVH(parent: ViewGroup) :
}
})

countValue.text = context.getQuantityString2(R.plurals.deduplicator_result_x_duplicates, group.count)
countValue.text = context.getQuantityString2(eu.darken.sdmse.common.R.plurals.result_x_files, group.count)
sizeValue.text = Formatter.formatFileSize(context, group.averageSize.roundToLong())

viewAction.setOnClickListener { item.onViewActionClick(item) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class DeduplicatorListGridVH(parent: ViewGroup) :
previewImage.loadFilePreview(cluster.previewFile)

primary.text = Formatter.formatShortFileSize(context, cluster.totalSize)
secondary.text = context.getQuantityString2(R.plurals.deduplicator_result_x_duplicates, cluster.count)
secondary.text = context.getQuantityString2(eu.darken.sdmse.common.R.plurals.result_x_items, cluster.count)

matchTypeChecksum.isVisible = item.cluster.types.contains(Duplicate.Type.CHECKSUM)
matchTypePhash.isVisible = item.cluster.types.contains(Duplicate.Type.PHASH)
Expand Down

0 comments on commit 2cc27bd

Please sign in to comment.