1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Fix account selection on import if file doesn't contain global settings

This commit is contained in:
cketti 2011-06-08 22:28:34 +02:00
parent 8d97287ffd
commit 4d11c80f65

View File

@ -1297,13 +1297,19 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
boolean includeGlobals = mImportContents.globalSettings ? pos.get(0) : false;
List<String> accountUuids = new ArrayList<String>();
for (int i = 1; i < count; i++) {
int start = mImportContents.globalSettings ? 1 : 0;
for (int i = start; i < count; i++) {
if (pos.get(i)) {
accountUuids.add(mImportContents.accounts.get(i-1).uuid);
accountUuids.add(mImportContents.accounts.get(i-start).uuid);
}
}
boolean overwrite = false; //TODO: get value from dialog
/*
* TODO: Think some more about this. Overwriting could change the store
* type. This requires some additional code in order to work smoothly
* while the app is running.
*/
boolean overwrite = false;
dialog.dismiss();
new ImportAsyncTask(includeGlobals, accountUuids, overwrite, mEncryptionKey, mInputStream).execute();