AnGenericRowProvider::~AnGenericRowProvider(void) { for (unsigned int i=0; i<allrows_.size(); ++i) { removeSubject(allrows_[i]); } allrows_.clear(); visiblerows_.clear(); /* Using the setter methods ensures that removeSubject is called: */ setSortProperty(NULL); setFilterProperty(NULL); }
void PropertyFilter::prepare(const string& aPattern, int aMethod, int aProperty) { WLock l(cs); setPattern(aPattern); setFilterMethod(static_cast<StringMatch::Method>(aMethod)); setFilterProperty(aProperty); type = TYPE_TEXT; if (currentFilterProperty < 0 || currentFilterProperty >= propertyCount) { if (numComparisonMode != LAST) { // Attempt to detect the column type type = TYPE_TIME; auto ret = prepareTime(); if (!ret.second) { type = TYPE_SIZE; ret = prepareSize(); } if (!ret.second) { type = TYPE_SPEED; ret = prepareSpeed(); } if (!ret.second) { // Try generic columns type = TYPE_NUMERIC_OTHER; numericMatcher = Util::toDouble(matcher.pattern); } else { // Set the value if parsing succeed numericMatcher = ret.first; } } else { type = TYPE_TEXT; matcher.setMethod(static_cast<StringMatch::Method>(defMethod)); matcher.prepare(); } } else if (propertyTypes[currentFilterProperty].filterType == TYPE_SIZE) { type = TYPE_SIZE; numericMatcher = prepareSize().first; } else if (propertyTypes[currentFilterProperty].filterType == TYPE_TIME) { type = TYPE_TIME; numericMatcher = prepareTime().first; } else if (propertyTypes[currentFilterProperty].filterType == TYPE_SPEED) { type = TYPE_SPEED; numericMatcher = prepareSpeed().first; } else if (propertyTypes[currentFilterProperty].filterType == TYPE_NUMERIC_OTHER || propertyTypes[currentFilterProperty].filterType == TYPE_LIST_NUMERIC) { type = TYPE_NUMERIC_OTHER; numericMatcher = Util::toDouble(matcher.pattern); } }