bool SugarOpportunityIO::readSugarOpportunity(QIODevice *device, SugarOpportunity &opportunity) { if (device == 0 || !device->isReadable()) { return false; } opportunity = SugarOpportunity(); xml.setDevice(device); if (xml.readNextStartElement()) { if (xml.name() == "sugarOpportunity" && xml.attributes().value("version") == "1.0") { readOpportunity(opportunity); } else { xml.raiseError(QObject::tr("It is not a sugarOpportunity version 1.0 data.")); } } return !xml.error(); }
void SugarOpportunity::clear() { *this = SugarOpportunity(); }