emailservices/nmailbase/src/nmmessagepart.cpp
changeset 20 ecc8def7944a
parent 18 578830873419
child 23 2dc6caa42ec3
equal deleted inserted replaced
18:578830873419 20:ecc8def7944a
   460     // finally look if there is Content-Description.
   460     // finally look if there is Content-Description.
   461     return d->mContentDescription;
   461     return d->mContentDescription;
   462 }
   462 }
   463 
   463 
   464 /*!
   464 /*!
       
   465     Recursive child part finder for NmMessage class (non-modifying).
       
   466  */
       
   467 const NmMessagePart *NmMessagePart::findContentPart(const QString &contentType) const
       
   468 {
       
   469     const NmMessagePart *ret = NULL;
       
   470 
       
   471     if (!d->mContentType.isEmpty() && d->mContentType.startsWith(contentType)) {
       
   472         ret = this;
       
   473     } else {
       
   474         for (int i = 0; !ret && i < d->mChildParts.count(); i++) {
       
   475             ret = d->mChildParts[i]->findContentPart(contentType);
       
   476         }
       
   477     }
       
   478     return ret;
       
   479 }
       
   480 
       
   481 /*!
   465     Recursive child part finder for NmMessage class
   482     Recursive child part finder for NmMessage class
   466  */
   483  */
   467 NmMessagePart *NmMessagePart::findContentPart(const QString &contentType)
   484 NmMessagePart *NmMessagePart::findContentPart(const QString &contentType)
   468 {
   485 {
   469     NmMessagePart *ret = NULL;
   486     NmMessagePart *ret = NULL;