From 9a665b2affce7e267cbaa372d11b92f569fd85d5 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Fri, 1 Jan 2016 22:06:02 +0100 Subject: [PATCH] opkg_manager: do not put bad packages into package list "bad" packages will be ignored later anyway, so to speed things up and save memory, do not even put them into the package list. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9eeeb087437d925cc3a598ecb2b83356058c520a Author: Stefan Seyfried Date: 2016-01-01 (Fri, 01 Jan 2016) ------------------ This commit was generated by Migit --- src/gui/opkg_manager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 4b466262b..45c51c56e 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -396,6 +396,7 @@ void COPKGManager::updateMenu() getPkgData(OM_LIST_INSTALLED); getPkgData(OM_LIST_UPGRADEABLE); for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++) { + /* this should no longer trigger at all */ if (badpackage(it->second.name)) continue; it->second.forwarder->iconName_Info_right = ""; @@ -528,6 +529,7 @@ int COPKGManager::showMenu() pkg_vec.clear(); for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++) { + /* this should no longer trigger at all */ if (badpackage(it->second.name)) continue; it->second.forwarder = new CMenuForwarder(it->second.desc, true, NULL , this, it->second.name.c_str()); @@ -647,10 +649,12 @@ void COPKGManager::getPkgData(const int pkg_content_id) continue; switch (pkg_content_id) { - case OM_LIST: { + case OM_LIST: + /* do not even put "bad" packages into the list to save memory */ + if (badpackage(name)) + continue; pkg_map[name] = pkg(name, line, line); break; - } case OM_LIST_INSTALLED: { map::iterator it = pkg_map.find(name); if (it != pkg_map.end())