~ubuntu-branches/ubuntu/karmic/digikam/karmic-backports

« back to all changes in this revision

Viewing changes to utilities/advancedrename/parsers/subparsers/cameranameparser.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ubuntu Archive Auto-Backport
  • Date: 2009-12-07 19:03:53 UTC
  • mfrom: (54.1.4 lucid)
  • Revision ID: james.westby@ubuntu.com-20091207190353-oara3lenjxymto3i
Tags: 2:1.0.0~rc-1ubuntu1~karmic1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ============================================================
2
 
 *
3
 
 * This file is a part of digiKam project
4
 
 * http://www.digikam.org
5
 
 *
6
 
 * Date        : 2009-08-08
7
 
 * Description : a camera name parser class
8
 
 *
9
 
 * Copyright (C) 2009 by Andi Clemens <andi dot clemens at gmx dot net>
10
 
 *
11
 
 * This program is free software; you can redistribute it
12
 
 * and/or modify it under the terms of the GNU General
13
 
 * Public License as published by the Free Software Foundation;
14
 
 * either version 2, or (at your option)
15
 
 * any later version.
16
 
 *
17
 
 * This program is distributed in the hope that it will be useful,
18
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
 * GNU General Public License for more details.
21
 
 *
22
 
 * ============================================================ */
23
 
 
24
 
#include "cameranameparser.h"
25
 
#include "cameranameparser.moc"
26
 
 
27
 
// KDE includes
28
 
 
29
 
#include <kiconloader.h>
30
 
#include <klocale.h>
31
 
 
32
 
// Local includes
33
 
 
34
 
#include "parser.h"
35
 
 
36
 
namespace Digikam
37
 
{
38
 
 
39
 
CameraNameParser::CameraNameParser()
40
 
                : SubParser(i18n("Camera Name"), i18n("Add the camera name"),
41
 
                            SmallIcon("camera-photo"))
42
 
{
43
 
    addTokenDescription("[cam]", i18n("Camera Name"), i18n("Camera name"));
44
 
 
45
 
    setRegExp("\\[cam\\]");
46
 
}
47
 
 
48
 
void CameraNameParser::parseOperation(const QString& parseString, const ParseInformation& info, ParseResults& results)
49
 
{
50
 
    QRegExp reg = regExp();
51
 
    reg.setCaseSensitivity(Qt::CaseInsensitive);
52
 
 
53
 
    // --------------------------------------------------------
54
 
 
55
 
    QString tmp;
56
 
    PARSE_LOOP_START(parseString, reg)
57
 
    {
58
 
        tmp = Parser::stringIsValid(info.cameraName) ? info.cameraName : QString();
59
 
    }
60
 
    PARSE_LOOP_END(parseString, reg, tmp, results)
61
 
}
62
 
 
63
 
} // namespace Digikam