Commit 158860d7 authored by Lisa's avatar Lisa
Browse files

Two queries fixed

parent 9dd8001c
......@@ -498,7 +498,7 @@ QUuid Backend::searchPackages(const QStringList &pkgs, SearchType type)
sql += "description=\"" + (*it) + "\" ";
break;
case SearchDescriptionLike:
sql += "description LIKE\"%" + (*it) + "%\" ";
sql += "description LIKE \"%" + (*it) + "%\" ";
break;
case SearchNameAndDescriptionEqual:
sql += "name=\"" + (*it) + "\" OR description=\"" + (*it) + "\" ";
......@@ -511,6 +511,7 @@ QUuid Backend::searchPackages(const QStringList &pkgs, SearchType type)
sql += "OR ";
}
}
return queryPackages(sql);
}
......
......@@ -503,7 +503,7 @@ bool Package::isInstalled() const
if (d->database == Akabei::Backend::instance()->localDatabase())
return true;
QString sql = "SELECT * FROM packages WHERE name=" + d->name;
QString sql = "SELECT * FROM packages WHERE name=\"" + d->name + "\"";
QList<Package*> l = Akabei::Backend::instance()->localDatabase()->queryPackages(sql);
return (l.size() > 0) && (l.first()->version() >= version());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment