Esempio n. 1
0
  AddrSpecList VacationDialog::mailAliases() const {
    QCString text = mMailAliasesEdit->text().latin1(); // ### IMAA: !ok
    AddressList al;
    const char * s = text.begin();
    parseAddressList( s, text.end(), al );

    AddrSpecList asl;
    for ( AddressList::const_iterator it = al.begin() ; it != al.end() ; ++it ) {
      const MailboxList & mbl = (*it).mailboxList;
      for ( MailboxList::const_iterator jt = mbl.begin() ; jt != mbl.end() ; ++jt )
	asl.push_back( (*jt).addrSpec );
    }
    return asl;
  }
Esempio n. 2
0
QCString KMail::Util::lf2crlf(const QCString &src)
{
    QCString result(1 + 2 * src.size());   // maximal possible length

    QCString::ConstIterator s = src.begin();
    QCString::Iterator d = result.begin();
    // we use cPrev to make sure we insert '\r' only there where it is missing
    char cPrev = '?';
    while(*s)
    {
        if(('\n' == *s) && ('\r' != cPrev))
            *d++ = '\r';
        cPrev = *s;
        *d++ = *s++;
    }
    result.truncate(d - result.begin());   // adds trailing NUL
    return result;
}