Store icons in addons/icons and zip files in addons/tmp.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7314 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-01-06 20:50:23 +00:00
parent ff97d89c49
commit e7d5b2314a
2 changed files with 8 additions and 7 deletions

View File

@ -174,11 +174,10 @@ void AddonsManager::install(const Addon &addon)
file_manager->checkAndCreateDirForAddons(id, addon.getType()+ "s/");
//extract the zip in the addons folder called like the addons name
std::string dest_file = file_manager->getAddonsDir() + "/"
+ addon.getType()+ "s/" + id + "/" ;
std::string base_name = StringUtils::getBasename(addon.getZipFileName());
std::string from = file_manager->getAddonsFile(base_name);
std::string to = dest_file;
std::string from = file_manager->getAddonsFile("tmp/"+base_name);
std::string to = file_manager->getAddonsDir() + "/"
+ addon.getType()+ "s/" + id + "/" ;
m_str_state = "Unzip the addons...";

View File

@ -83,7 +83,7 @@ void * AddonsLoading::downloadIcon( void * pthis)
std::string icon_path = me->m_addon.getIcon();
// FIXME: addons_loading might be removed before this finishes!
if(network_http->downloadFileSynchron(icon_path, icon_name))
if(network_http->downloadFileSynchron(icon_path, "icons/"+icon_name))
{
me->m_icon_loaded.set(ICON_LOADED);
}
@ -175,7 +175,8 @@ void AddonsLoading::onUpdate(float delta)
// See if the icon is loaded (but not yet displayed)
if(m_icon_loaded.get()==ICON_LOADED)
{
const std::string icon = StringUtils::getBasename(m_addon.getIcon());
const std::string icon = "icons/"
+ StringUtils::getBasename(m_addon.getIcon());
m_icon->setImage( file_manager->getAddonsFile(icon).c_str(),
IconButtonWidget::ICON_PATH_TYPE_ABSOLUTE );
m_icon_loaded.set(ICON_SHOWN);
@ -203,7 +204,8 @@ void AddonsLoading::close()
void AddonsLoading::startInstall()
{
std::string file = m_addon.getZipFileName();
std::string save = StringUtils::getBasename(m_addon.getZipFileName());
std::string save = "tmp/"
+ StringUtils::getBasename(m_addon.getZipFileName());
network_http->downloadFileAsynchron(file, save);
} // startInstall