diff options
Diffstat (limited to 'src/collection.cpp')
-rw-r--r-- | src/collection.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/collection.cpp b/src/collection.cpp index 2e194ea..02200ff 100644 --- a/src/collection.cpp +++ b/src/collection.cpp @@ -76,7 +76,7 @@ bool Collection::addField(FieldPtr field_) { m_peopleFields.append(field_); // list of people attributes if(m_peopleFields.count() > 1) { // the second time that a person field is added, add a "pseudo-group" for people - if(m_entryGroupDicts.tqfind(s_peopleGroupName) == 0) { + if(m_entryGroupDicts.find(s_peopleGroupName) == 0) { EntryGroupDict* d = new EntryGroupDict(); d->setAutoDelete(true); m_entryGroupDicts.insert(s_peopleGroupName, d); @@ -92,7 +92,7 @@ bool Collection::addField(FieldPtr field_) { m_imageFields.append(field_); } - if(!field_->category().isEmpty() && m_fieldCategories.tqfindIndex(field_->category()) == -1) { + if(!field_->category().isEmpty() && m_fieldCategories.findIndex(field_->category()) == -1) { m_fieldCategories << field_->category(); } @@ -149,7 +149,7 @@ bool Collection::mergeField(FieldPtr newField_) { TQStringList allowed = currField->allowed(); const TQStringList& newAllowed = newField_->allowed(); for(TQStringList::ConstIterator it = newAllowed.begin(); it != newAllowed.end(); ++it) { - if(allowed.tqfindIndex(*it) == -1) { + if(allowed.findIndex(*it) == -1) { allowed.append(*it); } } @@ -216,13 +216,13 @@ bool Collection::modifyField(FieldPtr newField_) { } // update name dict - m_fieldNameDict.tqreplace(fieldName, newField_); + m_fieldNameDict.replace(fieldName, newField_); // update titles const TQString oldTitle = oldField->title(); const TQString newTitle = newField_->title(); if(oldTitle == newTitle) { - m_fieldTitleDict.tqreplace(newTitle, newField_); + m_fieldTitleDict.replace(newTitle, newField_); } else { m_fieldTitleDict.remove(oldTitle); m_fieldTitles.remove(oldTitle); @@ -231,7 +231,7 @@ bool Collection::modifyField(FieldPtr newField_) { } // now replace the field pointer in the list - FieldVec::Iterator it = m_fields.tqfind(oldField); + FieldVec::Iterator it = m_fields.find(oldField); if(it != m_fields.end()) { m_fields.insert(it, newField_); m_fields.remove(oldField); @@ -245,7 +245,7 @@ bool Collection::modifyField(FieldPtr newField_) { m_fieldCategories.clear(); for(FieldVec::Iterator it = m_fields.begin(); it != m_fields.end(); ++it) { // add category if it's not in the list yet - if(!it->category().isEmpty() && !m_fieldCategories.tqcontains(it->category())) { + if(!it->category().isEmpty() && !m_fieldCategories.contains(it->category())) { m_fieldCategories += it->category(); } } @@ -279,7 +279,7 @@ bool Collection::modifyField(FieldPtr newField_) { } if(isPeople) { // if there's more than one people field and no people dict exists yet, add it - if(m_peopleFields.count() > 1 && m_entryGroupDicts.tqfind(s_peopleGroupName) == 0) { + if(m_peopleFields.count() > 1 && m_entryGroupDicts.find(s_peopleGroupName) == 0) { EntryGroupDict* d = new EntryGroupDict(); d->setAutoDelete(true); m_entryGroupDicts.insert(s_peopleGroupName, d); @@ -303,7 +303,7 @@ bool Collection::modifyField(FieldPtr newField_) { resetGroups = true; } else { // don't do this, it wipes out the old groups! -// m_entryGroupDicts.tqreplace(fieldName, new EntryGroupDict()); +// m_entryGroupDicts.replace(fieldName, new EntryGroupDict()); } } else if(isGrouped) { EntryGroupDict* d = new EntryGroupDict(); @@ -342,7 +342,7 @@ bool Collection::removeField(const TQString& name_, bool force_) { // force allows me to force the deleting of the title field if I need to bool Collection::removeField(FieldPtr field_, bool force_/*=false*/) { - if(!field_ || !m_fields.tqcontains(field_)) { + if(!field_ || !m_fields.contains(field_)) { if(field_) { myDebug() << "Collection::removeField - false: " << field_->name() << endl; } @@ -406,7 +406,7 @@ void Collection::reorderFields(const FieldVec& list_) { // also reset category list, since the order may have changed m_fieldCategories.clear(); for(FieldVec::Iterator it = m_fields.begin(); it != m_fields.end(); ++it) { - if(!it->category().isEmpty() && !m_fieldCategories.tqcontains(it->category())) { + if(!it->category().isEmpty() && !m_fieldCategories.contains(it->category())) { m_fieldCategories << it->category(); } } @@ -432,7 +432,7 @@ void Collection::addEntries(EntryVec entries_) { } else if(entry->id() == -1) { entry->setId(m_nextEntryId); ++m_nextEntryId; - } else if(m_entryIdDict.tqfind(entry->id())) { + } else if(m_entryIdDict.find(entry->id())) { if(!foster) { myDebug() << "Collection::addEntries() - the collection already has an entry with id = " << entry->id() << endl; } @@ -452,10 +452,10 @@ void Collection::removeEntriesFromDicts(EntryVec entries_) { // need a copy of the vector since it gets changed PtrVector<EntryGroup> groups = entry->groups(); for(PtrVector<EntryGroup>::Iterator group = groups.begin(); group != groups.end(); ++group) { - if(entry->removeFromGroup(group.ptr()) && !modifiedGroups.tqcontains(group.ptr())) { + if(entry->removeFromGroup(group.ptr()) && !modifiedGroups.contains(group.ptr())) { modifiedGroups.push_back(group.ptr()); } - if(group->isEmpty() && !m_groupsToDelete.tqcontains(group.ptr())) { + if(group->isEmpty() && !m_groupsToDelete.contains(group.ptr())) { m_groupsToDelete.push_back(group.ptr()); } } @@ -494,7 +494,7 @@ bool Collection::removeEntries(EntryVec vec_) { Tellico::Data::FieldVec Collection::fieldsByCategory(const TQString& cat_) { #ifndef NDEBUG - if(m_fieldCategories.tqfindIndex(cat_) == -1) { + if(m_fieldCategories.findIndex(cat_) == -1) { myDebug() << "Collection::fieldsByCategory() - '" << cat_ << "' is not in category list" << endl; } #endif @@ -554,11 +554,11 @@ TQStringList Collection::valuesByFieldName(const TQString& name_) const { } Tellico::Data::FieldPtr Collection::fieldByName(const TQString& name_) const { - return m_fieldNameDict.isEmpty() ? 0 : name_.isEmpty() ? 0 : m_fieldNameDict.tqfind(name_); + return m_fieldNameDict.isEmpty() ? 0 : name_.isEmpty() ? 0 : m_fieldNameDict.find(name_); } Tellico::Data::FieldPtr Collection::fieldByTitle(const TQString& title_) const { - return m_fieldTitleDict.isEmpty() ? 0 : title_.isEmpty() ? 0 : m_fieldTitleDict.tqfind(title_); + return m_fieldTitleDict.isEmpty() ? 0 : title_.isEmpty() ? 0 : m_fieldTitleDict.find(title_); } bool Collection::hasField(const TQString& name_) const { @@ -575,7 +575,7 @@ bool Collection::isAllowed(const TQString& key_, const TQString& value_) const { FieldPtr field = fieldByName(key_); // if the type is not multiple choice or if value_ is allowed, return true - if(field && (field->type() != Field::Choice || field->allowed().tqfindIndex(value_) > -1)) { + if(field && (field->type() != Field::Choice || field->allowed().findIndex(value_) > -1)) { return true; } @@ -587,7 +587,7 @@ Tellico::Data::EntryGroupDict* Collection::entryGroupDictByName(const TQString& if(name_.isEmpty()) { return 0; } - EntryGroupDict* dict = m_entryGroupDicts.isEmpty() ? 0 : m_entryGroupDicts.tqfind(name_); + EntryGroupDict* dict = m_entryGroupDicts.isEmpty() ? 0 : m_entryGroupDicts.find(name_); if(dict && dict->isEmpty()) { GUI::CursorSaver cs; const bool b = signalsBlocked(); @@ -613,7 +613,7 @@ void Collection::populateDict(EntryGroupDict* dict_, const TQString& fieldName_, if(isBool && groupTitle != i18n(s_emptyGroupTitle)) { groupTitle = fieldTitleByName(fieldName_); } - EntryGroup* group = dict_->tqfind(groupTitle); + EntryGroup* group = dict_->find(groupTitle); // if the group doesn't exist, create it if(!group) { group = new EntryGroup(groupTitle, fieldName_); @@ -886,7 +886,7 @@ bool Collection::mergeEntry(EntryPtr e1, EntryPtr e2, bool overwrite_, bool askU TQStringList items2 = e2->fields(field, false); for(TQStringList::ConstIterator it = items2.begin(); it != items2.end(); ++it) { // possible to have one value formatted and the other one not... - if(!items1.tqcontains(*it) && !items1.tqcontains(Field::format(*it, field->formatFlag()))) { + if(!items1.contains(*it) && !items1.contains(Field::format(*it, field->formatFlag()))) { items1.append(*it); } } |