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 | |||
@@ -15,24 +15,25 @@ AddressPicker::AddressPicker(QWidget *parent, const char *name, bool modal, | |||
15 | { | 15 | { |
16 | okButton->setIconSet(Resource::loadPixmap("enter")); | 16 | okButton->setIconSet(Resource::loadPixmap("enter")); |
17 | cancelButton->setIconSet(Resource::loadPixmap("editdelete")); | 17 | cancelButton->setIconSet(Resource::loadPixmap("editdelete")); |
18 | 18 | ||
19 | connect(okButton, SIGNAL(clicked()), SLOT(accept())); | 19 | connect(okButton, SIGNAL(clicked()), SLOT(accept())); |
20 | connect(cancelButton, SIGNAL(clicked()), SLOT(close())); | 20 | connect(cancelButton, SIGNAL(clicked()), SLOT(close())); |
21 | 21 | ||
22 | QFile f((QString) getenv("HOME") + "/Applications/" | 22 | QFile f((QString) getenv("HOME") + "/Applications/" |
23 | + "addressbook/addressbook.xml"); | 23 | + "addressbook/addressbook.xml"); |
24 | 24 | ||
25 | if (f.open(IO_ReadOnly)) { | 25 | if (f.open(IO_ReadOnly)) { |
26 | QTextStream stream(&f); | 26 | QTextStream stream(&f); |
27 | stream.setEncoding( QTextStream::UnicodeUTF8 ); | ||
27 | QString content; | 28 | QString content; |
28 | while (!f.atEnd()) content += stream.readLine() + "\n"; | 29 | while (!f.atEnd()) content += stream.readLine() + "\n"; |
29 | QStringList lines = QStringList::split(QRegExp("\\n"), content); | 30 | QStringList lines = QStringList::split(QRegExp("\\n"), content); |
30 | QStringList::Iterator it; | 31 | QStringList::Iterator it; |
31 | for (it = lines.begin(); it != lines.end(); it++) { | 32 | for (it = lines.begin(); it != lines.end(); it++) { |
32 | if ((*it).find(QRegExp("^<Contact.*")) != -1) { | 33 | if ((*it).find(QRegExp("^<Contact.*")) != -1) { |
33 | int pos = (*it).find("FirstName=\""); | 34 | int pos = (*it).find("FirstName=\""); |
34 | QString fname; | 35 | QString fname; |
35 | if (pos != -1) { | 36 | if (pos != -1) { |
36 | int i = 1; | 37 | int i = 1; |
37 | QChar c; | 38 | QChar c; |
38 | while (c != '"') { | 39 | while (c != '"') { |