Example #1
0
bool ResourceEvolution::load()
{
    /* doOpen never get's called :( */
    if(!doOpen())
        return false;
    if(!mWrap)
        return false; // open first!

    DBIterator it = mWrap->begin();
    // skip the "PAS-DB-VERSION"

    for(; it != mWrap->end(); ++it)
    {
        if(it.key().startsWith("PAS-DB-VERSION"))
            continue;

        qWarning("val:%s", it.value().latin1());
        VCardTool tool;
        QString str = it.value().stripWhiteSpace();
        Addressee::List list = tool.parseVCards(str);
        if(!list.first().isEmpty())
        {
            Addressee adr = list.first();
            adr.setResource(this);
            addressBook()->insertAddressee(adr);
        }
    }
    return true;
}
Example #2
0
bool VCardFormat::load( Addressee &addressee, QFile *file )
{
  QByteArray data;

  data = file->readAll();

  VCardConverter converter;
  Addressee::List l = converter.parseVCards( data );

  if ( ! l.first().isEmpty() ) {
    addressee = l.first();
    return true;
  }

  return false;
}