Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Serializer to CascadiaSettings #8018

Merged
25 commits merged into from
Nov 17, 2020
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
48d8d06
Add Serializer to CascadiaSettings
carlos-zamora Oct 22, 2020
a3695fa
fix up new tests (mostly)
carlos-zamora Oct 23, 2020
5db3d03
only perform guid generation in getter
carlos-zamora Oct 27, 2020
8ba6394
serialize hidden shells
carlos-zamora Oct 27, 2020
e6b1bef
Revert "serialize hidden shells"
carlos-zamora Oct 28, 2020
fda5ddd
fix tests
carlos-zamora Oct 28, 2020
5833bb9
polish
carlos-zamora Oct 28, 2020
df10fc4
fix unit test
carlos-zamora Oct 28, 2020
6bb948f
add Export()
carlos-zamora Oct 28, 2020
4377296
address Mike's PR comments
carlos-zamora Oct 29, 2020
917679b
address Niksa + Griese PR comments
carlos-zamora Oct 30, 2020
f6ad218
only write backup if none exists
carlos-zamora Nov 4, 2020
31dd278
use CREATE_NEW to make this more right
carlos-zamora Nov 4, 2020
396c1a1
work with miniksa to make this look right
carlos-zamora Nov 4, 2020
c4f2733
timestamp the backup file
carlos-zamora Nov 6, 2020
dd04469
remove a semicolon
carlos-zamora Nov 6, 2020
c51f9b4
make timestamp look right
carlos-zamora Nov 6, 2020
92dc467
Merge branch 'dev/cazamor/tsm/serialization' of https://github.com/mi…
carlos-zamora Nov 6, 2020
29f7769
spellcheck
carlos-zamora Nov 6, 2020
8db53af
Merge branch 'main' into dev/cazamor/tsm/serialization
carlos-zamora Nov 6, 2020
125860e
propagate 'useTabSwitcher'-->'tabSwitcherMode' change
carlos-zamora Nov 6, 2020
ecf88ae
Merge remote-tracking branch 'origin/main' into dev/cazamor/tsm/seria…
DHowett Nov 9, 2020
4c058e2
remove unnecessary comment
carlos-zamora Nov 11, 2020
0c5aedb
polish writing settings to disk (verified)
carlos-zamora Nov 13, 2020
5d7fc4a
deserialize source
carlos-zamora Nov 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1038,15 +1038,21 @@ const Json::Value& CascadiaSettings::_GetDisabledProfileSourcesJsonObject(const
}

// Method Description:
// - Create a backup file with the current contents, iff one does not exist
// - Create a timestamped backup file with the current contents
// Arguments:
// - content - the content that we're writing to the backup file
// - settingsPath - the path to the settings file that we're going to create a backup for
// Return Value:
// - <none>
void CascadiaSettings::_WriteBackupFile(std::string_view content, const winrt::hstring settingsPath)
{
const auto backupSettingsPath{ settingsPath + L".backup" };
// create a timestamped backup file
time_t timeStamp;
tm localTimeStamp;
time(&timeStamp);
localtime_s(&localTimeStamp, &timeStamp);
const auto backupSettingsPath{ fmt::format(L"{}{}{}{}{}{}.backup", settingsPath, localTimeStamp.tm_year, localTimeStamp.tm_mon, localTimeStamp.tm_mday, localTimeStamp.tm_hour, localTimeStamp.tm_min, localTimeStamp.tm_sec) };
carlos-zamora marked this conversation as resolved.
Show resolved Hide resolved

wil::unique_hfile backupFile{ CreateFileW(backupSettingsPath.c_str(),
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
Expand Down