digiKam
|
Public Member Functions | |
void | addProperty (const QString &key, const QString &value) |
bool | hasProperty (const QString &key) const |
bool | hasProperty (const QString &key, const QString &value) const |
bool | isNull () const |
TagProperties & | operator= (const TagProperties &other) |
QMultiMap< QString, QString > | properties () const |
Returns a map of all key->value pairs. More... | |
QStringList | propertyKeys () const |
Returns all set property keys. More... | |
void | removeProperties (const QString &key) |
Remove all occurrences of the property. More... | |
void | removeProperty (const QString &key, const QString &value) |
Remove the given property/value. More... | |
void | setProperty (const QString &key, const QString &value) |
Set the given property. Replaces all previous occurrences of this property. More... | |
int | tagId () const |
TagProperties () | |
TagProperties (const TagProperties &other) | |
TagProperties (int tagId) | |
QString | value (const QString &key) const |
~TagProperties () | |
Static Public Member Functions | |
static TagProperties | getOrCreate (const QString &tagPath) |
Digikam::TagProperties::TagProperties | ( | ) |
This class provides a wrapper over the Database methods to access the properties of a tag. It is meant to be a short-lived object, it does not listen to external database changes.
Referenced by getOrCreate().
|
explicit |
Access the properties of the given tag
References Digikam::CoreDbAccess::db(), Digikam::CoreDB::getTagProperties(), properties(), Digikam::TagProperty::property, tagId(), and Digikam::TagProperty::value.
Digikam::TagProperties::~TagProperties | ( | ) |
Digikam::TagProperties::TagProperties | ( | const TagProperties & | other | ) |
void Digikam::TagProperties::addProperty | ( | const QString & | key, |
const QString & | value | ||
) |
Adds the given property. Does not change any previous occurrences of this property, allowing multiple properties with the same key.
References Digikam::CoreDB::addTagProperty(), Digikam::CoreDbAccess::db(), and value().
|
static |
Finds the tag for the given tag path or creates a new tag. Then returns the tag properties for this tag.
References Digikam::TagsCache::getOrCreateTag(), Digikam::TagsCache::instance(), tagId(), and TagProperties().
bool Digikam::TagProperties::hasProperty | ( | const QString & | key | ) | const |
Returns true if the property is set.
bool Digikam::TagProperties::hasProperty | ( | const QString & | key, |
const QString & | value | ||
) | const |
Returns true if the property is set, with exactly the given value.
References value().
bool Digikam::TagProperties::isNull | ( | ) | const |
TagProperties & Digikam::TagProperties::operator= | ( | const TagProperties & | other | ) |
QMultiMap< QString, QString > Digikam::TagProperties::properties | ( | ) | const |
Returns a map of all key->value pairs.
Referenced by TagProperties().
QStringList Digikam::TagProperties::propertyKeys | ( | ) | const |
Returns all set property keys.
void Digikam::TagProperties::removeProperties | ( | const QString & | key | ) |
Remove all occurrences of the property.
References Digikam::CoreDbAccess::db(), and Digikam::CoreDB::removeTagProperties().
Referenced by setProperty(), Digikam::TagModificationHelper::slotMultipleFaceTagDel(), and Digikam::TagsActionMngr::updateTagShortcut().
void Digikam::TagProperties::removeProperty | ( | const QString & | key, |
const QString & | value | ||
) |
Remove the given property/value.
References Digikam::CoreDbAccess::db(), Digikam::CoreDB::removeTagProperties(), and value().
void Digikam::TagProperties::setProperty | ( | const QString & | key, |
const QString & | value | ||
) |
Set the given property. Replaces all previous occurrences of this property.
References Digikam::CoreDB::addTagProperty(), Digikam::CoreDbAccess::db(), removeProperties(), and value().
Referenced by Digikam::FaceTags::applyTagIdentityMapping(), Digikam::TagsCache::getOrCreateTagWithProperty(), Digikam::FaceTags::ignoredPersonTagId(), Digikam::TagModificationHelper::slotTagEdit(), Digikam::FaceTags::unconfirmedPersonTagId(), Digikam::FaceTags::unknownPersonTagId(), and Digikam::TagsActionMngr::updateTagShortcut().
int Digikam::TagProperties::tagId | ( | ) | const |
Referenced by getOrCreate(), and TagProperties().
QString Digikam::TagProperties::value | ( | const QString & | key | ) | const |
Returns the value of the given property. If the property is not set, a null string is returned. But a null string is also returned if the property is set, but without a value. Use hasProperty to check that case.
Referenced by addProperty(), hasProperty(), removeProperty(), setProperty(), and Digikam::TagModificationHelper::slotMultipleFaceTagDel().