From 9d9cd5ae04036182b2fc236ce5b820a6963ab3ec Mon Sep 17 00:00:00 2001 From: tristan81 Date: Wed, 18 Sep 2024 23:25:53 +1000 Subject: [PATCH] *.kt: fixed consecutive KDOC error for ktLint --- .../main/java/fr/free/nrw/commons/Media.kt | 17 ++----- .../nrw/commons/bookmarks/models/Bookmark.kt | 7 +-- .../nrw/commons/contributions/Contribution.kt | 3 +- .../commons/explore/models/RecentSearch.kt | 9 +--- .../profile/achievements/Achievements.kt | 49 +++++++------------ .../fr/free/nrw/commons/upload/Description.kt | 26 +++++----- .../nrw/commons/upload/ImageCoordinates.kt | 3 +- .../nrw/commons/upload/UploadMediaDetail.kt | 31 ++++++------ 8 files changed, 58 insertions(+), 87 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/Media.kt b/app/src/main/java/fr/free/nrw/commons/Media.kt index dfd7da3f3..93efac7b2 100644 --- a/app/src/main/java/fr/free/nrw/commons/Media.kt +++ b/app/src/main/java/fr/free/nrw/commons/Media.kt @@ -27,12 +27,8 @@ class Media constructor( */ var filename: String? = null, /** - * Gets the file description. + * Gets or sets the file description. * @return file description as a string - */ - // monolingual description on input... - /** - * Sets the file description. * @param fallbackDescription the new description of the file */ var fallbackDescription: String? = null, @@ -43,22 +39,15 @@ class Media constructor( */ var dateUploaded: Date? = null, /** - * Gets the license name of the file. + * Gets or sets the license name of the file. * @return license as a String - */ - /** - * Sets the license name of the file. - * * @param license license name as a String */ var license: String? = null, var licenseUrl: String? = null, /** - * Gets the name of the creator of the file. + * Gets or sets the name of the creator of the file. * @return author name as a String - */ - /** - * Sets the author name of the file. * @param author creator name as a string */ var author: String? = null, diff --git a/app/src/main/java/fr/free/nrw/commons/bookmarks/models/Bookmark.kt b/app/src/main/java/fr/free/nrw/commons/bookmarks/models/Bookmark.kt index cad67d49e..a33638e72 100644 --- a/app/src/main/java/fr/free/nrw/commons/bookmarks/models/Bookmark.kt +++ b/app/src/main/java/fr/free/nrw/commons/bookmarks/models/Bookmark.kt @@ -6,15 +6,12 @@ class Bookmark( mediaName: String?, mediaCreator: String?, /** - * Modifies the content URI - marking this bookmark as already saved in the database + * Gets or Sets the content URI - marking this bookmark as already saved in the database + * @return content URI * @param contentUri the content URI */ var contentUri: Uri?, ) { - /** - * Gets the content URI for this bookmark - * @return content URI - */ /** * Gets the media name * @return the media name diff --git a/app/src/main/java/fr/free/nrw/commons/contributions/Contribution.kt b/app/src/main/java/fr/free/nrw/commons/contributions/Contribution.kt index 9a624b9cb..0a757619f 100644 --- a/app/src/main/java/fr/free/nrw/commons/contributions/Contribution.kt +++ b/app/src/main/java/fr/free/nrw/commons/contributions/Contribution.kt @@ -30,8 +30,7 @@ data class Contribution constructor( var errorInfo: String? = null, /** * @return array list of entityids for the depictions - */ - /** + * * Each depiction loaded in depictions activity is associated with a wikidata entity id, this Id * is in turn used to upload depictions to wikibase */ diff --git a/app/src/main/java/fr/free/nrw/commons/explore/models/RecentSearch.kt b/app/src/main/java/fr/free/nrw/commons/explore/models/RecentSearch.kt index 06570ae68..2340865a6 100644 --- a/app/src/main/java/fr/free/nrw/commons/explore/models/RecentSearch.kt +++ b/app/src/main/java/fr/free/nrw/commons/explore/models/RecentSearch.kt @@ -7,14 +7,7 @@ import java.util.Date * Represents a recently searched query * Example - query = "butterfly" */ -class RecentSearch -/** - * Constructor - * @param contentUri the content URI for this query - * @param query query name - * @param lastSearched last searched date - */ -( +class RecentSearch( /** * Modifies the content URI - marking this query as already saved in the database * diff --git a/app/src/main/java/fr/free/nrw/commons/profile/achievements/Achievements.kt b/app/src/main/java/fr/free/nrw/commons/profile/achievements/Achievements.kt index f4811ac90..861040fcf 100644 --- a/app/src/main/java/fr/free/nrw/commons/profile/achievements/Achievements.kt +++ b/app/src/main/java/fr/free/nrw/commons/profile/achievements/Achievements.kt @@ -5,49 +5,38 @@ package fr.free.nrw.commons.profile.achievements */ class Achievements { /** - * getter function to get count of unique images used by wiki - * @return - */ - /** - * setter function to set count of uniques images used by wiki - * @param uniqueUsedImages + * The count of unique images used by the wiki. + * @return The count of unique images used. + * @param uniqueUsedImages The count to set for unique images used. */ var uniqueUsedImages = 0 private var articlesUsingImages = 0 + /** - * getter function to get count of thanks received - * @return - */ - /** - * setter function to set count of thanks received - * @param thanksReceived + * The count of thanks received. + * @return The count of thanks received. + * @param thanksReceived The count to set for thanks received. */ var thanksReceived = 0 + /** - * getter function to get count of featured images - * @return - */ - /** - * setter function to set count of featured images - * @param featuredImages + * The count of featured images. + * @return The count of featured images. + * @param featuredImages The count to set for featured images. */ var featuredImages = 0 + /** - * getter function to get count of featured images - * @return - */ - /** - * setter function to set count of featured images - * @param featuredImages + * The count of quality images. + * @return The count of quality images. + * @param qualityImages The count to set for quality images. */ var qualityImages = 0 + /** - * getter function to get count of images uploaded - * @return - */ - /** - * setter function to count of images uploaded - * @param imagesUploaded + * The count of images uploaded. + * @return The count of images uploaded. + * @param imagesUploaded The count to set for images uploaded. */ var imagesUploaded = 0 private var revertCount = 0 diff --git a/app/src/main/java/fr/free/nrw/commons/upload/Description.kt b/app/src/main/java/fr/free/nrw/commons/upload/Description.kt index 3cf7adf66..83902aae4 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/Description.kt +++ b/app/src/main/java/fr/free/nrw/commons/upload/Description.kt @@ -5,27 +5,27 @@ package fr.free.nrw.commons.upload */ class Description { /** - * @return The language code ie. "en" or "fr" - */ - /** - * @param languageCode The language code ie. "en" or "fr" + * The language code, e.g., "en" or "fr". + * @param languageCode The language code. */ var languageCode: String? = null - var descriptionText: String? = null + /** - * @return the index of the language selected in a spinner with [SpinnerLanguagesAdapter] + * The description text for the item being uploaded. + * @param descriptionText The description text. */ + var descriptionText: String? = null + /** - * @param selectedLanguageIndex the index of the language selected in a spinner with [SpinnerLanguagesAdapter] + * The index of the language selected in a spinner with [SpinnerLanguagesAdapter]. + * @param selectedLanguageIndex The index of the selected language. */ var selectedLanguageIndex = -1 + /** - * returns if the description was added manually (by the user, or we have added it programaticallly) - * @return - */ - /** - * sets to true if the description was manually added by the user - * @param manuallyAdded + * Indicates if the description was added manually (by the user or programmatically). + * @param manuallyAdded Sets to true if the description was manually added by the user. + * @return True if the description was manually added. */ var isManuallyAdded = false diff --git a/app/src/main/java/fr/free/nrw/commons/upload/ImageCoordinates.kt b/app/src/main/java/fr/free/nrw/commons/upload/ImageCoordinates.kt index d352a1e94..a6976407f 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/ImageCoordinates.kt +++ b/app/src/main/java/fr/free/nrw/commons/upload/ImageCoordinates.kt @@ -24,10 +24,11 @@ class ImageCoordinates internal constructor( * @return string of `"[decLatitude]|[decLongitude]"` or null if coordinates do not exist */ var decimalCoords: String? = null - var zoomLevel: Double = 16.0 + /** * @return double value of zoom or 16.0 by default */ + var zoomLevel: Double = 16.0 /** * Construct from a stream. diff --git a/app/src/main/java/fr/free/nrw/commons/upload/UploadMediaDetail.kt b/app/src/main/java/fr/free/nrw/commons/upload/UploadMediaDetail.kt index 295b1f565..3756cee5b 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/UploadMediaDetail.kt +++ b/app/src/main/java/fr/free/nrw/commons/upload/UploadMediaDetail.kt @@ -10,13 +10,19 @@ import kotlinx.parcelize.Parcelize @Parcelize data class UploadMediaDetail constructor( /** - * @return The language code ie. "en" or "fr" - */ - /** - * @param languageCode The language code ie. "en" or "fr" + * The language code ie. "en" or "fr". + * @param languageCode The language code ie. "en" or "fr". */ var languageCode: String? = null, + /** + * The description text for the item being uploaded. + * @param descriptionText The description text. + */ var descriptionText: String = "", + /** + * The caption text for the item being uploaded. + * @param captionText The caption text. + */ var captionText: String = "", ) : Parcelable { fun javaCopy() = copy() @@ -26,21 +32,18 @@ data class UploadMediaDetail constructor( place.longDescription, place.name, ) - /** - * @return the index of the language selected in a spinner with [SpinnerLanguagesAdapter] - */ /** - * @param selectedLanguageIndex the index of the language selected in a spinner with [SpinnerLanguagesAdapter] + * The index of the language selected in a spinner with [SpinnerLanguagesAdapter]. + * @return The index of the selected language. + * @param selectedLanguageIndex The index of the language selected. */ var selectedLanguageIndex: Int = -1 + /** - * returns if the description was added manually (by the user, or we have added it programaticallly) - * @return - */ - /** - * sets to true if the description was manually added by the user - * @param manuallyAdded + * Returns if the description was added manually (by the user, or programmatically). + * @return True if the description was manually added. + * @param manuallyAdded Sets to true if the description was manually added. */ var isManuallyAdded: Boolean = false }