Merge commit 'refs/merge-requests/47' of gitorious.org:f-droid/fdroidclient
This commit is contained in:
commit
232815cce8
@ -433,8 +433,9 @@ public class DB {
|
|||||||
// key in sqlite - table must be recreated)
|
// key in sqlite - table must be recreated)
|
||||||
if (oldVersion < 20) {
|
if (oldVersion < 20) {
|
||||||
List<Repo> oldrepos = new ArrayList<Repo>();
|
List<Repo> oldrepos = new ArrayList<Repo>();
|
||||||
Cursor c = db.rawQuery("select address, inuse, pubkey from "
|
Cursor c = db.query(TABLE_REPO,
|
||||||
+ TABLE_REPO, null);
|
new String[] { "address", "inuse", "pubkey" },
|
||||||
|
null, null, null, null, null);
|
||||||
c.moveToFirst();
|
c.moveToFirst();
|
||||||
while (!c.isAfterLast()) {
|
while (!c.isAfterLast()) {
|
||||||
Repo repo = new Repo();
|
Repo repo = new Repo();
|
||||||
@ -558,8 +559,8 @@ public class DB {
|
|||||||
List<String> result = new ArrayList<String>();
|
List<String> result = new ArrayList<String>();
|
||||||
Cursor c = null;
|
Cursor c = null;
|
||||||
try {
|
try {
|
||||||
c = db.rawQuery("select distinct category from " + TABLE_APP
|
c = db.query(true, TABLE_APP, new String[] { "category" },
|
||||||
+ " order by category", null);
|
null, null, null, null, "category", null);
|
||||||
c.moveToFirst();
|
c.moveToFirst();
|
||||||
while (!c.isAfterLast()) {
|
while (!c.isAfterLast()) {
|
||||||
String s = c.getString(0);
|
String s = c.getString(0);
|
||||||
@ -1048,8 +1049,8 @@ public class DB {
|
|||||||
values.put("compatible", upapk.compatible ? 1 : 0);
|
values.put("compatible", upapk.compatible ? 1 : 0);
|
||||||
if (oldapk != null) {
|
if (oldapk != null) {
|
||||||
db.update(TABLE_APK, values,
|
db.update(TABLE_APK, values,
|
||||||
"id = ? and vercode = " + Integer.toString(oldapk.vercode),
|
"id = ? and vercode = ?",
|
||||||
new String[] { oldapk.id });
|
new String[] { oldapk.id, Integer.toString(oldapk.vercode) });
|
||||||
} else {
|
} else {
|
||||||
db.insert(TABLE_APK, null, values);
|
db.insert(TABLE_APK, null, values);
|
||||||
}
|
}
|
||||||
@ -1062,7 +1063,7 @@ public class DB {
|
|||||||
try {
|
try {
|
||||||
c = db.query(TABLE_REPO, new String[] { "address", "name",
|
c = db.query(TABLE_REPO, new String[] { "address", "name",
|
||||||
"description", "inuse", "priority", "pubkey", "lastetag" },
|
"description", "inuse", "priority", "pubkey", "lastetag" },
|
||||||
"id = " + Integer.toString(id), null, null, null, null);
|
"id = ?", new String[] { Integer.toString(id) }, null, null, null);
|
||||||
if (!c.moveToFirst())
|
if (!c.moveToFirst())
|
||||||
return null;
|
return null;
|
||||||
Repo repo = new Repo();
|
Repo repo = new Repo();
|
||||||
@ -1086,9 +1087,9 @@ public class DB {
|
|||||||
List<Repo> repos = new ArrayList<Repo>();
|
List<Repo> repos = new ArrayList<Repo>();
|
||||||
Cursor c = null;
|
Cursor c = null;
|
||||||
try {
|
try {
|
||||||
c = db.rawQuery("select id, address, name, description, inuse, "
|
c = db.query(TABLE_REPO, new String[] { "id", "address", "name",
|
||||||
+ "priority, pubkey, lastetag from " + TABLE_REPO
|
"description", "inuse", "priority", "pubkey", "lastetag" },
|
||||||
+ " order by priority", null);
|
null, null, null, null, "priority");
|
||||||
c.moveToFirst();
|
c.moveToFirst();
|
||||||
while (!c.isAfterLast()) {
|
while (!c.isAfterLast()) {
|
||||||
Repo repo = new Repo();
|
Repo repo = new Repo();
|
||||||
@ -1159,8 +1160,9 @@ public class DB {
|
|||||||
// connected to it...
|
// connected to it...
|
||||||
Cursor c = null;
|
Cursor c = null;
|
||||||
try {
|
try {
|
||||||
c = db.rawQuery("select id from " + TABLE_REPO
|
c = db.query(TABLE_REPO, new String[] { "id" },
|
||||||
+ " where address = '" + address + "'", null);
|
"address = ?", new String[] { address },
|
||||||
|
null, null, null, null);
|
||||||
c.moveToFirst();
|
c.moveToFirst();
|
||||||
if (!c.isAfterLast()) {
|
if (!c.isAfterLast()) {
|
||||||
db.delete(TABLE_APK, "repo = ?",
|
db.delete(TABLE_APK, "repo = ?",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user