author | groucho <groucho> | 2003-04-14 08:22:55 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-04-14 08:22:55 (UTC) |
commit | 4624a73cd100f860371fb01facea442737e9336e (patch) (side-by-side diff) | |
tree | ae06cfd24013ca39816a5ca035605988f4033dcd /noncore/unsupported/mailit/addresslist.cpp | |
parent | 6d737040698a9c7ebc6492ba4234b64bf4db6c0b (diff) | |
download | opie-4624a73cd100f860371fb01facea442737e9336e.zip opie-4624a73cd100f860371fb01facea442737e9336e.tar.gz opie-4624a73cd100f860371fb01facea442737e9336e.tar.bz2 |
- Buttonlayout changed in attach dialog
- Removed file access for address list (reduces size)
- Added header size sping box for accounts
- mailit shows an icon in the message list if attachments are present
- Added translations in pro file
- Removed resource.* references in header files, uses qpe/resource.h instead
Diffstat (limited to 'noncore/unsupported/mailit/addresslist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/addresslist.cpp | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/noncore/unsupported/mailit/addresslist.cpp b/noncore/unsupported/mailit/addresslist.cpp index 43e3830..9fe558a 100644 --- a/noncore/unsupported/mailit/addresslist.cpp +++ b/noncore/unsupported/mailit/addresslist.cpp @@ -15,35 +15,33 @@ ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qfile.h> #include <qtextstream.h> #include <opie/ocontactaccess.h> #include <opie/ocontact.h> #include "addresslist.h" -AddressList::AddressList(QString file) +AddressList::AddressList() { addresses.setAutoDelete(TRUE); - filename = file; read(); dirty = FALSE; } AddressList::~AddressList() { - write(); addresses.clear(); } void AddressList::addContact(QString email, QString name) { //skip if not a valid email address, if (email.find( '@') == -1) return; if ( ! containsEmail(email) ) { Contact *in = new Contact; in->email = email; @@ -111,25 +109,24 @@ int AddressList::getNameRef(QString name) return -1; } QList<Contact>* AddressList::getContactList() { return &addresses; } void AddressList::read() { OContactAccess::List::Iterator it; - //QFile f(filename); QString lineEmail, lineName, email, name; OContactAccess m_contactdb("mailit"); OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 ); //OContact* oc; for ( it = m_list.begin(); it != m_list.end(); ++it ) { //oc=(OContact*) it; if ((*it).defaultEmail().length()!=0) addContact((*it).defaultEmail(),(*it).fullName()); } @@ -153,29 +150,12 @@ void AddressList::read() QString AddressList::getRightString(QString in) { QString out = ""; int pos = in.find('='); if (pos != -1) { out = in.mid(pos+1).stripWhiteSpace(); } return out; } -void AddressList::write() -{ - if ( (addresses.count() == 0) || (!dirty) ) - return; - - QFile f(filename); - if (! f.open(IO_WriteOnly) ) - return; - - QTextStream stream(&f); - Contact *ptr; - for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { - stream << "email = " + ptr->email + "\n"; - stream << "name = " + ptr->name + "\n"; - } - f.close(); -} |