contentstorage/caclient/src/caquery.cpp
changeset 61 8e5041d13c84
parent 60 f62f87b200ec
child 73 4bc7b118b3df
equal deleted inserted replaced
60:f62f87b200ec 61:8e5041d13c84
   230 {
   230 {
   231     m_d->setCount(count);
   231     m_d->setCount(count);
   232 }
   232 }
   233 
   233 
   234 /*!
   234 /*!
       
   235  Returns query attributes.
       
   236  \retval map of attributes indexed by their names.
       
   237   */
       
   238 QMap<QString, QString> CaQuery::attributes() const
       
   239 {
       
   240     return m_d->attributes();
       
   241 }
       
   242 
       
   243 /*!
       
   244  Returns an attribute
       
   245  \param name name of an attribute
       
   246  \retval value of attribute
       
   247  */
       
   248 QString CaQuery::attribute(const QString &name) const
       
   249 {
       
   250     return m_d->attribute(name);
       
   251 }
       
   252 
       
   253 /*!
       
   254  Sets attribute.
       
   255  \param name name of an attribute.
       
   256  \param value value of an attribute.
       
   257  */
       
   258 void CaQuery::setAttribute(const QString &name, const QString &value)
       
   259 {
       
   260     m_d->setAttribute(name, value);
       
   261 }
       
   262 
       
   263 /*!
       
   264  Removes attribute.
       
   265  \param name name of an attribute.
       
   266  */
       
   267 void CaQuery::removeAttribute(const QString &name)
       
   268 {
       
   269     m_d->removeAttribute(name);
       
   270 }
       
   271 
       
   272 /*!
   235  Clears query (restores the initial state).
   273  Clears query (restores the initial state).
   236  */
   274  */
   237 void CaQuery::clear()
   275 void CaQuery::clear()
   238 {
   276 {
   239     m_d->clear();
   277     m_d->clear();
   245  */
   283  */
   246 CaQueryPrivate::CaQueryPrivate(CaQuery *queryPublic) :
   284 CaQueryPrivate::CaQueryPrivate(CaQuery *queryPublic) :
   247     m_q(queryPublic), mEntryRoles(ItemEntryRole | GroupEntryRole),
   285     m_q(queryPublic), mEntryRoles(ItemEntryRole | GroupEntryRole),
   248     mParentId(0), mEntryTypeNames(), mFlagsOn(), mFlagsOff(),
   286     mParentId(0), mEntryTypeNames(), mFlagsOn(), mFlagsOff(),
   249     mSortAttribute(DefaultSortAttribute),
   287     mSortAttribute(DefaultSortAttribute),
   250     mSortOrder(Qt::AscendingOrder), mCount(0)
   288     mSortOrder(Qt::AscendingOrder), mCount(0), mAttributes()
   251 {
   289 {
   252 }
   290 }
   253 
   291 
   254 /*!
   292 /*!
   255  Copy assignment operator.
   293  Copy assignment operator.
   267     mFlagsOn = queryPrivate.mFlagsOn;
   305     mFlagsOn = queryPrivate.mFlagsOn;
   268     mFlagsOff = queryPrivate.mFlagsOff;
   306     mFlagsOff = queryPrivate.mFlagsOff;
   269     mSortAttribute = queryPrivate.mSortAttribute;
   307     mSortAttribute = queryPrivate.mSortAttribute;
   270     mSortOrder = queryPrivate.mSortOrder;
   308     mSortOrder = queryPrivate.mSortOrder;
   271     mCount = queryPrivate.mCount;
   309     mCount = queryPrivate.mCount;
       
   310     mAttributes = queryPrivate.mAttributes;
   272 
   311 
   273     return *this;
   312     return *this;
   274 }
   313 }
   275 
   314 
   276 /*!
   315 /*!
   417  \param count no of entries.
   456  \param count no of entries.
   418  */
   457  */
   419 void CaQueryPrivate::setCount(unsigned int count)
   458 void CaQueryPrivate::setCount(unsigned int count)
   420 {
   459 {
   421     mCount = count;
   460     mCount = count;
       
   461 }
       
   462 
       
   463 /*!
       
   464  \retval map of attributes indexed by their names
       
   465  */
       
   466 QMap<QString, QString> CaQueryPrivate::attributes() const
       
   467 {
       
   468     return mAttributes;
       
   469 }
       
   470 
       
   471 /*!
       
   472  \param name name of an attribute
       
   473  \retval value of attribute
       
   474  */
       
   475 QString CaQueryPrivate::attribute(const QString &name) const
       
   476 {
       
   477     return mAttributes.value(name);
       
   478 }
       
   479 
       
   480 /*!
       
   481  Sets attribute.
       
   482  \param name name of an attribute.
       
   483  \param value value of an attribute.
       
   484  */
       
   485 void CaQueryPrivate::setAttribute(const QString &name, const QString &value)
       
   486 {
       
   487     mAttributes.insert(name, value);
       
   488 }
       
   489 
       
   490 /*!
       
   491  Removes an attribute.
       
   492  \param name name of an attribute.
       
   493  */
       
   494 void CaQueryPrivate::removeAttribute(const QString &name)
       
   495 {
       
   496     mAttributes.remove(name);
   422 }
   497 }
   423 
   498 
   424 /*!
   499 /*!
   425  Clears query (restores the initial state).
   500  Clears query (restores the initial state).
   426  */
   501  */