~ubuntu-branches/ubuntu/quantal/kactivities/quantal

« back to all changes in this revision

Viewing changes to service/plugins/nepomuk/NepomukResourceScoreCache.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-12-23 23:39:41 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: package-import@ubuntu.com-20111223233941-zxczsd6dixwmaco2
Tags: upstream-4.7.95
Import upstream version 4.7.95

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
NepomukResourceScoreCache::NepomukResourceScoreCache(const QString & activity, const QString & application, const QUrl & resource)
68
68
    : d(new NepomukResourceScoreCachePrivate())
69
69
{
70
 
    // kDebug() << "Cache for" << activity << application << resource << anyResource(resource).resourceUri();
 
70
    kDebug() << "Cache for" << activity << application << resource << anyResource(resource).resourceUri();
71
71
 
72
72
    d->activity = activity;
73
73
    d->application = application;
98
98
 
99
99
        d->self = result;
100
100
 
101
 
        // kDebug() << "Found an old cache" << d->self.resourceUri() << d->self.resourceType()
102
 
        //          << "With a score of" << d->self.property(KExt::cachedScore()) << d->self.property(NAO::score());
 
101
        kDebug() << "Found an old cache" << d->self.resourceUri() << d->self.resourceType()
 
102
                 << "With a score of" << d->self.property(KExt::cachedScore()) << d->self.property(NAO::score());
103
103
 
104
104
    } else {
105
105
        Nepomuk::Resource result(QUrl(), KExt::ResourceScoreCache());
118
118
 
119
119
        d->self = result;
120
120
 
121
 
        // kDebug() << "Created a new cache resource" << d->self.resourceUri() << d->self.resourceType();
 
121
        kDebug() << "Created a new cache resource" << d->self.resourceUri() << d->self.resourceType();
122
122
 
123
123
    }
124
124
}
217
217
 
218
218
    }
219
219
 
220
 
    // kDebug() << "New calculated score:" << score << d->self.isValid();
221
 
    d->self.setProperty(KExt::cachedScore(), score);
222
 
    d->self.setProperty(NAO::score(), score);
 
220
    kDebug() << "New calculated score:" << d->resource << score << d->self.isValid();
 
221
 
 
222
    // Forcing immediate sync of the score, in case of kamd being terminated improperly
 
223
    {
 
224
        Nepomuk::Resource resource(d->self);
 
225
        resource.setProperty(KExt::cachedScore(), score);
 
226
        resource.setProperty(NAO::score(), score);
 
227
    }
223
228
 
224
229
    Rankings::self()->resourceScoreUpdated(d->activity, d->application, d->resource, score);
225
230
}