From 3204a2f038d4d0cab5fd75ec0df476aee4b3a925 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Mar 2016 08:12:04 +0100 Subject: [PATCH] COPKGManager: generate a readable string for installation time Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/33135a5bc55f5ea88220bce009cc8a5dfc87f30e Author: Thilo Graf Date: 2016-03-02 (Wed, 02 Mar 2016) --- src/gui/opkg_manager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 4afbe1df4..91e6320ef 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -174,6 +174,16 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey) //show package info... bool is_installed = pkg_vec[selected]->installed; string infostr = getPkgInfo(pkg_vec[selected]->name, "", is_installed /*status or info*/); + + //if available, generate a readable string for installation time + if (is_installed){ + string tstr = getPkgInfo(pkg_vec[selected]->name, "Installed-Time", is_installed); + stringstream sstr(tstr); + time_t tval; sstr >> tval; + string newstr = asctime(localtime(&tval)); + infostr = str_replace(tstr, newstr, infostr); + } + DisplayInfoMessage(infostr.c_str()); return res; }