added isEmpty()

This commit is contained in:
Martchus 2015-10-06 22:29:29 +02:00
parent 7ae0aee4f7
commit 5510c849f7
1 changed files with 10 additions and 0 deletions

View File

@ -100,6 +100,7 @@ public:
void clear();
bool isIgnored() const;
void setIgnored(bool ignored);
bool isEmpty() const;
protected:
AbstractAttachment();
@ -234,6 +235,15 @@ inline void AbstractAttachment::setIgnored(bool ignored)
m_ignored = ignored;
}
/*!
* \brief Returns whether the attachment is empty (no data and no meta-data assigned).
* \remarks Does not take into account whether an ID is set.
*/
inline bool AbstractAttachment::isEmpty() const
{
return m_description.empty() && m_name.empty() && !m_mimeType.empty() && !m_data;
}
} // namespace Media
#endif // MEDIA_ABSTRACTATTACHMENT_H