From 3fb06f85a52b6fcbece50ed30c196efc2a91e8ce Mon Sep 17 00:00:00 2001 From: zecke Date: Sat, 24 May 2003 08:45:50 +0000 Subject: don't crash when compiled with gcc3 one Contact in libqpe one Contact in addresslist.h a nice game of russian roulette gcc3 lost... --- diff --git a/noncore/net/mailit/addresslist.cpp b/noncore/net/mailit/addresslist.cpp index 18d14bc..f2b027c 100644 --- a/noncore/net/mailit/addresslist.cpp +++ b/noncore/net/mailit/addresslist.cpp @@ -43,7 +43,7 @@ void AddressList::addContact(const QString &email, const QString &name) return; if ( ! containsEmail(email) ) { - Contact *in = new Contact; + AContact *in = new AContact; in->email = email; in->name = name; addresses.append(in); @@ -65,28 +65,28 @@ QString AddressList::getNameByEmail(const QString &email) { int pos = getEmailRef(email); if (pos != -1) { - Contact *ptr = addresses.at(pos); + AContact *ptr = addresses.at(pos); return ptr->name; } - return NULL; + return QString::null; } QString AddressList::getEmailByName(const QString &name) { int pos = getNameRef(name); if (pos != -1) { - Contact *ptr = addresses.at(pos); + AContact *ptr = addresses.at(pos); return ptr->email; } - return NULL; + return QString::null; } int AddressList::getEmailRef(const QString &email) { int pos = 0; - Contact *ptr; + AContact *ptr; for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { if (ptr->email == email) @@ -99,7 +99,7 @@ int AddressList::getEmailRef(const QString &email) int AddressList::getNameRef(const QString &name) { int pos = 0; - Contact *ptr; + AContact *ptr; for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { if (ptr->name == name) @@ -109,7 +109,7 @@ int AddressList::getNameRef(const QString &name) return -1; } -QList* AddressList::getContactList() +QList* AddressList::getContactList() { return &addresses; } diff --git a/noncore/net/mailit/addresslist.h b/noncore/net/mailit/addresslist.h index b46d467..763b6d4 100644 --- a/noncore/net/mailit/addresslist.h +++ b/noncore/net/mailit/addresslist.h @@ -23,7 +23,7 @@ #include #include -struct Contact +struct AContact { QString email; QString name; @@ -41,7 +41,7 @@ public: bool containsName(const QString &name); QString getNameByEmail(const QString &email); QString getEmailByName(const QString &name); - QList* getContactList(); + QList* getContactList(); private: int getEmailRef(const QString &email); @@ -50,7 +50,7 @@ private: void read(); private: - QList addresses; + QList addresses; QString filename; bool dirty; }; diff --git a/noncore/net/mailit/writemail.cpp b/noncore/net/mailit/writemail.cpp index c75494e..0298cb3 100644 --- a/noncore/net/mailit/writemail.cpp +++ b/noncore/net/mailit/writemail.cpp @@ -37,12 +37,12 @@ WriteMail::~WriteMail() void WriteMail::setAddressList(AddressList *list) { - Contact *cPtr; + AContact *cPtr; addressList = list; addressView->clear(); - QList *cListPtr = addressList->getContactList(); + QList *cListPtr = addressList->getContactList(); QListViewItem *item; for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) { item = new QListViewItem(addressView, cPtr->name, cPtr->email); diff --git a/noncore/unsupported/mailit/addresslist.cpp b/noncore/unsupported/mailit/addresslist.cpp index 18d14bc..f2b027c 100644 --- a/noncore/unsupported/mailit/addresslist.cpp +++ b/noncore/unsupported/mailit/addresslist.cpp @@ -43,7 +43,7 @@ void AddressList::addContact(const QString &email, const QString &name) return; if ( ! containsEmail(email) ) { - Contact *in = new Contact; + AContact *in = new AContact; in->email = email; in->name = name; addresses.append(in); @@ -65,28 +65,28 @@ QString AddressList::getNameByEmail(const QString &email) { int pos = getEmailRef(email); if (pos != -1) { - Contact *ptr = addresses.at(pos); + AContact *ptr = addresses.at(pos); return ptr->name; } - return NULL; + return QString::null; } QString AddressList::getEmailByName(const QString &name) { int pos = getNameRef(name); if (pos != -1) { - Contact *ptr = addresses.at(pos); + AContact *ptr = addresses.at(pos); return ptr->email; } - return NULL; + return QString::null; } int AddressList::getEmailRef(const QString &email) { int pos = 0; - Contact *ptr; + AContact *ptr; for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { if (ptr->email == email) @@ -99,7 +99,7 @@ int AddressList::getEmailRef(const QString &email) int AddressList::getNameRef(const QString &name) { int pos = 0; - Contact *ptr; + AContact *ptr; for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { if (ptr->name == name) @@ -109,7 +109,7 @@ int AddressList::getNameRef(const QString &name) return -1; } -QList* AddressList::getContactList() +QList* AddressList::getContactList() { return &addresses; } diff --git a/noncore/unsupported/mailit/addresslist.h b/noncore/unsupported/mailit/addresslist.h index b46d467..763b6d4 100644 --- a/noncore/unsupported/mailit/addresslist.h +++ b/noncore/unsupported/mailit/addresslist.h @@ -23,7 +23,7 @@ #include #include -struct Contact +struct AContact { QString email; QString name; @@ -41,7 +41,7 @@ public: bool containsName(const QString &name); QString getNameByEmail(const QString &email); QString getEmailByName(const QString &name); - QList* getContactList(); + QList* getContactList(); private: int getEmailRef(const QString &email); @@ -50,7 +50,7 @@ private: void read(); private: - QList addresses; + QList addresses; QString filename; bool dirty; }; diff --git a/noncore/unsupported/mailit/writemail.cpp b/noncore/unsupported/mailit/writemail.cpp index c75494e..0298cb3 100644 --- a/noncore/unsupported/mailit/writemail.cpp +++ b/noncore/unsupported/mailit/writemail.cpp @@ -37,12 +37,12 @@ WriteMail::~WriteMail() void WriteMail::setAddressList(AddressList *list) { - Contact *cPtr; + AContact *cPtr; addressList = list; addressView->clear(); - QList *cListPtr = addressList->getContactList(); + QList *cListPtr = addressList->getContactList(); QListViewItem *item; for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) { item = new QListViewItem(addressView, cPtr->name, cPtr->email); -- cgit v0.9.0.2