mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-24 06:36:08 +00:00
Add saving of filters
* The current filter is preserved across runs even if it's not explicitly saved. Saved filters are only updated with an explicit save - loading a filter then making a change just cahnges the current scratch filter, it doesn't update the saved filter until the user explicitly saves it.
This commit is contained in:
@@ -163,6 +163,18 @@ struct LegacyData
|
||||
QVariantMap _ConfigSettings;
|
||||
};
|
||||
|
||||
static rdcarray<rdcpair<rdcstr, CustomPersistentStorage *>> &GetCustomStorage()
|
||||
{
|
||||
static rdcarray<rdcpair<rdcstr, CustomPersistentStorage *>> ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
CustomPersistentStorage::CustomPersistentStorage(rdcstr name)
|
||||
{
|
||||
if(!name.empty())
|
||||
GetCustomStorage().push_back({name, this});
|
||||
}
|
||||
|
||||
QVariantMap PersistantConfig::storeValues() const
|
||||
{
|
||||
QVariantMap ret;
|
||||
@@ -186,6 +198,11 @@ QVariantMap PersistantConfig::storeValues() const
|
||||
ret[lit("ShaderViewer_FriendlyNaming")] = m_Legacy->_ShaderViewer_FriendlyNaming;
|
||||
ret[lit("ConfigSettings")] = m_Legacy->_ConfigSettings;
|
||||
|
||||
for(const rdcpair<rdcstr, CustomPersistentStorage *> &ps : GetCustomStorage())
|
||||
{
|
||||
ps.second->save(ret[QString(ps.first)]);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -295,6 +312,9 @@ void PersistantConfig::applyValues(const QVariantMap &values)
|
||||
|
||||
if(saveConfig)
|
||||
RENDERDOC_SaveConfigSettings();
|
||||
|
||||
for(const rdcpair<rdcstr, CustomPersistentStorage *> &ps : GetCustomStorage())
|
||||
ps.second->load(values[QString(ps.first)]);
|
||||
}
|
||||
|
||||
static QMutex RemoteHostLock;
|
||||
|
||||
Reference in New Issue
Block a user