SearchTerm -> Query

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803374
This commit is contained in:
Aaron J. Seigo 2008-05-02 18:17:09 +00:00
parent a329771ad5
commit a8647e4ecc
5 changed files with 14 additions and 14 deletions

View File

@ -73,7 +73,7 @@ class PLASMA_EXPORT AbstractRunner : public QObject
* SearchMatch instances through RunnerContext::addInformationalMatch,
* RunnerContext::addExactMatch, and RunnerContext::addPossibleMatch.
*
* If the runner can run precisely the requested term (RunnerContext::searchTerm),
* If the runner can run precisely the requested term (RunnerContext::query()),
* it should create an exact match (RunnerContext::addExactMatch).
* The first runner that creates a SearchMatch will be the
* default runner. Other runner's matches will be suggested in the

View File

@ -177,7 +177,7 @@ void RunnerContext::reset()
//kDebug() << "match count" << d->matches.count();
}
void RunnerContext::setSearchTerm(const QString &term)
void RunnerContext::setQuery(const QString &term)
{
reset();
@ -192,7 +192,7 @@ void RunnerContext::setSearchTerm(const QString &term)
}
QString RunnerContext::searchTerm() const
QString RunnerContext::query() const
{
LOCK_FOR_READ(this)
QString term = d->term;
@ -212,7 +212,7 @@ QString RunnerContext::mimeType() const
bool RunnerContext::addMatches(const QString& term, const QList<SearchMatch*> &matches)
{
if (searchTerm() != term || matches.isEmpty()) {
if (query() != term || matches.isEmpty()) {
return false;
}
@ -229,7 +229,7 @@ bool RunnerContext::addMatches(const QString& term, const QList<SearchMatch*> &m
bool RunnerContext::addMatch(const QString &term, SearchMatch *match)
{
if (searchTerm() != term) {
if (query() != term) {
return false;
}

View File

@ -82,15 +82,15 @@ class PLASMA_EXPORT RunnerContext : public QObject
void reset();
/**
* Sets the search term for this object and attempts to determine
* Sets the query term for this object and attempts to determine
* the type of the search.
*/
void setSearchTerm(const QString&);
void setQuery(const QString& term);
/**
* @return the current search term.
* @return the current search query term.
*/
QString searchTerm() const;
QString query() const;
/**
* The type of item the search term might refer to.

View File

@ -341,14 +341,14 @@ void RunnerManager::launchQuery (const QString & term, const QString & runnerNam
return;
}
if (d->context.searchTerm() == term) {
if (d->context.query() == term) {
// we already are searching for this!
return;
}
reset();
// kDebug() << "runners searching for" << term << "on" << runnerName;
d->context.setSearchTerm(term);
d->context.setQuery(term);
AbstractRunner::List runable;
@ -382,14 +382,14 @@ bool RunnerManager::execQuery (const QString & term, const QString & runnerName)
return false;
}
if (d->context.searchTerm() == term) {
if (d->context.query() == term) {
// we already are searching for this!
return false;
}
reset();
// kDebug() << "executing query about " << term << "on" << runnerName;
d->context.setSearchTerm(term);
d->context.setQuery(term);
AbstractRunner *r = runner(runnerName);

View File

@ -148,7 +148,7 @@ void SearchMatch::run(const RunnerContext *context) const
{
Q_ASSERT(context);
//kDebug() << "we run the term" << context->searchTerm() << "whose type is" << context->mimetype();
//kDebug() << "we run the term" << context->query() << "whose type is" << context->mimetype();
if (d->runner) {
//TODO: this could be dangerous if the runner is deleted behind our backs.
d->runner->run(context, this);