mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-02 13:11:33 +00:00
added category update function
This commit is contained in:
parent
3a5238bebc
commit
04a11679fb
2 changed files with 9 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "setting.hpp"
|
#include "setting.hpp"
|
||||||
|
#include "state.hpp"
|
||||||
|
|
||||||
CSMPrefs::Category::Category (State *parent, const std::string& key)
|
CSMPrefs::Category::Category (State *parent, const std::string& key)
|
||||||
: mParent (parent), mKey (key)
|
: mParent (parent), mKey (key)
|
||||||
|
@ -42,3 +43,9 @@ CSMPrefs::Setting& CSMPrefs::Category::operator[] (const std::string& key)
|
||||||
|
|
||||||
throw std::logic_error ("Invalid user setting: " + key);
|
throw std::logic_error ("Invalid user setting: " + key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSMPrefs::Category::update()
|
||||||
|
{
|
||||||
|
for (Iterator iter = mSettings.begin(); iter!=mSettings.end(); ++iter)
|
||||||
|
mParent->update (**iter);
|
||||||
|
}
|
||||||
|
|
|
@ -37,6 +37,8 @@ namespace CSMPrefs
|
||||||
Iterator end();
|
Iterator end();
|
||||||
|
|
||||||
Setting& operator[] (const std::string& key);
|
Setting& operator[] (const std::string& key);
|
||||||
|
|
||||||
|
void update();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue