~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to libs/database/imagelister.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-06-18 21:58:46 UTC
  • mfrom: (1.2.29 upstream) (3.2.13 sid)
  • Revision ID: james.westby@ubuntu.com-20100618215846-c95bk5aoysmu786d
Tags: 2:1.3.0-0ubuntu1
* Merge with Debian unstable, remaining changes:
  - Export .pot name and copy to plugins in debian/rules
  - Enable Nepomuk support in Digikam
    - Add shared-desktop-ontologies to build depends
* New upstream release:
  - Remove digikam-1.2.0-kde232628.patch fixed by upstream
  - Add mysql-server-5.1 to buil-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
#include "imagequerybuilder.h"
58
58
#include "dmetadata.h"
59
59
#include "haariface.h"
 
60
#include "sqlquery.h"
60
61
 
61
62
namespace Digikam
62
63
{
237
238
void ImageLister::listTag(ImageListerReceiver *receiver, int tagId)
238
239
{
239
240
    QList<QVariant> values;
240
 
 
241
 
    QString query = QString( "SELECT DISTINCT Images.id, Images.name, Images.album, "
242
 
                             "       Albums.albumRoot, "
243
 
                             "       ImageInformation.rating, Images.category, "
244
 
                             "       ImageInformation.format, ImageInformation.creationDate, "
245
 
                             "       Images.modificationDate, Images.fileSize, "
246
 
                             "       ImageInformation.width, ImageInformation.height "
247
 
                             " FROM Images "
248
 
                             "       INNER JOIN ImageInformation ON Images.id=ImageInformation.imageid "
249
 
                             "       INNER JOIN Albums ON Albums.id=Images.album "
250
 
                             " WHERE Images.status=1 AND Images.id IN "
251
 
                             "       (SELECT imageid FROM ImageTags "
252
 
                             "        WHERE tagid=? ");
253
 
 
 
241
    QMap<QString, QVariant> parameters;
 
242
    parameters.insert(":tagPID", tagId);
 
243
    parameters.insert(":tagID",  tagId);
 
244
 
 
245
    DatabaseAccess access;
 
246
    
254
247
    if (m_recursive)
255
248
    {
256
 
        query += "OR tagid IN (SELECT id FROM TagsTree WHERE pid=?)); ";
257
 
        DatabaseAccess().backend()->execSql( query, tagId, tagId, &values );
 
249
      access.backend()->execDBAction(access.backend()->getDBAction(QString("listTagRecursive")), parameters, &values);
258
250
    }
259
251
    else
260
252
    {
261
 
        query += "); ";
262
 
        DatabaseAccess().backend()->execSql( query, tagId, &values );
 
253
      access.backend()->execDBAction(access.backend()->getDBAction(QString("listTag")), parameters, &values);
263
254
    }
264
255
 
265
256
    QSet<int> albumRoots = albumRootsToList();
557
548
        executionSuccess = query.execBatch
558
549
        */
559
550
        DatabaseAccess access;
560
 
        QSqlQuery query = access.backend()->prepareQuery(QString(
 
551
        SqlQuery query = access.backend()->prepareQuery(QString(
561
552
                             "SELECT DISTINCT Images.id, Images.name, Images.album, "
562
553
                             "       Albums.albumRoot, "
563
554
                             "       ImageInformation.rating, Images.category, "