void Exceptions::load(ProgressIndicator* progressIndicator) { DatabasePtr db = getDatabase(); MetadataLoader* loader = db->getMetadataLoader(); MetadataLoaderTransaction tr(loader); wxMBConv* converter = db->getCharsetConverter(); IBPP::Statement& st1 = loader->getStatement( Exception::getLoadStatement(true)); CollectionType exceptions; st1->Execute(); checkProgressIndicatorCanceled(progressIndicator); while (st1->Fetch()) { if (!st1->IsNull(1)) { std::string s; st1->Get(1, s); wxString name(std2wxIdentifier(s, converter)); ExceptionPtr exception = findByName(name); if (!exception) { exception.reset(new Exception(db, name)); initializeLockCount(exception, getLockCount()); } exceptions.push_back(exception); exception->loadProperties(st1, converter); } checkProgressIndicatorCanceled(progressIndicator); } setItems(exceptions); }
void initializeLockCount(MetadataItemPtr item, unsigned count) { initializeLockCount(item.get(), count); }