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

rename profiles.json to settings.json, clean up the defaults #5199

Merged
6 commits merged into from
Apr 1, 2020

Commits on Mar 31, 2020

  1. Configuration menu
    Copy the full SHA
    961793f View commit details
    Browse the repository at this point in the history
  2. Settings: move profiles.json to settings.json

    This commit also changes Get*Settings from returning a string to
    returning a std::filesystem::path. We gain in expressiveness without a
    loss in clarity (since path still supports .c_str()).
    
    NOTE: I tried to do an atomic rename with the handle open, but it didn't
    work for reparse points (it moves the destination of a symbolic link
    out into the settings folder directly.)
    
    Fixes #5186
    
    --- snip for atomic rename code ---
    
    auto path{ pathToSettingsFile.wstring() };
    auto renameBufferSize{ sizeof(FILE_RENAME_INFO) + (path.size() * sizeof(wchar_t)) };
    auto renameBuffer{ std::make_unique<std::byte[]>(renameBufferSize) };
    auto renameInfo{ reinterpret_cast<FILE_RENAME_INFO*>(renameBuffer.get()) };
    renameInfo->Flags = FILE_RENAME_FLAG_REPLACE_IF_EXISTS | FILE_RENAME_FLAG_POSIX_SEMANTICS;
    renameInfo->RootDirectory = nullptr;
    renameInfo->FileNameLength = gsl::narrow_cast<DWORD>(path.size());
    std::copy(path.cbegin(), path.cend(), std::begin(renameInfo->FileName));
    
    THROW_IF_WIN32_BOOL_FALSE(SetFileInformationByHandle(hLegacyFile.get(), FileRenameInfo, renameBuffer.get(), gsl::narrow_cast<DWORD>(renameBufferSize)));
    
    -----------------------------------
    DHowett committed Mar 31, 2020
    Configuration menu
    Copy the full SHA
    6394820 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4719fcb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    947054c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b72d411 View commit details
    Browse the repository at this point in the history
  6. Update all user-docs

    DHowett committed Mar 31, 2020
    Configuration menu
    Copy the full SHA
    46ac179 View commit details
    Browse the repository at this point in the history