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 ) {

View File

@@ -14,6 +14,10 @@ SwVideoMode=y
SdlVideoResize=y
SdlVideoResizeKeepAspect=y
CompatibilityHacks=n
CompatibilityHacksStaticInit=n
CompatibilityHacksTextInputEmulatesHwKeyboard=n
CompatibilityHacksPreventAudioChopping=n
CompatibilityHacksAppIgnoresAudioBufferSize=n
AppUsesMouse=y
AppNeedsTwoButtonMouse=y
ShowMouseCursor=n
@@ -21,7 +25,7 @@ ForceRelativeMouseMode=n
AppNeedsArrowKeys=n
AppNeedsTextInput=y
AppUsesJoystick=n
AppHandlesJoystickSensitivity=n
AppUsesAccelerometer=n
AppUsesMultitouch=n
NonBlockingSwapBuffers=n
RedefinedKeys="LCTRL c NO_REMAP NO_REMAP e"
@@ -32,9 +36,11 @@ StartupMenuButtonTimeout=2000
HiddenMenuOptions=''
FirstStartMenuOptions=''
MultiABI=y
AppMinimumRAM=0
AppVersionCode=0701
AppVersionName="0.7.0.1"
ResetSdlConfigForThisVersion=y
DeleteFilesOnUpgrade="%"
CompiledLibraries="sdl_mixer sdl_ttf ogg vorbis openal png python"
CustomBuildScript=n
AppCflags='-fexceptions -finline-functions -O3 -DSTATIC_LINK=Yes -DHAVE_SNPRINTF'
@@ -42,3 +48,7 @@ AppLdflags=''
AppSubdirsBuild='gemrb/gemrb/*'
AppCmdline='GemRB'
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
MinimumScreenSize=m
AdmobPublisherId=n
AdmobTestDeviceId=
AdmobBannerSize=