Diffstat (limited to 'noncore/unsupported/mail2/addresspicker.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/addresspicker.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/addresspicker.cpp b/noncore/unsupported/mail2/addresspicker.cpp index 7f32725..a97b33f 100644 --- a/noncore/unsupported/mail2/addresspicker.cpp +++ b/noncore/unsupported/mail2/addresspicker.cpp @@ -3,48 +3,49 @@ #include <qtextstream.h> #include <qlistbox.h> #include <qfile.h> #include <qpe/resource.h> #include <stdlib.h> #include "addresspicker.h" AddressPicker::AddressPicker(QWidget *parent, const char *name, bool modal, WFlags fl) : AddressPickerBase(parent, name, modal, fl) { okButton->setIconSet(Resource::loadPixmap("enter")); cancelButton->setIconSet(Resource::loadPixmap("editdelete")); connect(okButton, SIGNAL(clicked()), SLOT(accept())); connect(cancelButton, SIGNAL(clicked()), SLOT(close())); QFile f((QString) getenv("HOME") + "/Applications/" + "addressbook/addressbook.xml"); if (f.open(IO_ReadOnly)) { QTextStream stream(&f); + stream.setEncoding( QTextStream::UnicodeUTF8 ); QString content; while (!f.atEnd()) content += stream.readLine() + "\n"; QStringList lines = QStringList::split(QRegExp("\\n"), content); QStringList::Iterator it; for (it = lines.begin(); it != lines.end(); it++) { if ((*it).find(QRegExp("^<Contact.*")) != -1) { int pos = (*it).find("FirstName=\""); QString fname; if (pos != -1) { int i = 1; QChar c; while (c != '"') { c = (*it)[pos + 10 + i]; if (c != '"') fname += c; i++; } } pos = (*it).find("LastName=\""); QString lname; if (pos != -1) { int i = 1; QChar c; while (c != '"') { c = (*it)[pos + 9 + i]; |