~ubuntu-branches/ubuntu/natty/digikam/natty

« back to all changes in this revision

Viewing changes to libs/database/tagscache.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2010-08-26 19:25:16 UTC
  • mfrom: (1.2.30 upstream)
  • Revision ID: james.westby@ubuntu.com-20100826192516-mkbdww0h5v2x4yoy
Tags: 2:1.4.0-0ubuntu1
* New upstream bugfix release (LP: #626751)
* Install the file NEWS as upstream changelog because "ChangeLog" is
  too verbose.
* Don't copy the desktop .pot file to imageplugins, not needed anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
    return d->nameHash.values(tagName);
207
207
}
208
208
 
 
209
int TagsCache::tagForName(const QString& tagName, int parentId)
 
210
{
 
211
    d->checkNameHash();
 
212
    QReadLocker locker(&d->lock);
 
213
 
 
214
    QList<TagShortInfo>::const_iterator tag;
 
215
    foreach (int id, d->nameHash.values(tagName))
 
216
    {
 
217
        tag = d->find(id);
 
218
        if (tag == d->infos.constEnd())
 
219
            continue; // error
 
220
 
 
221
        if (tag->pid == parentId)
 
222
            return tag->id;
 
223
    }
 
224
    return 0;
 
225
}
 
226
 
209
227
bool TagsCache::hasTag(int id)
210
228
{
211
229
    d->checkInfos();