Merge pull request #1002 from k9mail/GH-745_save_attachments_to_download_folder

Use Download folder as default for saving attachments
This commit is contained in:
cketti 2016-01-07 03:23:55 +01:00
commit ac131a2919
3 changed files with 8 additions and 5 deletions

View file

@ -731,7 +731,8 @@ public class K9 extends Application {
sSplitViewMode = SplitViewMode.valueOf(splitViewMode);
}
mAttachmentDefaultPath = sprefs.getString("attachmentdefaultpath", Environment.getExternalStorageDirectory().toString());
mAttachmentDefaultPath = sprefs.getString("attachmentdefaultpath",
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString());
sUseBackgroundAsUnreadIndicator = sprefs.getBoolean("useBackgroundAsUnreadIndicator", true);
sThreadedViewEnabled = sprefs.getBoolean("threadedView", true);
fontSizes.load(sprefs);

View file

@ -43,7 +43,9 @@ public class GlobalSettings {
new V(1, new BooleanSetting(false))
));
s.put("attachmentdefaultpath", Settings.versions(
new V(1, new DirectorySetting(Environment.getExternalStorageDirectory().toString()))
new V(1, new DirectorySetting(Environment.getExternalStorageDirectory())),
new V(41, new DirectorySetting(Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_DOWNLOADS)))
));
s.put("backgroundOperations", Settings.versions(
new V(1, new EnumSetting<K9.BACKGROUND_OPS>(
@ -555,8 +557,8 @@ public class GlobalSettings {
* A directory on the file system.
*/
public static class DirectorySetting extends SettingsDescription {
public DirectorySetting(String defaultValue) {
super(defaultValue);
public DirectorySetting(File defaultPath) {
super(defaultPath.toString());
}
@Override

View file

@ -35,7 +35,7 @@ public class Settings {
*
* @see SettingsExporter
*/
public static final int VERSION = 40;
public static final int VERSION = 41;
public static Map<String, Object> validate(int version, Map<String,
TreeMap<Integer, SettingsDescription>> settings,