|
|
@ -177,7 +177,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
private SwitchCompat swAnalyze;
|
|
|
|
private SwitchCompat swAnalyze;
|
|
|
|
private SwitchCompat swAutoVacuum;
|
|
|
|
private SwitchCompat swAutoVacuum;
|
|
|
|
private SwitchCompat swSyncExtra;
|
|
|
|
private SwitchCompat swSyncExtra;
|
|
|
|
private SwitchCompat swUnicode61;
|
|
|
|
|
|
|
|
private TextView tvSqliteCache;
|
|
|
|
private TextView tvSqliteCache;
|
|
|
|
private SeekBar sbSqliteCache;
|
|
|
|
private SeekBar sbSqliteCache;
|
|
|
|
private TextView tvChunkSize;
|
|
|
|
private TextView tvChunkSize;
|
|
|
@ -383,7 +382,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
swAnalyze = view.findViewById(R.id.swAnalyze);
|
|
|
|
swAnalyze = view.findViewById(R.id.swAnalyze);
|
|
|
|
swAutoVacuum = view.findViewById(R.id.swAutoVacuum);
|
|
|
|
swAutoVacuum = view.findViewById(R.id.swAutoVacuum);
|
|
|
|
swSyncExtra = view.findViewById(R.id.swSyncExtra);
|
|
|
|
swSyncExtra = view.findViewById(R.id.swSyncExtra);
|
|
|
|
swUnicode61 = view.findViewById(R.id.swUnicode61);
|
|
|
|
|
|
|
|
tvSqliteCache = view.findViewById(R.id.tvSqliteCache);
|
|
|
|
tvSqliteCache = view.findViewById(R.id.tvSqliteCache);
|
|
|
|
sbSqliteCache = view.findViewById(R.id.sbSqliteCache);
|
|
|
|
sbSqliteCache = view.findViewById(R.id.sbSqliteCache);
|
|
|
|
ibSqliteCache = view.findViewById(R.id.ibSqliteCache);
|
|
|
|
ibSqliteCache = view.findViewById(R.id.ibSqliteCache);
|
|
|
@ -507,7 +505,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
SQLiteDatabase sdb = Fts4DbHelper.getInstance(context);
|
|
|
|
SQLiteDatabase sdb = Fts4DbHelper.getInstance(context);
|
|
|
|
Fts4DbHelper.delete(sdb);
|
|
|
|
Fts4DbHelper.delete(sdb);
|
|
|
|
Fts4DbHelper.optimize(sdb);
|
|
|
|
Fts4DbHelper.optimize(sdb);
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
} catch (SQLiteDatabaseCorruptException ex) {
|
|
|
|
Log.e(ex);
|
|
|
|
Log.e(ex);
|
|
|
|
Fts4DbHelper.delete(context);
|
|
|
|
Fts4DbHelper.delete(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1184,37 +1182,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
swUnicode61.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onCheckedChanged(CompoundButton v, boolean checked) {
|
|
|
|
|
|
|
|
prefs.edit()
|
|
|
|
|
|
|
|
.putBoolean("fts", false)
|
|
|
|
|
|
|
|
.putBoolean("sqlite_unicode61", checked)
|
|
|
|
|
|
|
|
.apply();
|
|
|
|
|
|
|
|
WorkerFts.init(getContext(), true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected Void onExecute(Context context, Bundle args) throws Throwable {
|
|
|
|
|
|
|
|
Fts4DbHelper.delete(context);
|
|
|
|
|
|
|
|
Fts5DbHelper.delete(context);
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onExecuted(Bundle args, Void data) {
|
|
|
|
|
|
|
|
prefs.edit().putBoolean("fts", true).apply();
|
|
|
|
|
|
|
|
WorkerFts.init(getContext(), true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
|
|
|
Log.unexpectedError(getParentFragmentManager(), ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}.execute(FragmentOptionsMisc.this, new Bundle(), "unicode61");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sbSqliteCache.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
sbSqliteCache.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
@ -2083,7 +2050,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
swAnalyze.setChecked(prefs.getBoolean("sqlite_analyze", true));
|
|
|
|
swAnalyze.setChecked(prefs.getBoolean("sqlite_analyze", true));
|
|
|
|
swAutoVacuum.setChecked(prefs.getBoolean("sqlite_auto_vacuum", false));
|
|
|
|
swAutoVacuum.setChecked(prefs.getBoolean("sqlite_auto_vacuum", false));
|
|
|
|
swSyncExtra.setChecked(prefs.getBoolean("sqlite_sync_extra", true));
|
|
|
|
swSyncExtra.setChecked(prefs.getBoolean("sqlite_sync_extra", true));
|
|
|
|
swUnicode61.setChecked(prefs.getBoolean("sqlite_unicode61", false));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int sqlite_cache = prefs.getInt("sqlite_cache", DB.DEFAULT_CACHE_SIZE);
|
|
|
|
int sqlite_cache = prefs.getInt("sqlite_cache", DB.DEFAULT_CACHE_SIZE);
|
|
|
|
Integer cache_size = DB.getCacheSizeKb(getContext());
|
|
|
|
Integer cache_size = DB.getCacheSizeKb(getContext());
|
|
|
|