mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 16:15:39 +00:00
commit
0df13ca373
|
@ -14,7 +14,6 @@
|
|||
#include <boost/filesystem/operations.hpp>
|
||||
#include <pugixml/src/pugixml.hpp>
|
||||
#include <fstream>
|
||||
#include <unordered_map>
|
||||
|
||||
std::string myCollectionsName = "collections";
|
||||
|
||||
|
@ -1023,9 +1022,7 @@ std::string getCollectionsFolder()
|
|||
|
||||
bool systemSort(SystemData* sys1, SystemData* sys2)
|
||||
{
|
||||
std::string name1 = sys1->getName();
|
||||
std::string name2 = sys2->getName();
|
||||
transform(name1.cbegin(), name1.cend(), name1.begin(), ::toupper);
|
||||
transform(name2.cbegin(), name2.cend(), name2.begin(), ::toupper);
|
||||
std::string name1 = Utils::String::toUpper(sys1->getName());
|
||||
std::string name2 = Utils::String::toUpper(sys2->getName());
|
||||
return name1.compare(name2) < 0;
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
#include "FileSorts.h"
|
||||
|
||||
#include "utils/StringUtil.h"
|
||||
|
||||
namespace FileSorts
|
||||
{
|
||||
const FileData::SortType typesArr[] = {
|
||||
|
@ -40,10 +42,8 @@ namespace FileSorts
|
|||
bool compareName(const FileData* file1, const FileData* file2)
|
||||
{
|
||||
// we compare the actual metadata name, as collection files have the system appended which messes up the order
|
||||
std::string name1 = file1->metadata.get("name");
|
||||
std::string name2 = file2->metadata.get("name");
|
||||
transform(name1.cbegin(), name1.cend(), name1.begin(), ::toupper);
|
||||
transform(name2.cbegin(), name2.cend(), name2.begin(), ::toupper);
|
||||
std::string name1 = Utils::String::toUpper(file1->metadata.get("name"));
|
||||
std::string name2 = Utils::String::toUpper(file2->metadata.get("name"));
|
||||
return name1.compare(name2) < 0;
|
||||
}
|
||||
|
||||
|
@ -84,37 +84,29 @@ namespace FileSorts
|
|||
|
||||
bool compareGenre(const FileData* file1, const FileData* file2)
|
||||
{
|
||||
std::string genre1 = file1->metadata.get("genre");
|
||||
std::string genre2 = file2->metadata.get("genre");
|
||||
transform(genre1.cbegin(), genre1.cend(), genre1.begin(), ::toupper);
|
||||
transform(genre2.cbegin(), genre2.cend(), genre2.begin(), ::toupper);
|
||||
std::string genre1 = Utils::String::toUpper(file1->metadata.get("genre"));
|
||||
std::string genre2 = Utils::String::toUpper(file2->metadata.get("genre"));
|
||||
return genre1.compare(genre2) < 0;
|
||||
}
|
||||
|
||||
bool compareDeveloper(const FileData* file1, const FileData* file2)
|
||||
{
|
||||
std::string developer1 = file1->metadata.get("developer");
|
||||
std::string developer2 = file2->metadata.get("developer");
|
||||
transform(developer1.cbegin(), developer1.cend(), developer1.begin(), ::toupper);
|
||||
transform(developer2.cbegin(), developer2.cend(), developer2.begin(), ::toupper);
|
||||
std::string developer1 = Utils::String::toUpper(file1->metadata.get("developer"));
|
||||
std::string developer2 = Utils::String::toUpper(file2->metadata.get("developer"));
|
||||
return developer1.compare(developer2) < 0;
|
||||
}
|
||||
|
||||
bool comparePublisher(const FileData* file1, const FileData* file2)
|
||||
{
|
||||
std::string publisher1 = file1->metadata.get("publisher");
|
||||
std::string publisher2 = file2->metadata.get("publisher");
|
||||
transform(publisher1.cbegin(), publisher1.cend(), publisher1.begin(), ::toupper);
|
||||
transform(publisher2.cbegin(), publisher2.cend(), publisher2.begin(), ::toupper);
|
||||
std::string publisher1 = Utils::String::toUpper(file1->metadata.get("publisher"));
|
||||
std::string publisher2 = Utils::String::toUpper(file2->metadata.get("publisher"));
|
||||
return publisher1.compare(publisher2) < 0;
|
||||
}
|
||||
|
||||
bool compareSystem(const FileData* file1, const FileData* file2)
|
||||
{
|
||||
std::string system1 = file1->getSystemName();
|
||||
std::string system2 = file2->getSystemName();
|
||||
transform(system1.cbegin(), system1.cend(), system1.begin(), ::toupper);
|
||||
transform(system2.cbegin(), system2.cend(), system2.begin(), ::toupper);
|
||||
std::string system1 = Utils::String::toUpper(file1->getSystemName());
|
||||
std::string system2 = Utils::String::toUpper(file2->getSystemName());
|
||||
return system1.compare(system2) < 0;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -35,8 +35,8 @@ GuiFastSelect::GuiFastSelect(Window* window, IGameListView* gamelist) : GuiCompo
|
|||
mSortId = 0; // TODO
|
||||
updateSortText();
|
||||
|
||||
mLetterId = (int)LETTERS.find(mGameList->getCursor()->getName()[0]);
|
||||
if(mLetterId == (int)std::string::npos)
|
||||
mLetterId = LETTERS.find(mGameList->getCursor()->getName()[0]);
|
||||
if(mLetterId == std::string::npos)
|
||||
mLetterId = 0;
|
||||
|
||||
mScrollDir = 0;
|
||||
|
@ -115,9 +115,9 @@ void GuiFastSelect::scroll()
|
|||
{
|
||||
mLetterId += mScrollDir;
|
||||
if(mLetterId < 0)
|
||||
mLetterId += (int)LETTERS.length();
|
||||
else if(mLetterId >= (int)LETTERS.length())
|
||||
mLetterId -= (int)LETTERS.length();
|
||||
mLetterId += LETTERS.length();
|
||||
else if(mLetterId >= LETTERS.length())
|
||||
mLetterId -= LETTERS.length();
|
||||
|
||||
mLetterText.setText(LETTERS.substr(mLetterId, 1));
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ private:
|
|||
void updateSortText();
|
||||
|
||||
int mSortId;
|
||||
int mLetterId;
|
||||
size_t mLetterId;
|
||||
|
||||
int mScrollDir;
|
||||
int mScrollAccumulator;
|
||||
|
|
|
@ -169,29 +169,31 @@ CECInput::~CECInput()
|
|||
|
||||
std::string CECInput::getAlertTypeString(const unsigned int _type)
|
||||
{
|
||||
|
||||
#ifdef HAVE_LIBCEC
|
||||
switch(_type)
|
||||
{
|
||||
|
||||
#ifdef HAVE_LIBCEC
|
||||
case CEC::CEC_ALERT_SERVICE_DEVICE: { return "Service-Device"; } break;
|
||||
case CEC::CEC_ALERT_CONNECTION_LOST: { return "Connection-Lost"; } break;
|
||||
case CEC::CEC_ALERT_PERMISSION_ERROR: { return "Permission-Error"; } break;
|
||||
case CEC::CEC_ALERT_PORT_BUSY: { return "Port-Busy"; } break;
|
||||
case CEC::CEC_ALERT_PHYSICAL_ADDRESS_ERROR: { return "Physical-Address-Error"; } break;
|
||||
case CEC::CEC_ALERT_TV_POLL_FAILED: { return "TV-Poll-Failed"; } break;
|
||||
}
|
||||
#else // HAVE_LIBCEC
|
||||
case 0:
|
||||
#endif // HAVE_LIBCEC
|
||||
|
||||
return "Unknown";
|
||||
default: { return "Unknown"; } break;
|
||||
}
|
||||
|
||||
} // getAlertTypeString
|
||||
|
||||
std::string CECInput::getOpCodeString(const unsigned int _opCode)
|
||||
{
|
||||
|
||||
#ifdef HAVE_LIBCEC
|
||||
switch(_opCode)
|
||||
{
|
||||
|
||||
#ifdef HAVE_LIBCEC
|
||||
case CEC::CEC_OPCODE_ACTIVE_SOURCE: { return "Active-Source"; } break;
|
||||
case CEC::CEC_OPCODE_IMAGE_VIEW_ON: { return "Image-View-On"; } break;
|
||||
case CEC::CEC_OPCODE_TEXT_VIEW_ON: { return "Text-View-On"; } break;
|
||||
|
@ -262,19 +264,21 @@ std::string CECInput::getOpCodeString(const unsigned int _opCode)
|
|||
case CEC::CEC_OPCODE_END_ARC: { return "End-Arc"; } break;
|
||||
case CEC::CEC_OPCODE_CDC: { return "CDC"; } break;
|
||||
case CEC::CEC_OPCODE_NONE: { return "None"; } break;
|
||||
}
|
||||
#else // HAVE_LIBCEC
|
||||
case 0:
|
||||
#endif // HAVE_LIBCEC
|
||||
|
||||
return "Unknown";
|
||||
default: { return "Unknown"; } break;
|
||||
}
|
||||
|
||||
} // getOpCodeString
|
||||
|
||||
std::string CECInput::getKeyCodeString(const unsigned int _keyCode)
|
||||
{
|
||||
|
||||
#ifdef HAVE_LIBCEC
|
||||
switch(_keyCode)
|
||||
{
|
||||
|
||||
#ifdef HAVE_LIBCEC
|
||||
case CEC::CEC_USER_CONTROL_CODE_SELECT: { return "Select"; } break;
|
||||
case CEC::CEC_USER_CONTROL_CODE_UP: { return "Up"; } break;
|
||||
case CEC::CEC_USER_CONTROL_CODE_DOWN: { return "Down"; } break;
|
||||
|
@ -362,9 +366,11 @@ std::string CECInput::getKeyCodeString(const unsigned int _keyCode)
|
|||
case CEC::CEC_USER_CONTROL_CODE_DATA: { return "Data"; } break;
|
||||
case CEC::CEC_USER_CONTROL_CODE_AN_RETURN: { return "AN-Return"; } break;
|
||||
case CEC::CEC_USER_CONTROL_CODE_AN_CHANNELS_LIST: { return "AN-Channels-List"; } break;
|
||||
}
|
||||
#else // HAVE_LIBCEC
|
||||
case 0:
|
||||
#endif // HAVE_LIBCEC
|
||||
|
||||
return "Unknown";
|
||||
default: { return "Unknown"; } break;
|
||||
}
|
||||
|
||||
} // getKeyCodeString
|
||||
|
|
Loading…
Reference in a new issue