storage: obtain call from a random cursor

precision_debug
Georg Lukas 2011-05-21 00:48:44 +02:00
rodzic 365c1258c7
commit 2d43b6fb58
1 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -85,6 +85,19 @@ object StorageDatabase {
}
singleton
}
def cursor2call(c : Cursor) : String = {
val msgidx = c.getColumnIndex(Post.MESSAGE)
val callidx = c.getColumnIndex(Position.CALL)
if (msgidx != -1 && callidx == -1) { // Post table
val t = c.getInt(Post.COLUMN_TYPE)
if (t == Post.TYPE_POST || t == Post.TYPE_INCMG)
c.getString(msgidx).split(">")(0)
else
null
} else
c.getString(Position.COLUMN_CALL)
}
}
class StorageDatabase(context : Context) extends