diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
commit | 2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch) | |
tree | 18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/collection.h | |
parent | 1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff) | |
download | tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip |
TQt4 port tellico
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/collection.h')
-rw-r--r-- | src/collection.h | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/src/collection.h b/src/collection.h index b7dae1f..db7acca 100644 --- a/src/collection.h +++ b/src/collection.h @@ -22,17 +22,17 @@ #include <ksharedptr.h> -#include <qstringlist.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qdict.h> -#include <qintdict.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqdict.h> +#include <tqintdict.h> +#include <tqobject.h> namespace Tellico { namespace Data { class EntryGroup; - typedef QDict<EntryGroup> EntryGroupDict; + typedef TQDict<EntryGroup> EntryGroupDict; /** * The Collection class is the primary data object, holding a @@ -47,8 +47,9 @@ namespace Tellico { * * @author Robby Stephenson */ -class Collection : public QObject, public KShared { +class Collection : public TQObject, public KShared { Q_OBJECT + TQ_OBJECT public: enum Type { @@ -75,7 +76,7 @@ public: * @param title The title of the collection itself * @param entryTitle The title of the entries, which can be translated */ - explicit Collection(const QString& title); + explicit Collection(const TQString& title); /** */ virtual ~Collection(); @@ -97,20 +98,20 @@ public: * * @return The name */ - const QString& title() const { return m_title; } + const TQString& title() const { return m_title; } /** * Sets the title of the collection. * * @param title The new collection title */ - void setTitle(const QString& title) { m_title = title; } + void setTitle(const TQString& title) { m_title = title; } /** * Returns the name of the entries in the collection, e.g. "book". * Not translated. * * @return The type name */ - QString typeName() const; + TQString typeName() const; /** * Returns a reference to the list of all the entries in the collection. * @@ -142,19 +143,19 @@ public: * * @return The list of group names */ - const QStringList& fieldCategories() const { return m_fieldCategories; } + const TQStringList& fieldCategories() const { return m_fieldCategories; } /** * Returns the name of the field used to group the entries by default. * * @return The field name */ - const QString& defaultGroupField() const { return m_defaultGroupField; } + const TQString& defaultGroupField() const { return m_defaultGroupField; } /** * Sets the name of the default field used to group the entries. * * @param name The name of the field */ - void setDefaultGroupField(const QString& name) { m_defaultGroupField = name; } + void setDefaultGroupField(const TQString& name) { m_defaultGroupField = name; } /** * Returns the number of entries in the collection. * @@ -199,7 +200,7 @@ public: virtual bool mergeField(FieldPtr field); virtual bool modifyField(FieldPtr field); virtual bool removeField(FieldPtr field, bool force=false); - virtual bool removeField(const QString& name, bool force=false); + virtual bool removeField(const TQString& name, bool force=false); void reorderFields(const FieldVec& list); // the reason this is not static is so I can call it from a collection pointer @@ -215,33 +216,33 @@ public: * @param value The desired value * @return A boolean indicating if the value is an allowed value for that field */ - bool isAllowed(const QString& key, const QString& value) const; + bool isAllowed(const TQString& key, const TQString& value) const; /** * Returns a list of all the field names. * * @return The list of names */ - const QStringList& fieldNames() const { return m_fieldNames; } + const TQStringList& fieldNames() const { return m_fieldNames; } /** * Returns a list of all the field titles. * * @return The list of titles */ - const QStringList& fieldTitles() const { return m_fieldTitles; } + const TQStringList& fieldTitles() const { return m_fieldTitles; } /** * Returns the title of an field, given its name. * * @param name The field name * @return The field title */ - const QString& fieldTitleByName(const QString& name) const; + const TQString& fieldTitleByName(const TQString& name) const; /** * Returns the name of an field, given its title. * * @param title The field title * @return The field name */ - const QString& fieldNameByTitle(const QString& title) const; + const TQString& fieldNameByTitle(const TQString& title) const; /** * Returns a list of the values of a given field for every entry * in the collection. The values in the list are not repeated. Attribute @@ -251,14 +252,14 @@ public: * @param name The name of the field * @return The list of values */ - QStringList valuesByFieldName(const QString& name) const; + TQStringList valuesByFieldName(const TQString& name) const; /** * Returns a list of all the fields in a given category. * * @param category The name of the category * @return The field list */ - FieldVec fieldsByCategory(const QString& category); + FieldVec fieldsByCategory(const TQString& category); /** * Returns a pointer to an field given its name. If none is found, a NULL pointer * is returned. @@ -266,7 +267,7 @@ public: * @param name The field name * @return The field pointer */ - FieldPtr fieldByName(const QString& name) const; + FieldPtr fieldByName(const TQString& name) const; /** * Returns a pointer to an field given its title. If none is found, a NULL pointer * is returned. This lookup is slower than by name. @@ -274,18 +275,18 @@ public: * @param title The field title * @return The field pointer */ - FieldPtr fieldByTitle(const QString& title) const; + FieldPtr fieldByTitle(const TQString& title) const; /** * Returns @p true if the collection contains a field named @ref name; */ - bool hasField(const QString& name) const; + bool hasField(const TQString& name) const; /** * Returns a list of all the possible entry groups. This value is cached rather * than generated with each call, so the method should be fairly fast. * * @return The list of groups */ - const QStringList& entryGroups() const { return m_entryGroups; } + const TQStringList& entryGroups() const { return m_entryGroups; } /** * Returns a pointer to a dict of all the entries grouped by * a certain field @@ -293,11 +294,11 @@ public: * @param name The name of the field by which the entries are grouped * @return The list of group names */ - EntryGroupDict* entryGroupDictByName(const QString& name); + EntryGroupDict* entryGroupDictByName(const TQString& name); /** * Invalidates all group names in the collection. */ - void invalidateGroups(); + void tqinvalidateGroups(); /** * Returns true if the collection contains at least one Image field. * @@ -326,7 +327,7 @@ public: /** * The string used for the people pseudo-group. This forces consistency. */ - static const QString s_peopleGroupName; + static const TQString s_peopleGroupName; // these are the values that should be compared against // the result from sameEntry() @@ -338,9 +339,9 @@ signals: void signalRefreshField(Tellico::Data::FieldPtr field); private: - QStringList entryGroupNamesByField(EntryPtr entry, const QString& fieldName); + TQStringList entryGroupNamesByField(EntryPtr entry, const TQString& fieldName); void removeEntriesFromDicts(EntryVec entries); - void populateDict(EntryGroupDict* dict, const QString& fieldName, EntryVec entries); + void populateDict(EntryGroupDict* dict, const TQString& fieldName, EntryVec entries); void populateCurrentDicts(EntryVec entries); void cleanGroups(); bool dependentFieldHasRecursion(FieldPtr field); @@ -362,25 +363,25 @@ private: long m_id; long m_nextEntryId; - QString m_title; - QString m_typeName; - QString m_iconName; - QString m_defaultGroupField; + TQString m_title; + TQString m_typeName; + TQString m_iconName; + TQString m_defaultGroupField; FieldVec m_fields; FieldVec m_peopleFields; // keep separate list of people fields FieldVec m_imageFields; // keep track of image fields - QDict<Field> m_fieldNameDict; - QDict<Field> m_fieldTitleDict; - QStringList m_fieldCategories; - QStringList m_fieldNames; - QStringList m_fieldTitles; + TQDict<Field> m_fieldNameDict; + TQDict<Field> m_fieldTitleDict; + TQStringList m_fieldCategories; + TQStringList m_fieldNames; + TQStringList m_fieldTitles; EntryVec m_entries; - QIntDict<Entry> m_entryIdDict; + TQIntDict<Entry> m_entryIdDict; - QDict<EntryGroupDict> m_entryGroupDicts; - QStringList m_entryGroups; + TQDict<EntryGroupDict> m_entryGroupDicts; + TQStringList m_entryGroups; PtrVector<EntryGroup> m_groupsToDelete; FilterVec m_filters; |