summaryrefslogtreecommitdiff
authorzecke <zecke>2003-05-24 08:45:50 (UTC)
committer zecke <zecke>2003-05-24 08:45:50 (UTC)
commit3fb06f85a52b6fcbece50ed30c196efc2a91e8ce (patch) (side-by-side diff)
tree618d3b21756a07fad10e1e1359bd12a0e7e15089
parent694ff39fe4f0f4164edd7a2a80abe6be3a4fa2f9 (diff)
downloadopie-3fb06f85a52b6fcbece50ed30c196efc2a91e8ce.zip
opie-3fb06f85a52b6fcbece50ed30c196efc2a91e8ce.tar.gz
opie-3fb06f85a52b6fcbece50ed30c196efc2a91e8ce.tar.bz2
don't crash when compiled with gcc3
one Contact in libqpe one Contact in addresslist.h a nice game of russian roulette gcc3 lost...
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/addresslist.cpp16
-rw-r--r--noncore/net/mailit/addresslist.h6
-rw-r--r--noncore/net/mailit/writemail.cpp4
-rw-r--r--noncore/unsupported/mailit/addresslist.cpp16
-rw-r--r--noncore/unsupported/mailit/addresslist.h6
-rw-r--r--noncore/unsupported/mailit/writemail.cpp4
6 files changed, 26 insertions, 26 deletions
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
@@ -30,99 +30,99 @@ AddressList::AddressList()
read();
dirty = FALSE;
}
AddressList::~AddressList()
{
addresses.clear();
}
void AddressList::addContact(const QString &email, const QString &name)
{
//skip if not a valid email address,
if (email.find( '@') == -1)
return;
if ( ! containsEmail(email) ) {
- Contact *in = new Contact;
+ AContact *in = new AContact;
in->email = email;
in->name = name;
addresses.append(in);
dirty = TRUE;
}
}
bool AddressList::containsEmail(const QString &email)
{
return ( getEmailRef(email) != -1 );
}
bool AddressList::containsName(const QString &name)
{
return ( getNameRef(name) != -1 );
}
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)
return pos;
pos++;
}
return -1;
}
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)
return pos;
pos++;
}
return -1;
}
-QList<Contact>* AddressList::getContactList()
+QList<AContact>* AddressList::getContactList()
{
return &addresses;
}
void AddressList::read()
{
OContactAccess::List::Iterator it;
QString lineEmail, lineName, email, name;
OContactAccess m_contactdb("mailit");
OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 );
//OContact* oc;(*it).defaultEmail()
for ( it = m_list.begin(); it != m_list.end(); ++it )
{
//oc=(OContact*) it;
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
@@ -10,49 +10,49 @@
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef ADDRESSLIST_H
#define ADDRESSLIST_H
#include <qobject.h>
#include <qlist.h>
-struct Contact
+struct AContact
{
QString email;
QString name;
};
class AddressList : public QObject
{
Q_OBJECT
public:
AddressList();
~AddressList();
void addContact(const QString &email, const QString &name);
bool containsEmail(const QString &email);
bool containsName(const QString &name);
QString getNameByEmail(const QString &email);
QString getEmailByName(const QString &name);
- QList<Contact>* getContactList();
+ QList<AContact>* getContactList();
private:
int getEmailRef(const QString &email);
int getNameRef(const QString &name);
QString getRightString(const QString &in);
void read();
private:
- QList<Contact> addresses;
+ QList<AContact> addresses;
QString filename;
bool dirty;
};
#endif
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
@@ -24,38 +24,38 @@
WriteMail::WriteMail( QWidget* parent, const char* name, WFlags fl ):QMainWindow( parent, name, fl )
{
showingAddressList = FALSE;
init();
addAtt = new AddAtt(0, "Add Attachments");
}
WriteMail::~WriteMail()
{
delete addAtt;
}
void WriteMail::setAddressList(AddressList *list)
{
- Contact *cPtr;
+ AContact *cPtr;
addressList = list;
addressView->clear();
- QList<Contact> *cListPtr = addressList->getContactList();
+ QList<AContact> *cListPtr = addressList->getContactList();
QListViewItem *item;
for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) {
item = new QListViewItem(addressView, cPtr->name, cPtr->email);
}
}
void WriteMail::init()
{
setToolBarsMovable(FALSE);
bar = new QToolBar(this);
bar->setHorizontalStretchable( TRUE );
menu = new QMenuBar( bar );
mailMenu = new QPopupMenu(menu);
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
@@ -30,99 +30,99 @@ AddressList::AddressList()
read();
dirty = FALSE;
}
AddressList::~AddressList()
{
addresses.clear();
}
void AddressList::addContact(const QString &email, const QString &name)
{
//skip if not a valid email address,
if (email.find( '@') == -1)
return;
if ( ! containsEmail(email) ) {
- Contact *in = new Contact;
+ AContact *in = new AContact;
in->email = email;
in->name = name;
addresses.append(in);
dirty = TRUE;
}
}
bool AddressList::containsEmail(const QString &email)
{
return ( getEmailRef(email) != -1 );
}
bool AddressList::containsName(const QString &name)
{
return ( getNameRef(name) != -1 );
}
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)
return pos;
pos++;
}
return -1;
}
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)
return pos;
pos++;
}
return -1;
}
-QList<Contact>* AddressList::getContactList()
+QList<AContact>* AddressList::getContactList()
{
return &addresses;
}
void AddressList::read()
{
OContactAccess::List::Iterator it;
QString lineEmail, lineName, email, name;
OContactAccess m_contactdb("mailit");
OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 );
//OContact* oc;(*it).defaultEmail()
for ( it = m_list.begin(); it != m_list.end(); ++it )
{
//oc=(OContact*) it;
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
@@ -10,49 +10,49 @@
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef ADDRESSLIST_H
#define ADDRESSLIST_H
#include <qobject.h>
#include <qlist.h>
-struct Contact
+struct AContact
{
QString email;
QString name;
};
class AddressList : public QObject
{
Q_OBJECT
public:
AddressList();
~AddressList();
void addContact(const QString &email, const QString &name);
bool containsEmail(const QString &email);
bool containsName(const QString &name);
QString getNameByEmail(const QString &email);
QString getEmailByName(const QString &name);
- QList<Contact>* getContactList();
+ QList<AContact>* getContactList();
private:
int getEmailRef(const QString &email);
int getNameRef(const QString &name);
QString getRightString(const QString &in);
void read();
private:
- QList<Contact> addresses;
+ QList<AContact> addresses;
QString filename;
bool dirty;
};
#endif
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
@@ -24,38 +24,38 @@
WriteMail::WriteMail( QWidget* parent, const char* name, WFlags fl ):QMainWindow( parent, name, fl )
{
showingAddressList = FALSE;
init();
addAtt = new AddAtt(0, "Add Attachments");
}
WriteMail::~WriteMail()
{
delete addAtt;
}
void WriteMail::setAddressList(AddressList *list)
{
- Contact *cPtr;
+ AContact *cPtr;
addressList = list;
addressView->clear();
- QList<Contact> *cListPtr = addressList->getContactList();
+ QList<AContact> *cListPtr = addressList->getContactList();
QListViewItem *item;
for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) {
item = new QListViewItem(addressView, cPtr->name, cPtr->email);
}
}
void WriteMail::init()
{
setToolBarsMovable(FALSE);
bar = new QToolBar(this);
bar->setHorizontalStretchable( TRUE );
menu = new QMenuBar( bar );
mailMenu = new QPopupMenu(menu);