Merge commit 'refs/merge-requests/49' of gitorious.org:f-droid/fdroidclient

This commit is contained in:
Daniel Martí 2013-06-27 12:50:10 +02:00
commit bab1e6536c
2 changed files with 7 additions and 10 deletions

View File

@ -502,8 +502,7 @@ public class AppDetails extends ListActivity {
return true;
DB.Apk curver = app.getCurrentVersion();
List<MenuItem> toShow = new ArrayList<MenuItem>(2);
if (app.installedVersion != null && curver != null
&& !app.installedVersion.equals(curver.version)) {
if (app.hasUpdates == true) {
toShow.add(menu.add(Menu.NONE, INSTALL, 0, R.string.menu_update).setIcon(
R.drawable.ic_menu_refresh));
}

View File

@ -736,16 +736,14 @@ public class DB {
if (getinstalledinfo) {
// We'll say an application has updates if it's installed AND the
// installed version is not the 'current' one AND the installed
// version is older than the current one.
// version is older than the current one
for (App app : result) {
Apk curver = app.getCurrentVersion();
if (curver != null && app.installedVersion != null
&& !app.installedVersion.equals(curver.version)) {
if (app.installedVerCode < curver.vercode) {
app.hasUpdates = true;
app.updateVersion = curver.version;
}
if (curver != null
&& app.installedVersion != null
&& app.installedVerCode < curver.vercode) {
app.hasUpdates = true;
app.updateVersion = curver.version;
}
}
}