Skip to content

Commit da17e73

Browse files
committed
Make variable names clearer
1 parent e426b7d commit da17e73

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -497,24 +497,24 @@ object CsvValidatorUi extends SimpleSwingApplication {
497497
val identifierRows = CsvValidatorCmdApp.getColumnFromCsv(csvFile, schemaFile, "identifier").sorted
498498
val fromPath = identifierRows.headOption.getOrElse("")
499499

500-
val fileTextField = new TextField(30)
501-
val fromPathText = new TextField(fromPath, 30)
500+
val toPathField = new TextField(30)
501+
val fromPathField = new TextField(fromPath, 30)
502502

503503
def pathToUri(path: Path) = {
504504
val uri = path.toUri.toString
505505
if (uri.endsWith("/")) uri else s"$uri/"
506506
}
507507

508508
def updateFileText(path: Path): Try[String] = {
509-
fileTextField.text = pathToUri(path)
509+
toPathField.text = pathToUri(path)
510510
Success("Text updated")
511511
}
512512

513513
val fileButton = new Button("...")
514514
fileButton.reactions += {
515515
case ev: ButtonClicked =>
516-
val startingDir = if(fileTextField.text.isEmpty) userDir.toFile else Path.of(fileTextField.text).toFile
517-
val fromFolderName = Path.of(fromPathText.text).getFileName
516+
val startingDir = if(toPathField.text.isEmpty) userDir.toFile else Path.of(toPathField.text).toFile
517+
val fromFolderName = Path.of(fromPathField.text).getFileName
518518
val helpText = s"Select the ${fromFolderName} folder"
519519
val fileChooser = new FileChooser(startingDir)
520520
fileChooser.title = helpText
@@ -523,8 +523,8 @@ object CsvValidatorUi extends SimpleSwingApplication {
523523
}
524524

525525
val rows = List(
526-
Row("From", List(fromPathText)),
527-
Row("To", List(fileTextField, fileButton))
526+
Row("From", List(fromPathField)),
527+
Row("To", List(toPathField, fileButton))
528528
)
529529
addToTableDialog(parentFrame, "Add Path Substitution...", rows, tblPathSubstitutions.addRow)
530530
}

0 commit comments

Comments
 (0)