diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index a8cae8c83..d49160fe5 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -981,15 +981,6 @@ bool SystemData::createSystemDirectories() return false; } -const bool SystemData::isVisible() const -{ - // This function doesn't make much sense at the moment; if a system does not have any - // games available, it will not be processed during startup and will as such not exist. - // In the future this function may be used for an option to hide specific systems, but - // for the time being all systems will always be visible. - return true; -} - SystemData* SystemData::getSystemByName(const std::string& systemName) { for (auto it : sSystemVector) { @@ -1002,30 +993,22 @@ SystemData* SystemData::getSystemByName(const std::string& systemName) SystemData* SystemData::getNext() const { - std::vector::const_iterator it = getIterator(); + auto it = std::find(sSystemVector.cbegin(), sSystemVector.cend(), this); - // As we are starting in a valid gamelistview, this will - // always succeed, even if we have to come full circle. - do { - ++it; - if (it == sSystemVector.cend()) - it = sSystemVector.cbegin(); - } while (!(*it)->isVisible()); + ++it; + if (it == sSystemVector.cend()) + it = sSystemVector.cbegin(); return *it; } SystemData* SystemData::getPrev() const { - std::vector::const_reverse_iterator it = getRevIterator(); + auto it = std::find(sSystemVector.crbegin(), sSystemVector.crend(), this); - // As we are starting in a valid gamelistview, this will - // always succeed, even if we have to come full circle. - do { - ++it; - if (it == sSystemVector.crend()) - it = sSystemVector.crbegin(); - } while (!(*it)->isVisible()); + ++it; + if (it == sSystemVector.crend()) + it = sSystemVector.crbegin(); return *it; } diff --git a/es-app/src/SystemData.h b/es-app/src/SystemData.h index 990ff7ee6..b0b4dad10 100644 --- a/es-app/src/SystemData.h +++ b/es-app/src/SystemData.h @@ -115,14 +115,6 @@ public: static std::vector sSystemVector; static std::unique_ptr sFindRules; - std::vector::const_iterator getIterator() const - { - return std::find(sSystemVector.cbegin(), sSystemVector.cend(), this); - } - std::vector::const_reverse_iterator getRevIterator() const - { - return std::find(sSystemVector.crbegin(), sSystemVector.crend(), this); - } const bool isCollection() const { return mIsCollectionSystem; } const bool isCustomCollection() const { return mIsCustomCollectionSystem; } const bool isGroupedCustomCollection() const { return mIsGroupedCustomCollectionSystem; } @@ -132,8 +124,6 @@ public: }; const bool isGameSystem() const { return mIsGameSystem; } - const bool isVisible() const; - static SystemData* getSystemByName(const std::string& systemName); SystemData* getNext() const; SystemData* getPrev() const;