Fixed bug with deleting files on upgrade one extra time

This commit is contained in:
pelya
2012-12-21 21:20:32 +02:00
parent 641f9d1cc6
commit 6d0e74e992
4 changed files with 20 additions and 8 deletions

View File

@@ -299,6 +299,12 @@ class Settings
Globals.BrokenLibCMessageShown = settingsFile.readBoolean();
Globals.TouchscreenKeyboardDrawSize = settingsFile.readInt();
int cfgVersion = settingsFile.readInt();
settingsLoaded = true;
System.out.println("libSDL: Settings.Load(): loaded settings successfully");
settingsFile.close();
System.out.println("libSDL: old cfg version " + cfgVersion + ", our version " + p.getApplicationVersion());
if( cfgVersion != p.getApplicationVersion() )
{
@@ -307,15 +313,11 @@ class Settings
{
System.out.println("libSDL: old cfg version " + cfgVersion + ", our version " + p.getApplicationVersion() + " and we need to clean up config file");
// Delete settings file, and restart the application
settingsFile.close();
DeleteSdlConfigOnUpgradeAndRestart(p);
}
Save(p);
}
settingsLoaded = true;
System.out.println("libSDL: Settings.Load(): loaded settings successfully");
settingsFile.close();
return;
} catch( FileNotFoundException e ) {