1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : a camera name parser class
9
* Copyright (C) 2009 by Andi Clemens <andi dot clemens at gmx dot net>
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)
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.
22
* ============================================================ */
24
#include "cameranameparser.h"
25
#include "cameranameparser.moc"
29
#include <kiconloader.h>
39
CameraNameParser::CameraNameParser()
40
: SubParser(i18n("Camera Name"), i18n("Add the camera name"),
41
SmallIcon("camera-photo"))
43
addTokenDescription("[cam]", i18n("Camera Name"), i18n("Camera name"));
45
setRegExp("\\[cam\\]");
48
void CameraNameParser::parseOperation(const QString& parseString, const ParseInformation& info, ParseResults& results)
50
QRegExp reg = regExp();
51
reg.setCaseSensitivity(Qt::CaseInsensitive);
53
// --------------------------------------------------------
56
PARSE_LOOP_START(parseString, reg)
58
tmp = Parser::stringIsValid(info.cameraName) ? info.cameraName : QString();
60
PARSE_LOOP_END(parseString, reg, tmp, results)
63
} // namespace Digikam