Recursive routine to copy all groups and entries from one wxConfig object to another
| 206 | |
| 207 | // Recursive routine to copy all groups and entries from one wxConfig object to another |
| 208 | static void CopyEntriesRecursive(wxString path, wxConfigBase *src, wxConfigBase *dst) |
| 209 | { |
| 210 | wxString entryName; |
| 211 | long entryIndex; |
| 212 | bool entryKeepGoing; |
| 213 | |
| 214 | entryKeepGoing = src->GetFirstEntry(entryName, entryIndex); |
| 215 | while (entryKeepGoing) { |
| 216 | CopyEntry(path, src, dst, entryName); |
| 217 | entryKeepGoing = src->GetNextEntry(entryName, entryIndex); |
| 218 | } |
| 219 | |
| 220 | wxString groupName; |
| 221 | long groupIndex; |
| 222 | bool groupKeepGoing; |
| 223 | |
| 224 | groupKeepGoing = src->GetFirstGroup(groupName, groupIndex); |
| 225 | while (groupKeepGoing) { |
| 226 | wxString subPath = path+groupName+wxT("/"); |
| 227 | src->SetPath(subPath); |
| 228 | CopyEntriesRecursive(subPath, src, dst); |
| 229 | src->SetPath(path); |
| 230 | groupKeepGoing = src->GetNextGroup(groupName, groupIndex); |
| 231 | } |
| 232 | } |
| 233 | #endif |
| 234 | |
| 235 | void InitPreferences( std::unique_ptr<audacity::BasicSettings> uPrefs ) |