| 164 | |
| 165 | template <typename T> |
| 166 | void saveTo(QVariantMap &parent, const QString &name, const T &el, bool reporting) |
| 167 | { |
| 168 | int idx = name.indexOf(QLatin1Char('.')); |
| 169 | if(idx > 0) |
| 170 | { |
| 171 | QString parentName = name.left(idx); |
| 172 | QString subname = name.mid(idx + 1); |
| 173 | |
| 174 | // need to load-hit-store to change the contents :(. |
| 175 | { |
| 176 | QVariantMap map = parent[parentName].toMap(); |
| 177 | saveTo(map, subname, el, reporting); |
| 178 | parent[parentName] = map; |
| 179 | } |
| 180 | return; |
| 181 | } |
| 182 | |
| 183 | parent[name] = analyticsToVar<T>(el, reporting); |
| 184 | } |
| 185 | |
| 186 | // add a macro to either document, load, or save, depending on our state. |
| 187 | #define ANALYTIC_SERIALISE(varname) \ |
no test coverage detected