| 1973 | } |
| 1974 | |
| 1975 | bool CaptureContext::SaveEdits() |
| 1976 | { |
| 1977 | // make sure this format matches SetCaptureFileComments in app_api.cpp if it changes |
| 1978 | QVariantList editors; |
| 1979 | |
| 1980 | for(ShaderViewer *e : m_ShaderEditors) |
| 1981 | { |
| 1982 | QVariantMap editor = e->SaveEditor(); |
| 1983 | if(!editor.isEmpty()) |
| 1984 | editors.push_back(e->SaveEditor()); |
| 1985 | } |
| 1986 | |
| 1987 | QVariantMap root; |
| 1988 | root[lit("editors")] = editors; |
| 1989 | |
| 1990 | QString json = VariantToJSON(root); |
| 1991 | |
| 1992 | SectionProperties props; |
| 1993 | props.type = SectionType::EditedShaders; |
| 1994 | props.version = 1; |
| 1995 | |
| 1996 | return Replay().GetCaptureFile()->WriteSection(props, json.toUtf8()).OK(); |
| 1997 | } |
| 1998 | |
| 1999 | void CaptureContext::LoadEdits(const QString &data) |
| 2000 | { |
nothing calls this directly
no test coverage detected