GUI: generate***Name() methods for handlers give non-unique names
std::string PeakHandler::generateName()
{
int n = 4; // number of digits
std::string str = std::to_string(numPeakCollections() + 1);
if (str.size() > n) { //
return "Please enter name for this collection";
}
return std::string("PeakCollection") + std::string(n - str.size(), '0').append(str);
}
These methods use the size of the map to generate a new name; however, if an item that is not the last in the list is removed, the suggested name will clash with an existing name.