mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 03:32:16 -05:00
Removed display of path prefix. System now pulls all folders/subfolders. Does not display in a hierarchy, but will load messages from each folder. Only the final folder name is displayed instead of the path off of Inbox right now
This commit is contained in:
parent
453406a5a5
commit
c544596d8f
@ -210,6 +210,9 @@ public class AccountSetupIncoming extends Activity implements OnClickListener {
|
||||
serverLabelView.setText(R.string.account_setup_incoming_webdav_server_label);
|
||||
mAccountPorts = webdavPorts;
|
||||
mAccountSchemes = webdavSchemes;
|
||||
|
||||
/** Hide the unnecessary fields */
|
||||
findViewById(R.id.imap_path_prefix_section).setVisibility(View.GONE);
|
||||
} else {
|
||||
throw new Error("Unknown account type: " + mAccount.getStoreUri());
|
||||
}
|
||||
|
@ -80,6 +80,7 @@ public class WebDavStore extends Store {
|
||||
private long mLastAuth = -1; /* Stores the timestamp of last auth */
|
||||
private long mAuthTimeout = 5 * 60;
|
||||
|
||||
private HashMap<String, WebDavFolder> mFolderList = new HashMap<String, WebDavFolder>();
|
||||
/**
|
||||
* webdav://user:password@server:port CONNECTION_SECURITY_NONE
|
||||
* webdav+tls://user:password@server:port CONNECTION_SECURITY_TLS_OPTIONAL
|
||||
@ -216,10 +217,19 @@ public class WebDavStore extends Store {
|
||||
for (int i = 0; i < urlLength; i++) {
|
||||
String[] urlParts = folderUrls[i].split("/");
|
||||
String folderName = urlParts[urlParts.length - 1];
|
||||
String fullUrl = "";
|
||||
WebDavFolder wdFolder;
|
||||
|
||||
if (folderName.equalsIgnoreCase(k9.INBOX)) {
|
||||
folderName = "INBOX";
|
||||
}
|
||||
folderList.add(getFolder(java.net.URLDecoder.decode(folderName, "UTF-8")));
|
||||
|
||||
folderName = java.net.URLDecoder.decode(folderName, "UTF-8");
|
||||
wdFolder = new WebDavFolder(folderName);
|
||||
wdFolder.setUrl(folderUrls[i]);
|
||||
folderList.add(wdFolder);
|
||||
this.mFolderList.put(folderName, wdFolder);
|
||||
//folderList.add(getFolder(java.net.URLDecoder.decode(folderName, "UTF-8")));
|
||||
}
|
||||
} catch (SAXException se) {
|
||||
Log.e(k9.LOG_TAG, "Error with SAXParser " + se);
|
||||
@ -239,7 +249,11 @@ public class WebDavStore extends Store {
|
||||
@Override
|
||||
public Folder getFolder(String name) throws MessagingException {
|
||||
WebDavFolder folder;
|
||||
|
||||
if ((folder = this.mFolderList.get(name)) == null) {
|
||||
folder = new WebDavFolder(name);
|
||||
}
|
||||
|
||||
return folder;
|
||||
}
|
||||
|
||||
@ -252,7 +266,8 @@ public class WebDavStore extends Store {
|
||||
buffer.append("<?xml version='1.0' ?>");
|
||||
buffer.append("<a:searchrequest xmlns:a='DAV:'><a:sql>\r\n");
|
||||
buffer.append("SELECT \"DAV:ishidden\"\r\n");
|
||||
buffer.append(" FROM \"\"\r\n");
|
||||
// buffer.append(" FROM \"\"\r\n");
|
||||
buffer.append(" FROM SCOPE('deep traversal of \""+this.mUrl+"\"')\r\n");
|
||||
buffer.append(" WHERE \"DAV:ishidden\"=False AND \"DAV:isfolder\"=True\r\n");
|
||||
buffer.append("</a:sql></a:searchrequest>\r\n");
|
||||
|
||||
@ -536,6 +551,12 @@ public class WebDavStore extends Store {
|
||||
this.mFolderUrl = WebDavStore.this.mUrl + encodedName;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
if (url != null) {
|
||||
this.mFolderUrl = url;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open(OpenMode mode) throws MessagingException {
|
||||
if (needAuth()) {
|
||||
|
Loading…
Reference in New Issue
Block a user