Changeset View
Changeset View
Standalone View
Standalone View
src/lib/term.cpp
Show First 20 Lines • Show All 456 Lines • ▼ Show 20 Line(s) | 448 | QString operationToString(Baloo::Term::Operation op) { | |||
---|---|---|---|---|---|
457 | 457 | | |||
458 | return QString(); | 458 | return QString(); | ||
459 | } | 459 | } | ||
460 | } | 460 | } | ||
461 | 461 | | |||
462 | QDebug operator <<(QDebug d, const Baloo::Term& t) | 462 | QDebug operator <<(QDebug d, const Baloo::Term& t) | ||
463 | { | 463 | { | ||
464 | QDebugStateSaver saver(d); | 464 | QDebugStateSaver saver(d); | ||
465 | d.noquote(); | 465 | d.noquote().nospace(); | ||
466 | if (t.subTerms().isEmpty()) { | 466 | if (t.subTerms().isEmpty()) { | ||
467 | d << QStringLiteral("(%1 %2 %3(%4))").arg(t.property(), | 467 | if (!t.property().isEmpty()) { | ||
468 | comparatorToString(t.comparator()), | 468 | d << t.property() << comparatorToString(t.comparator()); | ||
469 | QString::fromLatin1(t.value().typeName()), | 469 | } | ||
470 | t.value().toString()); | 470 | if (t.value().type() == QVariant::String) { | ||
471 | d << QLatin1Char('"') << t.value().toString() << QLatin1Char('"'); | ||||
472 | } else { | ||||
473 | d << t.value().typeName() << QLatin1Char('(') | ||||
474 | << t.value().toString() << QLatin1Char(')'); | ||||
475 | } | ||||
471 | } | 476 | } | ||
472 | else { | 477 | else { | ||
473 | d << "[" << operationToString(t.operation()); | 478 | d << "[" << operationToString(t.operation()); | ||
474 | const auto subTerms = t.subTerms(); | 479 | const auto subTerms = t.subTerms(); | ||
475 | for (const Baloo::Term& term : subTerms) { | 480 | for (const Baloo::Term& term : subTerms) { | ||
476 | d << term; | 481 | d << QLatin1Char(' ') << term; | ||
477 | } | 482 | } | ||
478 | d << "]"; | 483 | d << "]"; | ||
479 | } | 484 | } | ||
480 | return d; | 485 | return d; | ||
481 | } | 486 | } |