Saving event source set to registry simplified to reduce registry clutter
This commit is contained in:
parent
8bf99423c8
commit
db585975e8
@ -706,12 +706,12 @@ void wxPersistentETWListCtrl::Save() const
|
|||||||
SaveValue(wxString::Format(wxT("Column%sWidth"), col.GetText().c_str()), col.GetWidth());
|
SaveValue(wxString::Format(wxT("Column%sWidth"), col.GetText().c_str()), col.GetWidth());
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveValue(wxT("ScrollAuto" ), wnd->m_scroll_auto);
|
SaveValue(wxT("ScrollAuto"), wnd->m_scroll_auto);
|
||||||
|
|
||||||
SaveValue(wxT("SourceCount"), (long)wnd->m_sources.size());
|
wxString data_str;
|
||||||
long i = 0;
|
for (wxETWListCtrl::guidset::const_iterator src = wnd->m_sources.cbegin(), src_end = wnd->m_sources.cend(); src != src_end; ++src)
|
||||||
for (wxETWListCtrl::guidset::const_iterator src = wnd->m_sources.cbegin(), src_end = wnd->m_sources.cend(); src != src_end; ++src, i++)
|
data_str += tstring_guid(*src);
|
||||||
SaveValue(wxString::Format(wxT("Source%u"), i), tstring_guid(*src));
|
SaveValue(wxT("Sources"), data_str);
|
||||||
|
|
||||||
SaveValue(wxT("Level"), (int)wnd->m_level);
|
SaveValue(wxT("Level"), (int)wnd->m_level);
|
||||||
}
|
}
|
||||||
@ -735,24 +735,24 @@ bool wxPersistentETWListCtrl::Restore()
|
|||||||
RestoreValue(wxT("ScrollAuto"), &(wnd->m_scroll_auto));
|
RestoreValue(wxT("ScrollAuto"), &(wnd->m_scroll_auto));
|
||||||
|
|
||||||
wnd->m_sources.clear();
|
wnd->m_sources.clear();
|
||||||
long n;
|
wxString data_str;
|
||||||
if (RestoreValue(wxT("SourceCount"), &n)) {
|
if (RestoreValue(wxT("Sources"), &data_str)) {
|
||||||
wxString guid_str;
|
for (size_t i = 0; (i = data_str.find(wxT('{'), i)) != std::string::npos;) {
|
||||||
for (long i = 0; i < n; i++) {
|
|
||||||
if (RestoreValue(wxString::Format(wxT("Source%u"), i), &guid_str)) {
|
|
||||||
GUID guid;
|
GUID guid;
|
||||||
if (StringToGuid(guid_str.c_str(), &guid))
|
if (StringToGuid(data_str.data() + i, &guid)) {
|
||||||
wnd->m_sources.insert(guid);
|
wnd->m_sources.insert(guid);
|
||||||
}
|
i += 38;
|
||||||
|
} else
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Insert our provider by default.
|
// Insert our provider by default.
|
||||||
wnd->m_sources.insert(EAPMETHOD_TRACE_EVENT_PROVIDER);
|
wnd->m_sources.insert(EAPMETHOD_TRACE_EVENT_PROVIDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dummy_int;
|
int data_int;
|
||||||
if (RestoreValue(wxT("Level"), &dummy_int))
|
if (RestoreValue(wxT("Level"), &data_int))
|
||||||
wnd->m_level = (UCHAR)std::min<int>(std::max<int>(dummy_int, TRACE_LEVEL_ERROR), TRACE_LEVEL_VERBOSE);
|
wnd->m_level = (UCHAR)std::min<int>(std::max<int>(data_int, TRACE_LEVEL_ERROR), TRACE_LEVEL_VERBOSE);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 92f010b206ac51a69407bf8ed9df43f83e6c783a
|
Subproject commit ea9a08e02a6ecac5721feb4bb730a6fe453f3cf7
|
Loading…
x
Reference in New Issue
Block a user