diff --git a/src/keepass2android/app/App.cs b/src/keepass2android/app/App.cs index d2aeccb1..3bb901d5 100644 --- a/src/keepass2android/app/App.cs +++ b/src/keepass2android/app/App.cs @@ -435,7 +435,6 @@ namespace keepass2android ///Application class for Keepass2Android: Contains static Database variable to be used by all components. #if NoNet [Application(Debuggable=false, Label=AppNames.AppName)] - todo: remove caching preference #else #if RELEASE [Application(Debuggable=false, Label=AppNames.AppName)] diff --git a/src/keepass2android/settings/AppSettingsActivity.cs b/src/keepass2android/settings/AppSettingsActivity.cs index dab20311..b2ecad6b 100644 --- a/src/keepass2android/settings/AppSettingsActivity.cs +++ b/src/keepass2android/settings/AppSettingsActivity.cs @@ -44,7 +44,21 @@ namespace keepass2android FindPreference(GetString(Resource.String.keyfile_key)).PreferenceChange += OnRememberKeyFileHistoryChanged; FindPreference(GetString(Resource.String.ShowUnlockedNotification_key)).PreferenceChange += OnShowUnlockedNotificationChanged;; - FindPreference(GetString(Resource.String.UseOfflineCache_key)).PreferenceChange += OnUseOfflineCacheChanged; + + Preference cachingPreference = FindPreference(GetString(Resource.String.UseOfflineCache_key)); + cachingPreference.PreferenceChange += OnUseOfflineCacheChanged; + +#if NoNet + try + { + ((PreferenceCategory) FindPreference(GetString(Resource.String.db_key))).RemovePreference(cachingPreference); + } + catch (Exception ex) + { + Kp2aLog.Log(ex.ToString()); + } +#endif + FindPreference(GetString(Resource.String.db_key)).Enabled = false; }