Remove zip files afer successfully installing an addon (#362).

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9535 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2011-08-16 21:50:32 +00:00
parent 782ba00cbc
commit 8e929bcb29

View File

@@ -310,11 +310,18 @@ bool AddonsManager::install(const Addon &addon)
if (!success)
{
// TODO: show a message in the interface
std::cerr << "[Addons] Failed to unzip '" << from << "' to '"
std::cerr << "[addons] Failed to unzip '" << from << "' to '"
<< to << "'\n";
std::cerr << "[addons] Zip file will not be removed.\n";
return false;
}
if(!file_manager->removeFile(from))
{
std::cerr << "[addons] Problems removing temporary file '"
<< from << "'.\n";
}
int index = getAddonIndex(addon.getId());
assert(index>=0 && index < (int)m_addons_list.getData().size());
m_addons_list.getData()[index].setInstalled(true);
@@ -347,7 +354,7 @@ bool AddonsManager::install(const Addon &addon)
*/
bool AddonsManager::uninstall(const Addon &addon)
{
std::cout << "[Addons] Uninstalling <"
std::cout << "[addons] Uninstalling <"
<< core::stringc(addon.getName()).c_str() << ">\n";
// addon is a const reference, and to avoid removing the const, we