1
0
mirror of https://github.com/etesync/android synced 2024-11-22 07:58:09 +00:00

Bug fixes

* ignore non-OK values in multi-status response (fixes #35)
* fixes wrong entries in setup calendar/addressbook selection
This commit is contained in:
rfc2822 2013-10-26 23:45:10 +02:00
parent 03a85da6e3
commit 42929ddcf1
4 changed files with 21 additions and 32 deletions

View File

@ -84,8 +84,8 @@ public class SelectCollectionsAdapter extends BaseAdapter implements ListAdapter
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView != null)
return convertView;
/*if (convertView != null)
return convertView;*/
LayoutInflater inflater = LayoutInflater.from(parent.getContext());

View File

@ -51,8 +51,6 @@ public class SelectCollectionsFragment extends ListFragment {
final ListView listView = getListView();
listView.setPadding(20, 30, 20, 30);
// TODO setEmptyView
View header = getActivity().getLayoutInflater().inflate(R.layout.select_collections_header, null);
listView.addHeaderView(header);

View File

@ -13,7 +13,6 @@ import org.apache.http.HttpException;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.AuthState;
import org.apache.http.auth.Credentials;

View File

@ -58,7 +58,6 @@ public class WebDavCollection extends WebDavResource {
/* collection operations */
public boolean propfind(HttpPropfind.Mode mode) throws IOException, InvalidDavResponseException, HttpException {
HttpPropfind propfind = new HttpPropfind(location, mode);
HttpResponse response = client.execute(propfind);
@ -157,37 +156,30 @@ public class WebDavCollection extends WebDavResource {
members.clear();
for (DavResponse singleResponse : multistatus.response) {
String href = singleResponse.getHref().href;
URI href;
try {
href = location.resolve(singleResponse.getHref().href);
} catch(IllegalArgumentException ex) {
Log.w(TAG, "Ignoring illegal member URI in multi-status response", ex);
continue;
}
// about which resource is this response?
WebDavResource referenced = null;
if (sameURL(location, href)) { // -> ourselves
referenced = this;
} else { // -> about a member
referenced = new WebDavResource(this, href);
members.add(referenced);
}
for (DavPropstat singlePropstat : singleResponse.getPropstat()) {
StatusLine status = BasicLineParser.parseStatusLine(singlePropstat.status, new BasicLineParser());
try {
checkResponse(status);
} catch(NotFoundException e) {
// ignore information about missing properties etc.
if (status.getStatusCode()/100 != 1 && status.getStatusCode()/100 != 2)
continue;
}
WebDavResource referenced = null;
URI thisURI;
try {
thisURI = location.resolve(href);
} catch(IllegalArgumentException ex) {
Log.w(TAG, "Server returned illegal URI", ex);
continue;
}
if (sameURL(location, thisURI)) {
// response is about this property
referenced = this;
} else {
// response is about a member, add it
URI uri = location.resolve(href);
referenced = new WebDavResource(this, uri);
members.add(referenced);
}
DavProp prop = singlePropstat.prop;