aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
diff options
context:
space:
mode:
authorAndreas Straub <andy@strb.org>2015-07-21 01:52:22 +0200
committerAndreas Straub <andy@strb.org>2015-07-21 01:52:22 +0200
commitb7ff2c34614a92f3893732338f75cb0f7fe77d32 (patch)
tree4ea1f27644c6f4b1bc9cc23b5479eebe0c7fda45 /src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
parent639ebd644ba7f6e05bfcb09ad1f616d0f433b5a6 (diff)
Use properly fixed numeral values in Trust enum
Why, oh God, why?! #thanksjamesgosling
Diffstat (limited to 'src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java')
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
index 6091b352..3120c008 100644
--- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
@@ -845,7 +845,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
while(cursor.moveToNext()) {
if ( trust != null &&
cursor.getInt(cursor.getColumnIndex(AxolotlService.SQLiteAxolotlStore.TRUSTED))
- != trust.ordinal()) {
+ != trust.getCode()) {
continue;
}
try {
@@ -864,7 +864,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
String[] args = {
account.getUuid(),
name,
- String.valueOf(AxolotlService.SQLiteAxolotlStore.Trust.TRUSTED.ordinal())
+ String.valueOf(AxolotlService.SQLiteAxolotlStore.Trust.TRUSTED.getCode())
};
return DatabaseUtils.queryNumEntries(db, AxolotlService.SQLiteAxolotlStore.IDENTITIES_TABLENAME,
AxolotlService.SQLiteAxolotlStore.ACCOUNT + " = ?"
@@ -886,7 +886,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
values.put(AxolotlService.SQLiteAxolotlStore.OWN, own ? 1 : 0);
values.put(AxolotlService.SQLiteAxolotlStore.FINGERPRINT, fingerprint);
values.put(AxolotlService.SQLiteAxolotlStore.KEY, base64Serialized);
- values.put(AxolotlService.SQLiteAxolotlStore.TRUSTED, trusted.ordinal());
+ values.put(AxolotlService.SQLiteAxolotlStore.TRUSTED, trusted.getCode());
db.insert(AxolotlService.SQLiteAxolotlStore.IDENTITIES_TABLENAME, null, values);
}
@@ -896,7 +896,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
if (cursor.getCount() > 0) {
cursor.moveToFirst();
int trustValue = cursor.getInt(cursor.getColumnIndex(AxolotlService.SQLiteAxolotlStore.TRUSTED));
- trust = AxolotlService.SQLiteAxolotlStore.Trust.values()[trustValue];
+ trust = AxolotlService.SQLiteAxolotlStore.Trust.fromCode(trustValue);
}
cursor.close();
return trust;
@@ -909,7 +909,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
fingerprint
};
ContentValues values = new ContentValues();
- values.put(AxolotlService.SQLiteAxolotlStore.TRUSTED, trust.ordinal());
+ values.put(AxolotlService.SQLiteAxolotlStore.TRUSTED, trust.getCode());
int rows = db.update(AxolotlService.SQLiteAxolotlStore.IDENTITIES_TABLENAME, values,
AxolotlService.SQLiteAxolotlStore.ACCOUNT + " = ? AND "
+ AxolotlService.SQLiteAxolotlStore.FINGERPRINT + " = ? ",