mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Merge pull request #592 from verybadsoldier/fix/save_default_meta
save also metadata that have default values. they might not had defau…
This commit is contained in:
commit
d62758c7cf
|
@ -217,11 +217,6 @@ void updateGamelist(SystemData* system)
|
||||||
{
|
{
|
||||||
const char* tag = ((*fit)->getType() == GAME) ? "game" : "folder";
|
const char* tag = ((*fit)->getType() == GAME) ? "game" : "folder";
|
||||||
|
|
||||||
// check if current file has metadata, if no, skip it as it wont be in the gamelist anyway.
|
|
||||||
if ((*fit)->metadata.isDefault()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// do not touch if it wasn't changed anyway
|
// do not touch if it wasn't changed anyway
|
||||||
if (!(*fit)->metadata.wasChanged())
|
if (!(*fit)->metadata.wasChanged())
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -140,17 +140,6 @@ float MetaDataList::getFloat(const std::string& key) const
|
||||||
return (float)atof(get(key).c_str());
|
return (float)atof(get(key).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MetaDataList::isDefault()
|
|
||||||
{
|
|
||||||
const std::vector<MetaDataDecl>& mdd = getMDD();
|
|
||||||
|
|
||||||
for (unsigned int i = 1; i < mMap.size(); i++) {
|
|
||||||
if (mMap.at(mdd[i].key) != mdd[i].defaultValue) return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MetaDataList::wasChanged() const
|
bool MetaDataList::wasChanged() const
|
||||||
{
|
{
|
||||||
return mWasChanged;
|
return mWasChanged;
|
||||||
|
|
|
@ -55,8 +55,6 @@ public:
|
||||||
int getInt(const std::string& key) const;
|
int getInt(const std::string& key) const;
|
||||||
float getFloat(const std::string& key) const;
|
float getFloat(const std::string& key) const;
|
||||||
|
|
||||||
bool isDefault();
|
|
||||||
|
|
||||||
bool wasChanged() const;
|
bool wasChanged() const;
|
||||||
void resetChangedFlag();
|
void resetChangedFlag();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue