Skip to content

Commit

Permalink
#238: renames function(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
rladstaetter committed Jul 26, 2024
1 parent c4030f0 commit b2cbc6e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/src/main/scala/app/logorrr/conf/LogoRRRGlobals.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ object LogoRRRGlobals extends CanLog {
}

/** a case class representing current setting state */
def getSettings: Settings = mutSettings.petrify()
def getSettings: Settings = mutSettings.mkImmutable()

def setSomeActiveLogFile(sActive: Option[FileId]): Unit = mutSettings.setSomeActive(sActive)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class MutLogFileSettings {

def getFirstOpened: Long = firstOpenedProperty.get()

def petrify(): LogFileSettings = {
def mkImmutable(): LogFileSettings = {
val lfs =
LogFileSettings(fileIdProperty.get()
, selectedLineNumberProperty.get()
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/scala/app/logorrr/conf/mut/MutSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ class MutSettings {
mutLogFileSettingsMapProperty.putAll(m.asJava)
}

def petrify(): Settings = {
def mkImmutable(): Settings = {
val logFileSettings: Map[String, LogFileSettings] = (for ((k, v) <- mutLogFileSettingsMapProperty.get.asScala) yield {
k.absolutePathAsString -> v.petrify()
k.absolutePathAsString -> v.mkImmutable()
}).toMap
Settings(mutStageSettings.petrify(), logFileSettings, getSomeActiveLogFile, getSomeLastUsedDirectory)
Settings(mutStageSettings.mkImmutable(), logFileSettings, getSomeActiveLogFile, getSomeLastUsedDirectory)
}

def setStageSettings(stageSettings: StageSettings): Unit = {
Expand Down Expand Up @@ -110,7 +110,7 @@ class MutSettings {

def getOrderedLogFileSettings: Seq[LogFileSettings] = {
val seq = mutLogFileSettingsMapProperty.get().values.asScala.toSeq
seq.sortWith((lt, gt) => lt.getFirstOpened < gt.getFirstOpened).map(_.petrify())
seq.sortWith((lt, gt) => lt.getFirstOpened < gt.getFirstOpened).map(_.mkImmutable())
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MutStageSettings {

def setHeight(height: Int): Unit = heightProperty.set(height)

def petrify(): StageSettings =
def mkImmutable(): StageSettings =
StageSettings(xProperty.get()
, yProperty.get()
, widthProperty.get()
Expand Down
4 changes: 2 additions & 2 deletions app/src/test/scala/app/logorrr/conf/mut/MutSettingsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class MutSettingsSpec extends LogoRRRSpec {
"MutSettings" should {
"deserialize" in {
val s = Settings(StageSettings(0.15142984837327833, 0.5216122226307276, 1, 1), Map(), None, None)
assert(s == mkMutSettings(s).petrify())
assert(s == mkMutSettings(s).mkImmutable())
}
"de/serialize" in {
check(Prop.forAll(SettingsSpec.gen) {
expected: Settings => expected == mkMutSettings(mkMutSettings(expected).petrify()).petrify()
expected: Settings => expected == mkMutSettings(mkMutSettings(expected).mkImmutable()).mkImmutable()
})
}
}
Expand Down

0 comments on commit b2cbc6e

Please sign in to comment.