1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Merge remote-tracking branch 'refs/remotes/unread/master' into unread

This commit is contained in:
Fiouz 2011-06-02 20:20:56 +02:00
commit d3cf49a5e4
2 changed files with 19 additions and 0 deletions

1
local.properties Normal file
View File

@ -0,0 +1 @@
sdk.dir=/opt/android-sdk-linux_x86

View File

@ -17,6 +17,7 @@ import android.content.ContentProvider;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.UriMatcher;
import android.database.CharArrayBuffer;
import android.database.ContentObserver;
@ -49,6 +50,7 @@ import com.fsck.k9.mail.store.LocalStore;
public class MessageProvider extends ContentProvider {
public static interface MessageColumns extends BaseColumns {
/**
* The number of milliseconds since Jan. 1, 1970, midnight GMT.
*
@ -71,6 +73,11 @@ public class MessageProvider extends ContentProvider {
*/
String PREVIEW = "preview";
/**
* <P>Type: BOOLEAN</P>
*/
String UNREAD = "unread";
String ACCOUNT = "account";
String URI = "uri";
String DELETE_URI = "delUri";
@ -181,6 +188,14 @@ public class MessageProvider extends ContentProvider {
}
}
public static class UnreadExtractor implements FieldExtractor<MessageInfoHolder, Boolean> {
@Override
public Boolean getField(final MessageInfoHolder source) {
return !source.read;
}
}
/**
* @deprecated having an incremential value has no real interest,
* implemented for compatibility only
@ -288,6 +303,8 @@ public class MessageProvider extends ContentProvider {
extractors.put(field, new DeleteUriExtractor());
} else if (MessageColumns.ACCOUNT.equals(field)) {
extractors.put(field, new AccountExtractor());
} else if (MessageColumns.UNREAD.equals(field)) {
extractors.put(field, new UnreadExtractor());
} else if (MessageColumns.INCREMENT.equals(field)) {
extractors.put(field, new IncrementExtractor());
}
@ -803,6 +820,7 @@ public class MessageProvider extends ContentProvider {
MessageColumns.SUBJECT,
MessageColumns.PREVIEW,
MessageColumns.ACCOUNT,
MessageColumns.UNREAD,
MessageColumns.URI,
MessageColumns.DELETE_URI
};