rem: kdDebug(5006) << "TextRuleWidgetHandler::setRule()" << endl;
context:   bool TextRuleWidgetHandler::setRule( QWidgetStack *functionStack,                                       QWidgetStack *valueStack,                                       const KMSearchRule *rule ) const  {    kdDebug(5006) << "TextRuleWidgetHandler::setRule()" << endl;    if ( !rule ) {      reset( functionStack, valueStack );      return false;    }    const KMSearchRule::Function func = rule->function();    int i = 0;    for ( ; i < TextFunctionCount; ++i )      if ( func == TextFunctions[i].id )        break;    QComboBox *funcCombo =      dynamic_cast<QComboBox*>( functionStack->child( "textRuleFuncCombo",                                                      0, false ) );    if ( funcCombo ) {      funcCombo->blockSignals( true );      if ( i < TextFunctionCount )        funcCombo->setCurrentItem( i );      else {        kdDebug(5006) << "TextRuleWidgetHandler::setRule( "                      << rule->asString()                      << " ): unhandled function" << endl;        funcCombo->setCurrentItem( 0 );      }      funcCombo->blockSignals( false );      functionStack->raiseWidget( funcCombo );    }    if ( func == KMSearchRule::FuncIsInAddressbook ||         func == KMSearchRule::FuncIsNotInAddressbook ) {      QWidget *w =        static_cast<QWidget*>( valueStack->child( "textRuleValueHider",                                                  0, false ) );      valueStack->raiseWidget( w );    }    else {      RegExpLineEdit *lineEdit =        dynamic_cast<RegExpLineEdit*>( valueStack->child( "regExpLineEdit",                                                          0, false ) );      if ( lineEdit ) {        lineEdit->blockSignals( true );        lineEdit->setText( rule->contents() );        lineEdit->blockSignals( false );        lineEdit->showEditButton( func == KMSearchRule::FuncRegExp ||                                  func == KMSearchRule::FuncNotRegExp );        valueStack->raiseWidget( lineEdit );      }    }    return true;  }