diff -r f62f87b200ec -r 8e5041d13c84 contentstorage/caclient/src/caquery.cpp --- a/contentstorage/caclient/src/caquery.cpp Fri Mar 19 09:35:23 2010 +0200 +++ b/contentstorage/caclient/src/caquery.cpp Fri Apr 16 15:16:09 2010 +0300 @@ -232,6 +232,44 @@ } /*! + Returns query attributes. + \retval map of attributes indexed by their names. + */ +QMap CaQuery::attributes() const +{ + return m_d->attributes(); +} + +/*! + Returns an attribute + \param name name of an attribute + \retval value of attribute + */ +QString CaQuery::attribute(const QString &name) const +{ + return m_d->attribute(name); +} + +/*! + Sets attribute. + \param name name of an attribute. + \param value value of an attribute. + */ +void CaQuery::setAttribute(const QString &name, const QString &value) +{ + m_d->setAttribute(name, value); +} + +/*! + Removes attribute. + \param name name of an attribute. + */ +void CaQuery::removeAttribute(const QString &name) +{ + m_d->removeAttribute(name); +} + +/*! Clears query (restores the initial state). */ void CaQuery::clear() @@ -247,7 +285,7 @@ m_q(queryPublic), mEntryRoles(ItemEntryRole | GroupEntryRole), mParentId(0), mEntryTypeNames(), mFlagsOn(), mFlagsOff(), mSortAttribute(DefaultSortAttribute), - mSortOrder(Qt::AscendingOrder), mCount(0) + mSortOrder(Qt::AscendingOrder), mCount(0), mAttributes() { } @@ -269,6 +307,7 @@ mSortAttribute = queryPrivate.mSortAttribute; mSortOrder = queryPrivate.mSortOrder; mCount = queryPrivate.mCount; + mAttributes = queryPrivate.mAttributes; return *this; } @@ -422,6 +461,42 @@ } /*! + \retval map of attributes indexed by their names + */ +QMap CaQueryPrivate::attributes() const +{ + return mAttributes; +} + +/*! + \param name name of an attribute + \retval value of attribute + */ +QString CaQueryPrivate::attribute(const QString &name) const +{ + return mAttributes.value(name); +} + +/*! + Sets attribute. + \param name name of an attribute. + \param value value of an attribute. + */ +void CaQueryPrivate::setAttribute(const QString &name, const QString &value) +{ + mAttributes.insert(name, value); +} + +/*! + Removes an attribute. + \param name name of an attribute. + */ +void CaQueryPrivate::removeAttribute(const QString &name) +{ + mAttributes.remove(name); +} + +/*! Clears query (restores the initial state). */ void CaQueryPrivate::clear()