mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-14 17:47:32 -05:00
#1726 On startup, application no longer auto-creates SDRTrunk folder and system properties in user's home directory when user has changed the application root in the user preferences.
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
|||||||
<component name="FrameworkDetectionExcludesConfiguration">
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
<file type="web" url="file://$PROJECT_DIR$" />
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_20_PREVIEW" project-jdk-name="liberica-20" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_20" default="true" project-jdk-name="liberica-20" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -156,18 +156,10 @@ public class SDRTrunk implements Listener<TunerEvent>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Setup the application home directory
|
|
||||||
Path home = getHomePath();
|
|
||||||
|
|
||||||
ThreadPool.logSettings();
|
ThreadPool.logSettings();
|
||||||
|
|
||||||
mLog.info("Home path: " + home.toString());
|
|
||||||
|
|
||||||
//Load properties file
|
//Load properties file
|
||||||
if(home != null)
|
loadProperties();
|
||||||
{
|
|
||||||
loadProperties(home);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Log current properties setting
|
//Log current properties setting
|
||||||
SystemProperties.getInstance().logCurrentSettings();
|
SystemProperties.getInstance().logCurrentSettings();
|
||||||
@@ -632,34 +624,30 @@ public class SDRTrunk implements Listener<TunerEvent>
|
|||||||
* Loads the application properties file from the user's home directory,
|
* Loads the application properties file from the user's home directory,
|
||||||
* creating the properties file for the first-time, if necessary
|
* 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
|
try
|
||||||
{
|
{
|
||||||
mLog.info("SDRTrunk - creating application properties file [" +
|
mLog.info("SDRTrunk - creating application properties file [" + propertiesPath.toAbsolutePath() + "]");
|
||||||
propsPath.toAbsolutePath() + "]");
|
Files.createFile(propertiesPath);
|
||||||
|
|
||||||
Files.createFile(propsPath);
|
|
||||||
}
|
}
|
||||||
catch(IOException e)
|
catch(IOException e)
|
||||||
{
|
{
|
||||||
mLog.error("SDRTrunk - couldn't create application properties "
|
mLog.error("SDRTrunk - couldn't create application properties file [" + propertiesPath.toAbsolutePath(), e);
|
||||||
+ "file [" + propsPath.toAbsolutePath(), e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Files.exists(propsPath))
|
if(Files.exists(propertiesPath))
|
||||||
{
|
{
|
||||||
SystemProperties.getInstance().load(propsPath);
|
SystemProperties.getInstance().load(propertiesPath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mLog.error("SDRTrunk - couldn't find or recreate the SDRTrunk " +
|
mLog.error("SDRTrunk - couldn't find or recreate the SDRTrunk application properties file");
|
||||||
"application properties file");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,10 +161,6 @@ public class SystemProperties
|
|||||||
{
|
{
|
||||||
mLog.info("SystemProperties - no properties file loaded - using defaults");
|
mLog.info("SystemProperties - no properties file loaded - using defaults");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
mLog.info("SystemProperties - application properties loaded [" + mPropertiesPath.toString() + "]");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user