Commit 760e2369 by Maarten L. Hekkelman

remove suprious error messages,

fix getUniqueID to use correct key field
parent cfba00ae
......@@ -1389,13 +1389,17 @@ std::string Category::getUniqueID(std::function<std::string(int)> generator)
{
using namespace cif::literals;
std::string key = "id";
if (mCatValidator != nullptr and mCatValidator->mKeys.size() == 1)
key = mCatValidator->mKeys.front();
int nr = size() + 1;
for (;;)
{
std::string result = generator(nr++);
if (exists("id"_key == result))
if (exists(Key(key) == result))
continue;
return result;
......@@ -2579,8 +2583,11 @@ void Category::update_value(RowSet &&rows, const std::string &tag, const std::st
if (childCat->mCatValidator != nullptr and childCat->mCatValidator->mKeys.size() == 1)
{
auto copy = childCat->copyRow(child);
if (copy != child)
if (copy != child)
{
process.push_back(child);
continue;
}
}
// cannot update this...
......
......@@ -721,13 +721,13 @@ void CompoundFactory::popDictionary()
const Compound *CompoundFactory::create(std::string id)
{
static bool warned = false;
// static bool warned = false;
if (mImpl and warned == false)
{
std::cerr << "Warning: no compound information library was found, resulting data may be incorrect or incomplete" << std::endl;
warned = true;
}
// if (mImpl and warned == false)
// {
// std::cerr << "Warning: no compound information library was found, resulting data may be incorrect or incomplete" << std::endl;
// warned = true;
// }
return mImpl ? mImpl->get(id) : nullptr;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment