Change: move sensitive information to secrets.cfg and private information to private.cfg

We often ask people for their openttd.cfg, which now includes their
passwords, usernames, etc. It is easy for people to overlook this,
unwillingly sharing information they shouldn't.

By splitting this information over either private.cfg or secrets.cfg,
we make it more obvious they shouldn't be sharing those files, and
hint to what is inside them.
This commit is contained in:
Patric Stout
2021-06-28 16:39:48 +02:00
committed by Patric Stout
parent 4f3bf84af4
commit 75b6051b7a
8 changed files with 361 additions and 123 deletions

View File

@@ -100,6 +100,29 @@ IniItem *IniGroup::GetItem(const std::string &name, bool create)
return new IniItem(this, name);
}
/**
* Remove the item with the given name.
* @param name Name of the item to remove.
*/
void IniGroup::RemoveItem(const std::string &name)
{
IniItem **prev = &this->item;
for (IniItem *item = this->item; item != nullptr; prev = &item->next, item = item->next) {
if (item->name != name) continue;
*prev = item->next;
if (this->last_item == &this->item) {
this->last_item = &item->next;
}
item->next = nullptr;
delete item;
return;
}
}
/**
* Clear all items in the group
*/