diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/koproperty/set.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/koproperty/set.cpp')
-rw-r--r-- | lib/koproperty/set.cpp | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/lib/koproperty/set.cpp b/lib/koproperty/set.cpp index 2e016b64..3193a50f 100644 --- a/lib/koproperty/set.cpp +++ b/lib/koproperty/set.cpp @@ -23,15 +23,15 @@ #include "property.h" #include "utils.h" -#include <qapplication.h> -#include <qasciidict.h> -//#include <qvaluelist.h> +#include <tqapplication.h> +#include <tqasciidict.h> +//#include <tqvaluelist.h> #include <kdebug.h> #include <klocale.h> -typedef QMap<QCString, QValueList<QCString> > StringListMap; -typedef QMapIterator<QCString, QStringList> StringListMapIterator; +typedef TQMap<TQCString, TQValueList<TQCString> > StringListMap; +typedef TQMapIterator<TQCString, TQStringList> StringListMapIterator; namespace KoProperty { @@ -55,25 +55,25 @@ class SetPrivate //groups of properties: // list of group name: (list of property names) StringListMap propertiesOfGroup; - QValueList<QCString> groupNames; - QMap<QCString, QString> groupDescriptions; - QMap<QCString, QString> groupIcons; + TQValueList<TQCString> groupNames; + TQMap<TQCString, TQString> groupDescriptions; + TQMap<TQCString, TQString> groupIcons; // map of property: group - QMap<Property*, QCString> groupForProperty; + TQMap<Property*, TQCString> groupForProperty; bool ownProperty : 1; bool readOnly : 1; // static Property nonConstNull; - QCString prevSelection; - QString typeName; + TQCString prevSelection; + TQString typeName; //! Used in Set::informAboutClearing(Property*) to declare that the property wants //! to be informed that the set has been cleared (all properties are deleted) bool* informAboutClearing; - inline KoProperty::Property& property(const QCString &name) const + inline KoProperty::Property& property(const TQCString &name) const { - KoProperty::Property *p = dict.find(name); + KoProperty::Property *p = dict.tqfind(name); if (p) return *p; Set_nonConstNull.setName(0); //to ensure returned property is null @@ -109,13 +109,13 @@ Set::Iterator::operator *() const return current(); } -QCString +TQCString Set::Iterator::currentKey() const { if (iterator) return iterator->currentKey(); - return QCString(); + return TQCString(); } Property* @@ -129,8 +129,8 @@ Set::Iterator::current() const ////////////////////////////////////////////// -Set::Set(QObject *parent, const QString &typeName) -: QObject(parent, typeName.latin1()) +Set::Set(TQObject *tqparent, const TQString &typeName) +: TQObject(tqparent, typeName.latin1()) { d = new SetPrivate(); d->ownProperty = true; @@ -140,14 +140,14 @@ Set::Set(QObject *parent, const QString &typeName) Set::Set(const Set &set) - : QObject(0 /* implicit sharing the parent is dangerous */, set.name()) + : TQObject(0 /* implicit sharing the tqparent is dangerous */, set.name()) { d = new SetPrivate(); *this = set; } Set::Set(bool propertyOwner) - : QObject(0, 0) + : TQObject(0, 0) { d = new SetPrivate(); d->ownProperty = propertyOwner; @@ -165,7 +165,7 @@ Set::~Set() ///////////////////////////////////////////////////// void -Set::addPropertyInternal(Property *property, QCString group, bool updateSortingKey) +Set::addPropertyInternal(Property *property, TQCString group, bool updateSortingKey) { if (group.isEmpty()) group = "common"; @@ -178,7 +178,7 @@ Set::addPropertyInternal(Property *property, QCString group, bool updateSortingK return; } - Property *p = d->dict.find(property->name()); + Property *p = d->dict.tqfind(property->name()); if(p) { p->addRelatedProperty(property); } @@ -193,7 +193,7 @@ Set::addPropertyInternal(Property *property, QCString group, bool updateSortingK } void -Set::addProperty(Property *property, QCString group) +Set::addProperty(Property *property, TQCString group) { addPropertyInternal(property, group, true); } @@ -213,12 +213,12 @@ Set::removeProperty(Property *property) } void -Set::removeProperty(const QCString &name) +Set::removeProperty(const TQCString &name) { if(name.isNull()) return; - Property *p = d->dict.find(name); + Property *p = d->dict.tqfind(name); removeProperty(p); } @@ -249,17 +249,17 @@ Set::informAboutClearing(bool& cleared) ///////////////////////////////////////////////////// void -Set::addToGroup(const QCString &group, Property *property) +Set::addToGroup(const TQCString &group, Property *property) { if(!property) return; //do not add the same property to the group twice - if(d->groupForProperty.contains(property) && (d->groupForProperty[property] == group)) + if(d->groupForProperty.tqcontains(property) && (d->groupForProperty[property] == group)) return; - if(!d->propertiesOfGroup.contains(group)) { // group doesn't exist - QValueList<QCString> l; + if(!d->propertiesOfGroup.tqcontains(group)) { // group doesn't exist + TQValueList<TQCString> l; l.append(property->name()); d->propertiesOfGroup.insert(group, l); d->groupNames.append(group); @@ -275,12 +275,12 @@ Set::removeFromGroup(Property *property) { if(!property) return; - QCString group = d->groupForProperty[property]; + TQCString group = d->groupForProperty[property]; d->propertiesOfGroup[group].remove(property->name()); if (d->propertiesOfGroup[group].isEmpty()) { //remove group as well d->propertiesOfGroup.remove(group); - QValueListIterator<QCString> it = d->groupNames.find(group); + TQValueListIterator<TQCString> it = d->groupNames.tqfind(group); if (it != d->groupNames.end()) { d->groupNames.remove(it); } @@ -288,40 +288,40 @@ Set::removeFromGroup(Property *property) d->groupForProperty.remove(property); } -const QValueList<QCString>& +const TQValueList<TQCString>& Set::groupNames() const { return d->groupNames; } -const QValueList<QCString>& -Set::propertyNamesForGroup(const QCString &group) const +const TQValueList<TQCString>& +Set::propertyNamesForGroup(const TQCString &group) const { return d->propertiesOfGroup[group]; } void -Set::setGroupDescription(const QCString &group, const QString& desc) +Set::setGroupDescription(const TQCString &group, const TQString& desc) { d->groupDescriptions[group] = desc; } -QString -Set::groupDescription(const QCString &group) const +TQString +Set::groupDescription(const TQCString &group) const { - if(d->groupDescriptions.contains(group)) + if(d->groupDescriptions.tqcontains(group)) return d->groupDescriptions[group]; return group; } void -Set::setGroupIcon(const QCString &group, const QString& icon) +Set::setGroupIcon(const TQCString &group, const TQString& icon) { d->groupIcons[group] = icon; } -QString -Set::groupIcon(const QCString &group) const +TQString +Set::groupIcon(const TQCString &group) const { return d->groupIcons[group]; } @@ -353,19 +353,19 @@ Set::setReadOnly(bool readOnly) } bool -Set::contains(const QCString &name) const +Set::tqcontains(const TQCString &name) const { - return d->dict.find(name); + return d->dict.tqfind(name); } Property& -Set::property(const QCString &name) const +Set::property(const TQCString &name) const { return d->property(name); } Property& -Set::operator[](const QCString &name) const +Set::operator[](const TQCString &name) const { return d->property(name); } @@ -393,7 +393,7 @@ Set::operator= (const Set &set) } void -Set::changeProperty(const QCString &property, const QVariant &value) +Set::changeProperty(const TQCString &property, const TQVariant &value) { Property *p = d->dict[property]; if(p) @@ -416,19 +416,19 @@ Set::debug() it.current()->debug(); } -QCString +TQCString Set::prevSelection() const { return d->prevSelection; } void -Set::setPrevSelection(const QCString &prevSelection) +Set::setPrevSelection(const TQCString &prevSelection) { d->prevSelection = prevSelection; } -QString +TQString Set::typeName() const { return d->typeName; @@ -439,21 +439,21 @@ Set::typeName() const Buffer::Buffer() :Set(false) { - connect( this, SIGNAL( propertyChanged( KoProperty::Set&, KoProperty::Property& ) ), - this, SLOT(intersectedChanged( KoProperty::Set&, KoProperty::Property& ) ) ); + connect( this, TQT_SIGNAL( propertyChanged( KoProperty::Set&, KoProperty::Property& ) ), + this, TQT_SLOT(intersectedChanged( KoProperty::Set&, KoProperty::Property& ) ) ); - connect( this, SIGNAL( propertyReset( KoProperty::Set&, KoProperty::Property& ) ), - this, SLOT(intersectedReset( KoProperty::Set&, KoProperty::Property& ) ) ); + connect( this, TQT_SIGNAL( propertyReset( KoProperty::Set&, KoProperty::Property& ) ), + this, TQT_SLOT(intersectedReset( KoProperty::Set&, KoProperty::Property& ) ) ); } Buffer::Buffer(const Set *set) :Set(false) { - connect( this, SIGNAL( propertyChanged( KoProperty::Set&, KoProperty::Property& ) ), - this, SLOT(intersectedChanged( KoProperty::Set&, KoProperty::Property& ) ) ); + connect( this, TQT_SIGNAL( propertyChanged( KoProperty::Set&, KoProperty::Property& ) ), + this, TQT_SLOT(intersectedChanged( KoProperty::Set&, KoProperty::Property& ) ) ); - connect( this, SIGNAL( propertyReset( KoProperty::Set&, KoProperty::Property& ) ), - this, SLOT(intersectedReset( KoProperty::Set&, KoProperty::Property& ) ) ); + connect( this, TQT_SIGNAL( propertyReset( KoProperty::Set&, KoProperty::Property& ) ), + this, TQT_SLOT(intersectedReset( KoProperty::Set&, KoProperty::Property& ) ) ); initialSet( set ); } @@ -463,8 +463,8 @@ void Buffer::initialSet(const Set *set) //deep copy of set for(Property::DictIterator it(set->d->dict); it.current(); ++it) { Property *prop = new Property( *it.current() ); - QCString group = set->d->groupForProperty[it.current()]; - QString groupDesc = set->d->groupDescriptions[ group ]; + TQCString group = set->d->groupForProperty[it.current()]; + TQString groupDesc = set->d->groupDescriptions[ group ]; setGroupDescription( group, groupDesc ); addProperty( prop, group ); prop->addRelatedProperty( it.current() ); @@ -496,12 +496,12 @@ void Buffer::intersect(const Set *set) void Buffer::intersectedChanged(KoProperty::Set& set, KoProperty::Property& prop) { Q_UNUSED(set); - QCString propertyName = prop.name(); - if ( !contains( propertyName ) ) + TQCString propertyName = prop.name(); + if ( !tqcontains( propertyName ) ) return; - const QValueList<Property*> *props = prop.related(); - QValueList<Property*>::const_iterator it = props->begin(); + const TQValueList<Property*> *props = prop.related(); + TQValueList<Property*>::const_iterator it = props->begin(); for ( ; it != props->end(); ++it ) { ( *it )->setValue( prop.value(), false ); } @@ -510,12 +510,12 @@ void Buffer::intersectedChanged(KoProperty::Set& set, KoProperty::Property& prop void Buffer::intersectedReset(KoProperty::Set& set, KoProperty::Property& prop) { Q_UNUSED(set); - QCString propertyName = prop.name(); - if ( !contains( propertyName ) ) + TQCString propertyName = prop.name(); + if ( !tqcontains( propertyName ) ) return; - const QValueList<Property*> *props = prop.related(); - QValueList<Property*>::const_iterator it = props->begin(); + const TQValueList<Property*> *props = prop.related(); + TQValueList<Property*>::const_iterator it = props->begin(); for ( ; it != props->end(); ++it ) { ( *it )->setValue( prop.value(), false ); } @@ -523,9 +523,9 @@ void Buffer::intersectedReset(KoProperty::Set& set, KoProperty::Property& prop) ////////////////////////////////////////////// -QMap<QCString, QVariant> KoProperty::propertyValues(const Set& set) +TQMap<TQCString, TQVariant> KoProperty::propertyValues(const Set& set) { - QMap<QCString, QVariant> result; + TQMap<TQCString, TQVariant> result; for (Set::Iterator it(set); it.current(); ++it) result.insert( it.currentKey(), it.current()->value() ); |