mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-29 19:55:37 +00:00
skip game lists without games when quick selecting, handle empty game lists
This commit is contained in:
parent
d2d448ee1c
commit
6f602a22c9
|
@ -161,6 +161,12 @@ void SystemData::launchGame(Window* window, FileData* game)
|
||||||
|
|
||||||
void SystemData::populateFolder(FileData* folder)
|
void SystemData::populateFolder(FileData* folder)
|
||||||
{
|
{
|
||||||
|
if (mDirectLaunch)
|
||||||
|
{
|
||||||
|
LOG(LogInfo) << "System " << mName << " is a direct launch item, not building game lists.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const fs::path& folderPath = folder->getPath();
|
const fs::path& folderPath = folder->getPath();
|
||||||
if(!fs::is_directory(folderPath))
|
if(!fs::is_directory(folderPath))
|
||||||
{
|
{
|
||||||
|
@ -330,12 +336,15 @@ bool SystemData::loadConfig()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//convert path to generic directory seperators
|
if (!directLaunch)
|
||||||
boost::filesystem::path genericPath(path);
|
{
|
||||||
path = genericPath.generic_string();
|
//convert path to generic directory seperators
|
||||||
|
boost::filesystem::path genericPath(path);
|
||||||
|
path = genericPath.generic_string();
|
||||||
|
}
|
||||||
|
|
||||||
SystemData* newSys = new SystemData(name, fullname, path, extensions, cmd, platformIds, themeFolder, directLaunch);
|
SystemData* newSys = new SystemData(name, fullname, path, extensions, cmd, platformIds, themeFolder, directLaunch);
|
||||||
if(newSys->getRootFolder()->getChildren().size() == 0)
|
if(newSys->getRootFolder()->getChildren().size() == 0 && !directLaunch)
|
||||||
{
|
{
|
||||||
LOG(LogWarning) << "System \"" << name << "\" has no games! Ignoring it.";
|
LOG(LogWarning) << "System \"" << name << "\" has no games! Ignoring it.";
|
||||||
delete newSys;
|
delete newSys;
|
||||||
|
|
|
@ -72,7 +72,15 @@ void ViewController::goToNextGameList()
|
||||||
assert(mState.viewing == GAME_LIST);
|
assert(mState.viewing == GAME_LIST);
|
||||||
SystemData* system = getState().getSystem();
|
SystemData* system = getState().getSystem();
|
||||||
assert(system);
|
assert(system);
|
||||||
goToGameList(system->getNext());
|
|
||||||
|
// skip systems that don't have a game list, this will always end since it is called
|
||||||
|
// from a system with a game list and the iterator is cyclic
|
||||||
|
do
|
||||||
|
{
|
||||||
|
system = system->getNext();
|
||||||
|
} while ( system->getDirectLaunch() );
|
||||||
|
|
||||||
|
goToGameList(system);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewController::goToPrevGameList()
|
void ViewController::goToPrevGameList()
|
||||||
|
@ -80,7 +88,15 @@ void ViewController::goToPrevGameList()
|
||||||
assert(mState.viewing == GAME_LIST);
|
assert(mState.viewing == GAME_LIST);
|
||||||
SystemData* system = getState().getSystem();
|
SystemData* system = getState().getSystem();
|
||||||
assert(system);
|
assert(system);
|
||||||
goToGameList(system->getPrev());
|
|
||||||
|
// skip systems that don't have a game list, this will always end since it is called
|
||||||
|
// from a system with a game list and the iterator is cyclic
|
||||||
|
do
|
||||||
|
{
|
||||||
|
system = system->getPrev();
|
||||||
|
} while ( system->getDirectLaunch() );
|
||||||
|
|
||||||
|
goToGameList(system);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewController::goToGameList(SystemData* system)
|
void ViewController::goToGameList(SystemData* system)
|
||||||
|
|
|
@ -38,6 +38,12 @@ void BasicGameListView::onFileChanged(FileData* file, FileChangeType change)
|
||||||
void BasicGameListView::populateList(const std::vector<FileData*>& files)
|
void BasicGameListView::populateList(const std::vector<FileData*>& files)
|
||||||
{
|
{
|
||||||
mList.clear();
|
mList.clear();
|
||||||
|
|
||||||
|
// file list can be empty if direct launch item
|
||||||
|
if (files.size()==0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mHeaderText.setText(files.at(0)->getSystem()->getFullName());
|
mHeaderText.setText(files.at(0)->getSystem()->getFullName());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue