COPKGManager: add member doUpdate()

This commit is contained in:
2014-11-22 22:20:49 +01:00
parent 6a06d5cdc1
commit eb6f972f60
2 changed files with 10 additions and 5 deletions

View File

@@ -271,6 +271,14 @@ bool COPKGManager::hasUpdates()
return ret;
}
void COPKGManager::doUpdate()
{
int r = execCmd(pkg_types[OM_UPDATE]);
if (r) {
showError(g_Locale->getText(LOCALE_OPKG_FAILURE_UPDATE), strerror(errno), pkg_types[OM_UPDATE]);
}
}
void COPKGManager::refreshMenu() {
list_installed_done = false,
list_upgradeable_done = false;
@@ -280,11 +288,7 @@ void COPKGManager::refreshMenu() {
int COPKGManager::showMenu()
{
installed = false;
int r = execCmd(pkg_types[OM_UPDATE]);
if (r) {
showError(g_Locale->getText(LOCALE_OPKG_FAILURE_UPDATE), strerror(errno), pkg_types[OM_UPDATE]);
}
doUpdate();
getPkgData(OM_LIST);
getPkgData(OM_LIST_UPGRADEABLE);