36 #include <QtCore/QList>
38 using namespace KTnef;
40 class KTNEFPropertySet::Private
43 QMap<int,KTNEFProperty*> properties_;
44 QMap<int,KTNEFProperty*> attributes_;
60 const QVariant &name,
bool overwrite )
62 QMap<int,KTNEFProperty*>::ConstIterator it = d->properties_.constFind( key );
63 if ( it != d->properties_.constEnd() ) {
71 d->properties_[ p->
key() ] = p;
77 QMap<int,KTNEFProperty*>::Iterator it = d->properties_.find( key );
78 if ( d->properties_.end() != it ) {
88 const QString &fallback,
91 for ( QMap<int,KTNEFProperty*>::Iterator it = d->properties_.begin();
92 it != d->properties_.end();
94 if ( (*it)->name().isValid() ) {
96 if ( (*it)->name().type() == QVariant::String ) {
97 s = (*it)->name().toString();
99 s = QString().sprintf(
"0X%04X", (*it)->name().toUInt() );
102 if ( s.toUpper() == name.toUpper() ) {
103 QVariant value = ( *it )->value();
104 if ( value.type() == QVariant::List ) {
105 QList<QVariant> l = value.toList();
107 for ( QList<QVariant>::ConstIterator lit = l.constBegin();
110 if ( !s.isEmpty() ) {
118 return upper ? s.toUpper() : s;
127 return d->properties_;
132 return d->properties_;
137 QMap<int,KTNEFProperty*>::ConstIterator it = d->properties_.constFind( key );
138 if ( it == d->properties_.constEnd() ) {
141 return ( *it )->value();
148 for ( QMap<int,KTNEFProperty*>::ConstIterator it=d->properties_.constBegin();
149 it != d->properties_.constEnd();
152 for ( QMap<int,KTNEFProperty*>::ConstIterator it=d->attributes_.constBegin();
153 it != d->attributes_.constEnd();
157 d->properties_.clear();
158 d->attributes_.clear();
164 QMap<int,KTNEFProperty*>::ConstIterator it = d->attributes_.constFind( key );
165 if ( it != d->attributes_.constEnd() ) {
173 d->attributes_[ p->
key() ] = p;
178 return d->attributes_;
183 return d->attributes_;
188 QMap<int,KTNEFProperty*>::ConstIterator it = d->attributes_.constFind( key );
189 if ( it == d->attributes_.constEnd() ) {
192 return ( *it )->value();