bool htmlTextPart::embeddedObject::matchesId(const string& id) const { if (m_refType == REFERENCED_BY_ID) return m_id == cleanId(id); else return m_id == id; }
Note::Note(const QString& id, QObject* parent) : com::noughmad::toutatis::Note(Service, "/Note/" + cleanId(id), QDBusConnection::sessionBus(), parent) , d_ptr(new NotePrivate) { Q_D(Note); d->task = getOrCreateModel<Task>(parent, taskId(), this); Q_ASSERT(d->task->isValid()); }
bool htmlTextPart::hasObject(const string& id_) const { const string id = cleanId(id_); for (std::vector <ref <embeddedObject> >::const_iterator o = m_objects.begin() ; o != m_objects.end() ; ++o) { if ((*o)->getId() == id) return true; } return false; }
const ref <const htmlTextPart::embeddedObject> htmlTextPart::findObject(const string& id_) const { const string id = cleanId(id_); for (std::vector <ref <embeddedObject> >::const_iterator o = m_objects.begin() ; o != m_objects.end() ; ++o) { if ((*o)->getId() == id) return *o; } throw exceptions::no_object_found(); }