Skip to content

Commit

Permalink
Fixing issue in profile name in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
waicool20 committed Apr 10, 2017
1 parent 691a602 commit bdacb58
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
8 changes: 5 additions & 3 deletions .idea/modules/-858112391/KAGA_main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions .idea/modules/-858112391/KAGA_test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class KancolleAutoProfile(

companion object Loader {
private val loaderLogger = LoggerFactory.getLogger(KancolleAutoProfile.Loader::class.java)
val DEFAULT_NAME = "[Current Profile]"

@JvmStatic fun load(path: Path = Kaga.CONFIG.kancolleAutoRootDirPath.resolve("config.ini")): KancolleAutoProfile? {
if (Files.exists(path)) {
loaderLogger.info("Attempting to load KancolleAuto Profile")
Expand All @@ -120,7 +122,7 @@ class KancolleAutoProfile(
}
loaderLogger.info("Copied backup of existing configuration to $backupPath")
Files.copy(path, backupPath)
"<Current Profile>"
DEFAULT_NAME
}
val ini = Wini(path.toFile())

Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/waicool20/kaga/views/KagaView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class KagaView {

@FXML private fun onSaveButton() {
with(Kaga.PROFILE!!) {
if (name == "<Current Profile>") {
if (name == KancolleAutoProfile.DEFAULT_NAME) {
val text = "Not a valid profile name, didn't save it..."
logger.warn(text)
AlertFactory.info(content = text).showAndWait()
Expand All @@ -138,7 +138,7 @@ class KagaView {
@FXML private fun onDeleteButton() {
with(Kaga.PROFILE!!) {
val text = "Not a valid profile name, didn't delete it..."
if (name == "<Current Profile>") {
if (name == KancolleAutoProfile.DEFAULT_NAME) {
logger.warn(text)
AlertFactory.warn(content = text).showAndWait()
return
Expand Down

0 comments on commit bdacb58

Please sign in to comment.