diff --git a/abstractattachment.h b/abstractattachment.h index d68fb6e..372ef95 100644 --- a/abstractattachment.h +++ b/abstractattachment.h @@ -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