mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-24 10:51:55 +01:00
* Fixed a nice bug: If a game gets removed and is splitted it now also removes the wbf1, wbf2.... files and the folder.
* If a game gets removed it will remove the cover(s) with it
This commit is contained in:
parent
1218528c53
commit
e90613f368
@ -148,13 +148,9 @@ void WBFS_Ext_ClosePart(wbfs_t* part)
|
||||
|
||||
s32 WBFS_Ext_RemoveGame(u8 *discid, char *gamepath)
|
||||
{
|
||||
//split_create(&split, gamepath, 0, 0, true);
|
||||
//split_close(&split);
|
||||
|
||||
DIR *dir_iter;
|
||||
struct dirent *ent;
|
||||
char file[MAX_FAT_PATH];
|
||||
|
||||
char folder[MAX_FAT_PATH];
|
||||
STRCOPY(folder, gamepath);
|
||||
char *p = strrchr(folder, '/');
|
||||
@ -167,8 +163,7 @@ s32 WBFS_Ext_RemoveGame(u8 *discid, char *gamepath)
|
||||
if (ent->d_name[0] == '.') continue;
|
||||
|
||||
snprintf(file, sizeof(file), "%s/%s", folder, ent->d_name);
|
||||
remove(file);
|
||||
break;
|
||||
remove(file);
|
||||
}
|
||||
closedir(dir_iter);
|
||||
unlink(folder);
|
||||
|
@ -1860,3 +1860,25 @@ bool CMenu::MIOSisDML()
|
||||
SAFE_FREE(TMD);
|
||||
return false;
|
||||
}
|
||||
|
||||
void CMenu::RemoveCover( char * id )
|
||||
{
|
||||
FILE *fp = fopen(fmt("%s/%s.png", m_boxPicDir.c_str(), id), "rb");
|
||||
if (fp != 0)
|
||||
{
|
||||
SAFE_CLOSE(fp);
|
||||
remove(fmt("%s/%s.png", m_boxPicDir.c_str(), id));
|
||||
}
|
||||
fp = fopen(fmt("%s/%s.png", m_picDir.c_str(), id), "rb");
|
||||
if (fp != 0)
|
||||
{
|
||||
SAFE_CLOSE(fp);
|
||||
remove(fmt("%s/%s.png", m_picDir.c_str(), id));
|
||||
}
|
||||
fp = fopen(fmt("%s/%s.wfc", m_cacheDir.c_str(), id), "rb");
|
||||
if (fp != 0)
|
||||
{
|
||||
SAFE_CLOSE(fp);
|
||||
remove(fmt("%s/%s.wfc", m_cacheDir.c_str(), id));
|
||||
}
|
||||
}
|
@ -747,6 +747,7 @@ private:
|
||||
const char *_domainFromView(void);
|
||||
void UpdateCache(u32 view = COVERFLOW_MAX);
|
||||
bool MIOSisDML();
|
||||
void RemoveCover( char * id );
|
||||
SFont _font(CMenu::FontSet &fontSet, const char *domain, const char *key, u32 fontSize, u32 lineSpacing, u32 weight, u32 index, const char *genKey);
|
||||
STexture _texture(TexSet &texSet, const char *domain, const char *key, STexture def);
|
||||
safe_vector<STexture> _textures(TexSet &texSet, const char *domain, const char *key);
|
||||
|
@ -191,6 +191,7 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
|
||||
break;
|
||||
case CMenu::WO_REMOVE_GAME:
|
||||
WBFS_RemoveGame((u8 *)m_cf.getId().c_str(), (char *) m_cf.getHdr()->path);
|
||||
RemoveCover( (char *)m_cf.getId().c_str() );
|
||||
m_btnMgr.show(m_wbfsPBar);
|
||||
m_btnMgr.setProgress(m_wbfsPBar, 0.f, true);
|
||||
m_btnMgr.setProgress(m_wbfsPBar, 1.f);
|
||||
|
Loading…
Reference in New Issue
Block a user