Skip to content

Commit

Permalink
Migrate preferences to be more consistent with core application (#10)
Browse files Browse the repository at this point in the history
* Migrate preferences to standard AOI preferences location

* Manager prefs don't need to be in a hidden file

* Scrub old preferences file
  • Loading branch information
Sailsman63 authored Aug 25, 2023
1 parent 8344f8a commit a5726bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 12 additions & 2 deletions SPManager/src/artofillusion/spmanager/SPMParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import buoy.widget.*;

import artofillusion.ui.*;
import artofillusion.ApplicationPreferences;

/**
* Description of the Class
Expand Down Expand Up @@ -88,7 +89,16 @@ public SPMParameters()
*/
private void loadPropertiesFile()
{
File f = new File( System.getProperty( "user.home" ), ".spmanagerprefs" );
// The old file became obsolete when the server was migrated
// HTTPS. Scrub it if it's still around.
File oldFile = new File(System.getProperty("user.home"), ".spmanagerprefs");
if (oldFile.exists())
{
System.out.println("Deleting the old .spmanagerprefs file");
oldFile.delete();
}

File f = new File(ApplicationPreferences.getPreferencesDirectory(), "spmanagerprefs" );
if ( !f.exists() )
{
savePropertiesFile();
Expand Down Expand Up @@ -266,7 +276,7 @@ public void run()
private void savePropertiesFile()
{

File f = new File( System.getProperty( "user.home" ), ".spmanagerprefs" );
File f = new File(ApplicationPreferences.getPreferencesDirectory(), "spmanagerprefs" );
try
{
OutputStream out = new BufferedOutputStream( new FileOutputStream( f ) );
Expand Down
3 changes: 2 additions & 1 deletion SPManager/src/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ See http://aoisp.sourceforge.net/spmanagement.html for usage.
</comments>

<history>
<log version="1.103" date="January 13 2023" author="Lucas Stanek">
<log version="1.103" date="August 25 2023" author="Lucas Stanek">
- Hot-patch to work with https connections on the server (hosting provider made a mandatory migration)
- Migrate preferences into the standard aoiprefs location
</log>
<log version="1.102" date="March 24 2019" author="Lucas Stanek">
- Rebuild and compatibility updates for Java 8+
Expand Down

0 comments on commit a5726bc

Please sign in to comment.