diff options
Diffstat (limited to 'src/filter.cpp')
| -rw-r--r-- | src/filter.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/filter.cpp b/src/filter.cpp index 9672937..1a0c67c 100644 --- a/src/filter.cpp +++ b/src/filter.cpp @@ -16,7 +16,7 @@ #include "tellico_debug.h" -#include <qregexp.h> +#include <tqregexp.h> using Tellico::Filter; using Tellico::FilterRule; @@ -24,7 +24,7 @@ using Tellico::FilterRule; FilterRule::FilterRule() : m_function(FuncEquals) { } -FilterRule::FilterRule(const QString& fieldName_, const QString& pattern_, Function func_) +FilterRule::FilterRule(const TQString& fieldName_, const TQString& pattern_, Function func_) : m_fieldName(fieldName_), m_function(func_), m_pattern(pattern_) { } @@ -35,9 +35,9 @@ bool FilterRule::matches(Data::EntryPtr entry_) const { case FuncNotEquals: return !equals(entry_); case FuncContains: - return contains(entry_); + return tqcontains(entry_); case FuncNotContains: - return !contains(entry_); + return !tqcontains(entry_); case FuncRegExp: return matchesRegExp(entry_); case FuncNotRegExp: @@ -52,52 +52,52 @@ bool FilterRule::matches(Data::EntryPtr entry_) const { bool FilterRule::equals(Data::EntryPtr entry_) const { // empty field name means search all if(m_fieldName.isEmpty()) { - QStringList list = entry_->fieldValues() + entry_->formattedFieldValues(); - for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { - if(QString::compare((*it).lower(), m_pattern.lower()) == 0) { + TQStringList list = entry_->fieldValues() + entry_->formattedFieldValues(); + for(TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { + if(TQString::compare((*it).lower(), m_pattern.lower()) == 0) { return true; } } } else { - return QString::compare(entry_->field(m_fieldName).lower(), m_pattern.lower()) == 0 - || QString::compare(entry_->formattedField(m_fieldName).lower(), m_pattern.lower()) == 0; + return TQString::compare(entry_->field(m_fieldName).lower(), m_pattern.lower()) == 0 + || TQString::compare(entry_->formattedField(m_fieldName).lower(), m_pattern.lower()) == 0; } return false; } -bool FilterRule::contains(Data::EntryPtr entry_) const { +bool FilterRule::tqcontains(Data::EntryPtr entry_) const { // empty field name means search all if(m_fieldName.isEmpty()) { - QStringList list = entry_->fieldValues() + entry_->formattedFieldValues(); + TQStringList list = entry_->fieldValues() + entry_->formattedFieldValues(); // match is true if any strings match - for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { - if((*it).find(m_pattern, 0, false) >= 0) { + for(TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { + if((*it).tqfind(m_pattern, 0, false) >= 0) { return true; } } } else { - return entry_->field(m_fieldName).find(m_pattern, 0, false) >= 0 - || entry_->formattedField(m_fieldName).find(m_pattern, 0, false) >= 0; + return entry_->field(m_fieldName).tqfind(m_pattern, 0, false) >= 0 + || entry_->formattedField(m_fieldName).tqfind(m_pattern, 0, false) >= 0; } return false; } bool FilterRule::matchesRegExp(Data::EntryPtr entry_) const { - QRegExp rx(m_pattern, false); + TQRegExp rx(m_pattern, false); // empty field name means search all if(m_fieldName.isEmpty()) { - QStringList list = entry_->fieldValues() + entry_->formattedFieldValues(); - for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { - if((*it).find(rx) >= 0) { + TQStringList list = entry_->fieldValues() + entry_->formattedFieldValues(); + for(TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { + if((*it).tqfind(rx) >= 0) { return true; break; } } } else { - return entry_->field(m_fieldName).find(rx) >= 0 - || entry_->formattedField(m_fieldName).find(rx) >= 0; + return entry_->field(m_fieldName).tqfind(rx) >= 0 + || entry_->formattedField(m_fieldName).tqfind(rx) >= 0; } return false; @@ -106,8 +106,8 @@ bool FilterRule::matchesRegExp(Data::EntryPtr entry_) const { /*******************************************************/ -Filter::Filter(const Filter& other_) : QPtrList<FilterRule>(), KShared(), m_op(other_.op()), m_name(other_.name()) { - for(QPtrListIterator<FilterRule> it(other_); it.current(); ++it) { +Filter::Filter(const Filter& other_) : TQPtrList<FilterRule>(), KShared(), m_op(other_.op()), m_name(other_.name()) { + for(TQPtrListIterator<FilterRule> it(other_); it.current(); ++it) { append(new FilterRule(*it.current())); } setAutoDelete(true); @@ -119,7 +119,7 @@ bool Filter::matches(Data::EntryPtr entry_) const { } bool match = false; - for(QPtrListIterator<FilterRule> it(*this); it.current(); ++it) { + for(TQPtrListIterator<FilterRule> it(*this); it.current(); ++it) { if(it.current()->matches(entry_)) { if(m_op == Filter::MatchAny) { return true; |
