22 namespace KTraderParse {
52 _context->
b = ( c1.
b || c2.
b );
79 _context->
b = ( c1.
b && c2.
b );
163 _context->
f = ( c1.
f + c2.
f );
168 _context->
i = ( c1.
i + c2.
i );
175 _context->
f = ( c1.
f - c2.
f );
180 _context->
i = ( c1.
i - c2.
i );
188 _context->
f = ( c1.
f * c2.
f );
193 _context->
i = ( c1.
i * c2.
i );
200 _context->
f = ( c1.
f / c2.
f );
205 _context->
i = ( c1.
i / c2.
i );
256 _context->
b = QString::compare(c1.
str, c2.
str, Qt::CaseInsensitive) == 0;
258 _context->
b = ( c1.
str == c2.
str );
264 _context->
b = ( c1.
b == c2.
b );
269 _context->
b = ( c1.
f == c2.
f );
274 _context->
b = ( c1.
i == c2.
i );
287 _context->
b = QString::compare(c1.
str, c2.
str, Qt::CaseInsensitive) != 0;
289 _context->
b = ( c1.
str != c2.
str );
295 _context->
b = ( c1.
b != c2.
b );
300 _context->
b = ( c1.
f != c2.
f );
305 _context->
b = ( c1.
i != c2.
i );
317 _context->
b = ( c1.
f >= c2.
f );
322 _context->
b = ( c1.
i >= c2.
i );
336 _context->
b = ( c1.
f <= c2.
f );
341 _context->
b = ( c1.
i <= c2.
i );
355 _context->
b = ( c1.
f < c2.
f );
360 _context->
b = ( c1.
i < c2.
i );
374 _context->
b = ( c1.
f > c2.
f );
379 _context->
b = ( c1.
i > c2.
i );
409 _context->
b = prop.isValid();
445 ((*(c2.
seq.begin())).type() == QVariant::Int)) {
447 QList<QVariant>::ConstIterator it = c2.
seq.constBegin();
448 QList<QVariant>::ConstIterator end = c2.
seq.constEnd();
450 for (; it != end; ++it)
451 if ((*it).type() == QVariant::Int &&
452 (*it).toInt() == c1.
i) {
461 (*(c2.
seq.begin())).type() == QVariant::Double) {
463 QList<QVariant>::ConstIterator it = c2.
seq.constBegin();
464 QList<QVariant>::ConstIterator end = c2.
seq.constEnd();
466 for (; it != end; ++it)
467 if ((*it).type() == QVariant::Double &&
468 (*it).toDouble() == c1.
i) {
480 if (
string.contains(c1.
str,
m_cs)) {
498 if ( !prop.isValid() )
501 if ( prop.type() == QVariant::String )
503 _context->
str = prop.toString();
508 if ( prop.type() == QVariant::Int )
510 _context->
i = prop.toInt();
515 if ( prop.type() == QVariant::Bool )
517 _context->
b = prop.toBool();
522 if ( prop.type() == QVariant::Double )
524 _context->
f = prop.toDouble();
531 _context->
seq = prop.toList();
536 if ( prop.type() == QVariant::StringList )
538 _context->
strSeq = prop.toStringList();
552 if ( !prop.isValid() )
559 if ( it == _context->
maxima.end() )
564 _context->
f = (
double)( prop.toInt() - it.value().iMin ) /
565 (
double)(it.value().iMax - it.value().iMin ) * (-2.0) + 1.0;
570 _context->
f = ( prop.toDouble() - it.value().fMin ) / (it.value().fMax - it.value().fMin )
583 if ( !prop.isValid() )
592 if ( it == _context->
maxima.end() )
597 _context->
f = (
double)( prop.toInt() - it.value().iMin ) /
598 (
double)(it.value().iMax - it.value().iMin ) * 2.0 - 1.0;
603 _context->
f = ( prop.toDouble() - it.value().fMin ) /
604 (it.value().fMax - it.value().fMin ) * 2.0 - 1.0;
622 if ( !_tree->
eval( &c ) )
629 return ( c.
b ? 1 : 0 );
636 if ( !prop.isValid() )
640 if ( prop.type() != QVariant::Int && prop.type() != QVariant::Double )
651 if ( prop.type() == QVariant::Int )
657 KService::List::ConstIterator oit =
offers.begin();
658 for( ; oit !=
offers.end(); ++oit )
660 QVariant p = (*oit)->property( _prop );
667 extrema.
iMin = p.toInt();
668 extrema.
iMax = p.toInt();
673 if ( p.toInt() < extrema.
iMin )
674 extrema.
iMin = p.toInt();
675 if ( p.toInt() > extrema.
iMax )
676 extrema.
iMax = p.toInt();
682 extrema.
fMin = p.toDouble();
683 extrema.
fMax = p.toDouble();
688 if ( p.toDouble() < it.value().fMin )
689 extrema.
fMin = p.toDouble();
690 if ( p.toDouble() > it.value().fMax )
691 extrema.
fMax = p.toDouble();
697 maxima.insert( _prop, extrema );