diff --git a/.idea/misc.xml b/.idea/misc.xml index 769598250..00f52ed7b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/src/main/java/io/github/dsheirer/gui/SDRTrunk.java b/src/main/java/io/github/dsheirer/gui/SDRTrunk.java index 12ca6475c..a653877fe 100644 --- a/src/main/java/io/github/dsheirer/gui/SDRTrunk.java +++ b/src/main/java/io/github/dsheirer/gui/SDRTrunk.java @@ -156,18 +156,10 @@ public SDRTrunk() } } - //Setup the application home directory - Path home = getHomePath(); - ThreadPool.logSettings(); - mLog.info("Home path: " + home.toString()); - //Load properties file - if(home != null) - { - loadProperties(home); - } + loadProperties(); //Log current properties setting SystemProperties.getInstance().logCurrentSettings(); @@ -632,34 +624,30 @@ private void toggleBroadcastStatusPanelVisibility() * Loads the application properties file from the user's home directory, * creating the properties file for the first-time, if necessary */ - private void loadProperties(Path homePath) + private void loadProperties() { - Path propsPath = homePath.resolve("SDRTrunk.properties"); + Path propertiesPath = mUserPreferences.getDirectoryPreference().getDirectoryApplicationRoot().resolve("SDRTrunk.properties"); - if(!Files.exists(propsPath)) + if(!Files.exists(propertiesPath)) { try { - mLog.info("SDRTrunk - creating application properties file [" + - propsPath.toAbsolutePath() + "]"); - - Files.createFile(propsPath); + mLog.info("SDRTrunk - creating application properties file [" + propertiesPath.toAbsolutePath() + "]"); + Files.createFile(propertiesPath); } catch(IOException e) { - mLog.error("SDRTrunk - couldn't create application properties " - + "file [" + propsPath.toAbsolutePath(), e); + mLog.error("SDRTrunk - couldn't create application properties file [" + propertiesPath.toAbsolutePath(), e); } } - if(Files.exists(propsPath)) + if(Files.exists(propertiesPath)) { - SystemProperties.getInstance().load(propsPath); + SystemProperties.getInstance().load(propertiesPath); } else { - mLog.error("SDRTrunk - couldn't find or recreate the SDRTrunk " + - "application properties file"); + mLog.error("SDRTrunk - couldn't find or recreate the SDRTrunk application properties file"); } } diff --git a/src/main/java/io/github/dsheirer/properties/SystemProperties.java b/src/main/java/io/github/dsheirer/properties/SystemProperties.java index cf16653ab..dca7f295d 100644 --- a/src/main/java/io/github/dsheirer/properties/SystemProperties.java +++ b/src/main/java/io/github/dsheirer/properties/SystemProperties.java @@ -161,10 +161,6 @@ public void logCurrentSettings() { mLog.info("SystemProperties - no properties file loaded - using defaults"); } - else - { - mLog.info("SystemProperties - application properties loaded [" + mPropertiesPath.toString() + "]"); - } } /**