* add subtext() so we can do some fancier painting of the results a bit easier
* remove some API that seemed well intentioned at the time, but has proven itself not useful svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=777009
This commit is contained in:
parent
756041badd
commit
ee91508f3c
@ -41,11 +41,10 @@ class SearchMatch::Private
|
||||
{
|
||||
}
|
||||
|
||||
QString searchTerm;
|
||||
AbstractRunner *runner;
|
||||
SearchMatch::Type type;
|
||||
QString mimetype;
|
||||
QString text;
|
||||
QString subtext;
|
||||
QIcon icon;
|
||||
QVariant data;
|
||||
bool enabled;
|
||||
@ -73,21 +72,6 @@ SearchMatch::Type SearchMatch::type() const
|
||||
return d->type;
|
||||
}
|
||||
|
||||
void SearchMatch::setMimetype(const QString &mimetype)
|
||||
{
|
||||
d->mimetype = mimetype;
|
||||
}
|
||||
|
||||
QString SearchMatch::mimetype() const
|
||||
{
|
||||
return d->mimetype;
|
||||
}
|
||||
/*
|
||||
QString SearchMatch::searchTerm() const
|
||||
{
|
||||
return d->searchTerm;
|
||||
}
|
||||
*/
|
||||
void SearchMatch::setRelevance(qreal relevance)
|
||||
{
|
||||
d->relevance = qMax(qreal(0.0), qMin(qreal(1.0), relevance));
|
||||
@ -108,6 +92,11 @@ void SearchMatch::setText(const QString& text)
|
||||
d->text = text;
|
||||
}
|
||||
|
||||
void SearchMatch::setSubtext(const QString& subtext)
|
||||
{
|
||||
d->subtext = subtext;
|
||||
}
|
||||
|
||||
void SearchMatch::setData(const QVariant& data)
|
||||
{
|
||||
d->data = data;
|
||||
@ -128,6 +117,11 @@ QString SearchMatch::text() const
|
||||
return d->text;
|
||||
}
|
||||
|
||||
QString SearchMatch::subtext() const
|
||||
{
|
||||
return d->subtext;
|
||||
}
|
||||
|
||||
QIcon SearchMatch::icon() const
|
||||
{
|
||||
return d->icon;
|
||||
@ -152,7 +146,7 @@ void SearchMatch::exec(const SearchContext *context) const
|
||||
{
|
||||
Q_ASSERT(context);
|
||||
|
||||
//kDebug() << "we have" << d->searchTerm << d->mimetype;
|
||||
//kDebug() << "we have" << context->searchTerm() << context->mimetype();
|
||||
if (d->runner) {
|
||||
//TODO: this could be dangerous if the runner is deleted behind our backs.
|
||||
d->runner->exec(context, this);
|
||||
|
@ -63,23 +63,6 @@ class PLASMA_EXPORT SearchMatch
|
||||
*/
|
||||
Type type() const;
|
||||
|
||||
/**
|
||||
* Sets the mimetype, if any, associated with this match
|
||||
*
|
||||
* @arg mimetype the mimetype
|
||||
*/
|
||||
void setMimetype(const QString &mimetype);
|
||||
|
||||
/**
|
||||
* The mimetype associated with this action, if any
|
||||
*/
|
||||
QString mimetype() const;
|
||||
|
||||
/**
|
||||
* The search term that triggered this action
|
||||
*/
|
||||
//QString searchTerm() const;
|
||||
|
||||
/**
|
||||
* Sets the relevance of this action for the search
|
||||
* it was created for.
|
||||
@ -102,11 +85,13 @@ class PLASMA_EXPORT SearchMatch
|
||||
AbstractRunner* runner() const;
|
||||
|
||||
void setText(const QString& text);
|
||||
void setSubtext(const QString& text);
|
||||
void setData(const QVariant& data);
|
||||
void setIcon(const QIcon& icon);
|
||||
void setEnabled(bool enable);
|
||||
|
||||
QString text() const;
|
||||
QString subtext() const;
|
||||
QVariant data() const;
|
||||
QIcon icon() const;
|
||||
bool isEnabled() const;
|
||||
|
Loading…
Reference in New Issue
Block a user