Some filter fixes.

Patch by Marc Mutz <Marc.Mutz@uni-bielefeld.de>

svn path=/trunk/kdenetwork/kmail/; revision=98117
wilder-work
Michael Haeckel 25 years ago
parent fe832697f1
commit db9f4d2732
  1. 2
      kmfilterdlg.cpp
  2. 17
      kmsearchpatternedit.cpp
  3. 2
      mailinglist-magic.cpp

@ -170,7 +170,7 @@ KMFilterListBox::KMFilterListBox( const QString & title, QWidget *parent, const
void KMFilterListBox::createFilter( const QString field, const QString value )
{
KMSearchRule *newRule = new KMSearchRule();
newRule->init( field, KMSearchRule::FuncEquals, value );
newRule->init( field, KMSearchRule::FuncContains, value );
KMFilter *newFilter = new KMFilter();
newFilter->pattern()->append( newRule );

@ -62,6 +62,7 @@ void KMSearchRuleWidget::setRule(KMSearchRule *aRule)
{
assert ( aRule );
blockSignals(TRUE);
//--------------set the field
int i = indexOfRuleField( aRule->field() );
@ -76,6 +77,8 @@ void KMSearchRuleWidget::setRule(KMSearchRule *aRule)
//--------------set function and contents
mRuleFunc->setCurrentItem( (int)aRule->function() );
mRuleValue->setText( aRule->contents() );
blockSignals(FALSE);
}
KMSearchRule* KMSearchRuleWidget::rule() const
@ -91,12 +94,16 @@ KMSearchRule* KMSearchRuleWidget::rule() const
void KMSearchRuleWidget::reset()
{
blockSignals(TRUE);
mRuleField->changeItem( " ", 0 );
mRuleField->setCurrentItem( 0 );
mRuleFunc->setCurrentItem( 0 );
mRuleValue->clear();
blockSignals(FALSE);
}
QString KMSearchRuleWidget::ruleFieldToEnglish(const QString & i18nVal) const
@ -314,26 +321,28 @@ void KMSearchPatternEdit::setSearchPattern( KMSearchPattern *aPattern )
{
assert( aPattern );
blockSignals(TRUE);
mRuleLister->setRuleList( aPattern );
mPattern = aPattern;
blockSignals(TRUE);
if ( mPattern->op() == KMSearchPattern::OpOr )
mAnyRBtn->setChecked(TRUE);
else
mAllRBtn->setChecked(TRUE);
blockSignals(FALSE);
setEnabled( TRUE );
blockSignals(FALSE);
}
void KMSearchPatternEdit::reset()
{
mRuleLister->reset();
blockSignals(TRUE);
mAllRBtn->setChecked( TRUE );
blockSignals(FALSE);
setEnabled( FALSE );
}

@ -104,7 +104,7 @@ static QString check_list_id(const KMMessage *message,
return QString::null;
header_name = "List-Id";
header_value = header;
header_value = header.mid( lAnglePos );
header = header.mid( lAnglePos + 1, firstDotPos - lAnglePos - 1 );
return header;
}

Loading…
Cancel
Save