mirror of https://github.com/moparisthebest/k-9
astyle
This commit is contained in:
parent
d2c56edbd2
commit
d3848d352d
|
@ -702,7 +702,7 @@ public class AccountSettings extends K9PreferenceActivity {
|
|||
|
||||
// In webdav account we use the exact folder name also for inbox,
|
||||
// since it varies because of internationalization
|
||||
if(mAccount.getStoreUri().startsWith("webdav"))
|
||||
if (mAccount.getStoreUri().startsWith("webdav"))
|
||||
mAccount.setAutoExpandFolderName(mAutoExpandFolder.getValue());
|
||||
else
|
||||
mAccount.setAutoExpandFolderName(reverseTranslateFolder(mAutoExpandFolder.getValue()));
|
||||
|
|
|
@ -256,29 +256,29 @@ public class WebDavStore extends Store {
|
|||
|
||||
HashMap<String, String> specialFoldersMap = dataset.getSpecialFolderToUrl();
|
||||
String folderName = getFolderName(specialFoldersMap.get(DAV_MAIL_INBOX_FOLDER));
|
||||
if(folderName != null) {
|
||||
if (folderName != null) {
|
||||
mAccount.setAutoExpandFolderName(folderName);
|
||||
mAccount.setInboxFolderName(folderName);
|
||||
}
|
||||
|
||||
folderName = getFolderName(specialFoldersMap.get(DAV_MAIL_DRAFTS_FOLDER));
|
||||
if(folderName != null)
|
||||
if (folderName != null)
|
||||
mAccount.setDraftsFolderName(folderName);
|
||||
|
||||
folderName = getFolderName(specialFoldersMap.get(DAV_MAIL_TRASH_FOLDER));
|
||||
if(folderName != null)
|
||||
if (folderName != null)
|
||||
mAccount.setTrashFolderName(folderName);
|
||||
|
||||
folderName = getFolderName(specialFoldersMap.get(DAV_MAIL_SPAM_FOLDER));
|
||||
if(folderName != null)
|
||||
if (folderName != null)
|
||||
mAccount.setSpamFolderName(folderName);
|
||||
|
||||
folderName = getFolderName(specialFoldersMap.get(DAV_MAIL_OUTBOX_FOLDER));
|
||||
if(folderName != null)
|
||||
if (folderName != null)
|
||||
mAccount.setOutboxFolderName(folderName);
|
||||
|
||||
folderName = getFolderName(specialFoldersMap.get(DAV_MAIL_SENT_FOLDER));
|
||||
if(folderName != null)
|
||||
if (folderName != null)
|
||||
mAccount.setSentFolderName(folderName);
|
||||
|
||||
/**
|
||||
|
@ -293,7 +293,7 @@ public class WebDavStore extends Store {
|
|||
for (int i = 0; i < folderUrls.length; i++) {
|
||||
String tempUrl = folderUrls[i];
|
||||
WebDavFolder folder = createFolder(tempUrl);
|
||||
if(folder != null)
|
||||
if (folder != null)
|
||||
folderList.add(folder);
|
||||
}
|
||||
|
||||
|
@ -308,13 +308,13 @@ public class WebDavStore extends Store {
|
|||
* @return
|
||||
*/
|
||||
private WebDavFolder createFolder(String folderUrl) {
|
||||
if(folderUrl == null)
|
||||
if (folderUrl == null)
|
||||
return null;
|
||||
|
||||
WebDavFolder wdFolder=null;
|
||||
WebDavFolder wdFolder = null;
|
||||
String folderName = getFolderName(folderUrl);
|
||||
if(folderName != null) {
|
||||
if(!this.mFolderList.containsKey(folderName)) {
|
||||
if (folderName != null) {
|
||||
if (!this.mFolderList.containsKey(folderName)) {
|
||||
wdFolder = new WebDavFolder(this, folderName);
|
||||
wdFolder.setUrl(folderUrl);
|
||||
mFolderList.put(folderName, wdFolder);
|
||||
|
@ -326,28 +326,28 @@ public class WebDavStore extends Store {
|
|||
}
|
||||
|
||||
private String getFolderName(String folderUrl) {
|
||||
if(folderUrl == null)
|
||||
if (folderUrl == null)
|
||||
return null;
|
||||
|
||||
// Here we extract the folder name starting from the complete url.
|
||||
// folderUrl is in the form http://mail.domain.com/exchange/username/foldername
|
||||
// so we need "foldername" which is the string after the fifth slash
|
||||
int folderSlash=-1;
|
||||
for(int j=0; j < 5; j++) {
|
||||
folderSlash=folderUrl.indexOf('/', folderSlash+1);
|
||||
if(folderSlash < 0)
|
||||
int folderSlash = -1;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
folderSlash = folderUrl.indexOf('/', folderSlash + 1);
|
||||
if (folderSlash < 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if(folderSlash > 0) {
|
||||
if (folderSlash > 0) {
|
||||
String folderName;
|
||||
String fullPathName;
|
||||
|
||||
// Removes the final slash if present
|
||||
if(folderUrl.charAt(folderUrl.length()-1) == '/')
|
||||
fullPathName = folderUrl.substring(folderSlash+1, folderUrl.length()-1);
|
||||
if (folderUrl.charAt(folderUrl.length() - 1) == '/')
|
||||
fullPathName = folderUrl.substring(folderSlash + 1, folderUrl.length() - 1);
|
||||
else
|
||||
fullPathName = folderUrl.substring(folderSlash+1);
|
||||
fullPathName = folderUrl.substring(folderSlash + 1);
|
||||
|
||||
// Decodes the url-encoded folder name (i.e. "My%20folder" => "My Folder"
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue