COPKGManager: generate a readable string for installation time

This commit is contained in:
2016-03-02 08:12:04 +01:00
parent 8a12d3ef8d
commit 33135a5bc5

View File

@@ -174,6 +174,16 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey)
//show package info... //show package info...
bool is_installed = pkg_vec[selected]->installed; bool is_installed = pkg_vec[selected]->installed;
string infostr = getPkgInfo(pkg_vec[selected]->name, "", is_installed /*status or info*/); 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()); DisplayInfoMessage(infostr.c_str());
return res; return res;
} }