refactor: deprecate instead of remove persistent_workspaces

This commit is contained in:
khaneliman
2023-09-05 13:45:09 -05:00
committed by Austin Horstman
parent b405dc436c
commit c9e1899594
3 changed files with 31 additions and 6 deletions

View File

@ -231,8 +231,15 @@ void Workspaces::remove_workspace(std::string name) {
}
void Workspaces::fill_persistent_workspaces() {
if (config_["persistent-workspaces"].isObject()) {
const Json::Value persistent_workspaces = config_["persistent-workspaces"];
if (config_["persistent_workspaces"].isObject()) {
spdlog::warn(
"persistent_workspaces is deprecated. Please change config to use persistent-workspaces.");
}
if (config_["persistent-workspaces"].isObject() || config_["persistent_workspaces"].isObject()) {
const Json::Value persistent_workspaces = config_["persistent-workspaces"].isObject()
? config_["persistent-workspaces"]
: config_["persistent_workspaces"];
const std::vector<std::string> keys = persistent_workspaces.getMemberNames();
for (const std::string &key : keys) {