COPKGManager: remember for last selected update directory

Use g_settings to handle local package directory.
Extra settings handler via gui for this directory is not intended. Default update directory
is the same like in flash settings.


Origin commit data
------------------
Commit: 1606cf8a30
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-11-28 (Fri, 28 Nov 2014)
This commit is contained in:
2014-11-28 09:19:38 +01:00
parent 866772900a
commit 0b67f5bba9
4 changed files with 12 additions and 5 deletions

View File

@@ -90,7 +90,7 @@ COPKGManager::COPKGManager()
list_installed_done = false;
list_upgradeable_done = false;
expert_mode = false;
local_dir = g_settings.update_dir.c_str();
local_dir = &g_settings.update_dir_opkg;
CFileHelpers::createDir("/tmp/.opkg");
}
@@ -148,11 +148,11 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey)
CFileBrowser fileBrowser;
fileBrowser.Filter = &fileFilter;
if (fileBrowser.exec(local_dir.c_str()))
if (fileBrowser.exec((*local_dir).c_str()))
{
string pgk_name = fileBrowser.getSelectedFile()->Name;
int r = execCmd(pkg_types[OM_INSTALL] + pgk_name, true, true);
local_dir = fileBrowser.getCurrentDir();
*local_dir = fileBrowser.getCurrentDir();
if (r) {
showError(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL), strerror(errno), pgk_name);
} else