diff -r e4ebb16b39ea -r 603d3f8b6302 src/versit/versitutils.cpp --- a/src/versit/versitutils.cpp Fri Sep 17 08:34:34 2010 +0300 +++ b/src/versit/versitutils.cpp Mon Oct 04 01:37:06 2010 +0300 @@ -40,6 +40,8 @@ ****************************************************************************/ #include "versitutils_p.h" +#include "qversitdocument.h" +#include "qversitproperty.h" #include "qmobilityglobal.h" #include @@ -106,3 +108,19 @@ m_previousCodec = codec; } + +/*! + * Finds a property in the \a document with the given \a propertyName, adds it to \a toBeRemoved, + * and returns it. + */ +QVersitProperty VersitUtils::takeProperty(const QVersitDocument& document, + const QString& propertyName, + QList* toBeRemoved) { + foreach (const QVersitProperty& currentProperty, document.properties()) { + if (currentProperty.name() == propertyName) { + *toBeRemoved << currentProperty; + return currentProperty; + } + } + return QVersitProperty(); +}