SVN_SILENT: some minor clean ups here and there
svn path=/trunk/KDE/kdelibs/; revision=934712
This commit is contained in:
parent
0fc65ada51
commit
89e8786c5d
@ -243,14 +243,16 @@ void RunnerContext::reset()
|
||||
// We will detach if we are a copy of someone. But we will reset
|
||||
// if we are the 'main' context others copied from. Resetting
|
||||
// one RunnerContext makes all the copies obsolete.
|
||||
|
||||
d->q = 0; //we need to mark the q pointer of the detached RunnerContextPrivate
|
||||
//as dirty on detach to avoid receiving results for old queries
|
||||
|
||||
//we need to mark the q pointer of the detached RunnerContextPrivate
|
||||
//as dirty on detach to avoid receiving results for old queries
|
||||
d->q = 0;
|
||||
|
||||
d.detach();
|
||||
|
||||
d->q = this; //now that we detached the d pointer we need to mark its q pointer as
|
||||
//this to receive the signals
|
||||
|
||||
//now that we detached the d pointer we need to mark its q pointer as
|
||||
//this to receive the signals
|
||||
d->q = this;
|
||||
|
||||
// we still have to remove all the matches, since if the
|
||||
// ref count was 1 (e.g. only the RunnerContext is using
|
||||
@ -301,7 +303,8 @@ bool RunnerContext::addMatches(const QString &term, const QList<QueryMatch> &mat
|
||||
{
|
||||
Q_UNUSED(term)
|
||||
|
||||
if (matches.isEmpty() || (!d->q)) { //Bail out if the query is empty or the qptr is dirty
|
||||
if (matches.isEmpty() || !d->q) {
|
||||
//Bail out if the query is empty or the qptr is dirty
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -321,7 +324,7 @@ bool RunnerContext::addMatches(const QString &term, const QList<QueryMatch> &mat
|
||||
// we always want to sent the signal of the object that created
|
||||
// the d pointer
|
||||
emit d->q->matchesChanged();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -329,17 +332,17 @@ bool RunnerContext::addMatch(const QString &term, const QueryMatch &match)
|
||||
{
|
||||
Q_UNUSED(term)
|
||||
|
||||
if (!d->q) { // Bail out if the qptr is dirty
|
||||
if (!d->q) {
|
||||
// Bail out if the qptr is dirty
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
LOCK_FOR_WRITE(this)
|
||||
d->matches.append(match);
|
||||
d->matchesById.insert(match.id(), &d->matches.at(d->matches.size() - 1));
|
||||
UNLOCK(this);
|
||||
//kDebug()<< "added match" << match->text();
|
||||
emit d->q->matchesChanged();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user