be careful with d->runner

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=805665
This commit is contained in:
Aaron J. Seigo 2008-05-09 04:32:54 +00:00
parent 6019dc7b27
commit 57ce2ba858
2 changed files with 14 additions and 2 deletions

View File

@ -73,7 +73,9 @@ class QueryMatch::Private : public QSharedData
QueryMatch::QueryMatch(AbstractRunner *runner)
: d(new Private(runner))
{
d->id = runner->id();
if (d->runner) {
d->id = runner->id();
}
// kDebug() << "new match created";
}
@ -86,6 +88,11 @@ QueryMatch::~QueryMatch()
{
}
bool QueryMatch::isValid() const
{
return d->runner != 0;
}
QString QueryMatch::id() const
{
return d->id;
@ -134,7 +141,10 @@ void QueryMatch::setData(const QVariant& data)
void QueryMatch::setId(const QString &id)
{
d->id = d->runner->id();
if (d->runner) {
d->id = d->runner->id();
}
if (!id.isEmpty()) {
d->id.append('_').append(id);

View File

@ -77,6 +77,8 @@ class PLASMA_EXPORT QueryMatch
~QueryMatch();
bool isValid() const;
/**
* Sets the type of match this action represents.
*/