digiKam
Digikam::TagProperties Class Reference

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
 
TagPropertiesoperator= (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)
 

Constructor & Destructor Documentation

◆ TagProperties() [1/3]

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().

◆ TagProperties() [2/3]

Digikam::TagProperties::TagProperties ( int  tagId)
explicit

◆ ~TagProperties()

Digikam::TagProperties::~TagProperties ( )

◆ TagProperties() [3/3]

Digikam::TagProperties::TagProperties ( const TagProperties other)

Member Function Documentation

◆ addProperty()

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().

◆ getOrCreate()

TagProperties Digikam::TagProperties::getOrCreate ( const QString &  tagPath)
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().

◆ hasProperty() [1/2]

bool Digikam::TagProperties::hasProperty ( const QString &  key) const

Returns true if the property is set.

◆ hasProperty() [2/2]

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().

◆ isNull()

bool Digikam::TagProperties::isNull ( ) const

◆ operator=()

TagProperties & Digikam::TagProperties::operator= ( const TagProperties other)

◆ properties()

QMultiMap< QString, QString > Digikam::TagProperties::properties ( ) const

Returns a map of all key->value pairs.

Referenced by TagProperties().

◆ propertyKeys()

QStringList Digikam::TagProperties::propertyKeys ( ) const

Returns all set property keys.

◆ removeProperties()

void Digikam::TagProperties::removeProperties ( const QString &  key)

◆ removeProperty()

void Digikam::TagProperties::removeProperty ( const QString &  key,
const QString &  value 
)

Remove the given property/value.

References Digikam::CoreDbAccess::db(), Digikam::CoreDB::removeTagProperties(), and value().

◆ setProperty()

◆ tagId()

int Digikam::TagProperties::tagId ( ) const

Referenced by getOrCreate(), and TagProperties().

◆ value()

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().


The documentation for this class was generated from the following files: