-rw-r--r-- | noncore/net/mailit/addresslist.cpp | 16 | ||||
-rw-r--r-- | noncore/net/mailit/addresslist.h | 6 | ||||
-rw-r--r-- | noncore/net/mailit/writemail.cpp | 4 | ||||
-rw-r--r-- | noncore/unsupported/mailit/addresslist.cpp | 16 | ||||
-rw-r--r-- | noncore/unsupported/mailit/addresslist.h | 6 | ||||
-rw-r--r-- | noncore/unsupported/mailit/writemail.cpp | 4 |
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 | |||
@@ -38,17 +38,17 @@ AddressList::~AddressList() | |||
38 | 38 | ||
39 | void AddressList::addContact(const QString &email, const QString &name) | 39 | void AddressList::addContact(const QString &email, const QString &name) |
40 | { | 40 | { |
41 | //skip if not a valid email address, | 41 | //skip if not a valid email address, |
42 | if (email.find( '@') == -1) | 42 | if (email.find( '@') == -1) |
43 | return; | 43 | return; |
44 | 44 | ||
45 | if ( ! containsEmail(email) ) { | 45 | if ( ! containsEmail(email) ) { |
46 | Contact *in = new Contact; | 46 | AContact *in = new AContact; |
47 | in->email = email; | 47 | in->email = email; |
48 | in->name = name; | 48 | in->name = name; |
49 | addresses.append(in); | 49 | addresses.append(in); |
50 | dirty = TRUE; | 50 | dirty = TRUE; |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | bool AddressList::containsEmail(const QString &email) | 54 | bool AddressList::containsEmail(const QString &email) |
@@ -60,61 +60,61 @@ bool AddressList::containsName(const QString &name) | |||
60 | { | 60 | { |
61 | return ( getNameRef(name) != -1 ); | 61 | return ( getNameRef(name) != -1 ); |
62 | } | 62 | } |
63 | 63 | ||
64 | QString AddressList::getNameByEmail(const QString &email) | 64 | QString AddressList::getNameByEmail(const QString &email) |
65 | { | 65 | { |
66 | int pos = getEmailRef(email); | 66 | int pos = getEmailRef(email); |
67 | if (pos != -1) { | 67 | if (pos != -1) { |
68 | Contact *ptr = addresses.at(pos); | 68 | AContact *ptr = addresses.at(pos); |
69 | return ptr->name; | 69 | return ptr->name; |
70 | } | 70 | } |
71 | 71 | ||
72 | return NULL; | 72 | return QString::null; |
73 | } | 73 | } |
74 | 74 | ||
75 | QString AddressList::getEmailByName(const QString &name) | 75 | QString AddressList::getEmailByName(const QString &name) |
76 | { | 76 | { |
77 | int pos = getNameRef(name); | 77 | int pos = getNameRef(name); |
78 | if (pos != -1) { | 78 | if (pos != -1) { |
79 | Contact *ptr = addresses.at(pos); | 79 | AContact *ptr = addresses.at(pos); |
80 | return ptr->email; | 80 | return ptr->email; |
81 | } | 81 | } |
82 | 82 | ||
83 | return NULL; | 83 | return QString::null; |
84 | } | 84 | } |
85 | 85 | ||
86 | int AddressList::getEmailRef(const QString &email) | 86 | int AddressList::getEmailRef(const QString &email) |
87 | { | 87 | { |
88 | int pos = 0; | 88 | int pos = 0; |
89 | Contact *ptr; | 89 | AContact *ptr; |
90 | 90 | ||
91 | for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { | 91 | for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { |
92 | if (ptr->email == email) | 92 | if (ptr->email == email) |
93 | return pos; | 93 | return pos; |
94 | pos++; | 94 | pos++; |
95 | } | 95 | } |
96 | return -1; | 96 | return -1; |
97 | } | 97 | } |
98 | 98 | ||
99 | int AddressList::getNameRef(const QString &name) | 99 | int AddressList::getNameRef(const QString &name) |
100 | { | 100 | { |
101 | int pos = 0; | 101 | int pos = 0; |
102 | Contact *ptr; | 102 | AContact *ptr; |
103 | 103 | ||
104 | for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { | 104 | for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { |
105 | if (ptr->name == name) | 105 | if (ptr->name == name) |
106 | return pos; | 106 | return pos; |
107 | pos++; | 107 | pos++; |
108 | } | 108 | } |
109 | return -1; | 109 | return -1; |
110 | } | 110 | } |
111 | 111 | ||
112 | QList<Contact>* AddressList::getContactList() | 112 | QList<AContact>* AddressList::getContactList() |
113 | { | 113 | { |
114 | return &addresses; | 114 | return &addresses; |
115 | } | 115 | } |
116 | 116 | ||
117 | void AddressList::read() | 117 | void AddressList::read() |
118 | { | 118 | { |
119 | OContactAccess::List::Iterator it; | 119 | OContactAccess::List::Iterator it; |
120 | 120 | ||
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 | |||
@@ -18,17 +18,17 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef ADDRESSLIST_H | 20 | #ifndef ADDRESSLIST_H |
21 | #define ADDRESSLIST_H | 21 | #define ADDRESSLIST_H |
22 | 22 | ||
23 | #include <qobject.h> | 23 | #include <qobject.h> |
24 | #include <qlist.h> | 24 | #include <qlist.h> |
25 | 25 | ||
26 | struct Contact | 26 | struct AContact |
27 | { | 27 | { |
28 | QString email; | 28 | QString email; |
29 | QString name; | 29 | QString name; |
30 | }; | 30 | }; |
31 | 31 | ||
32 | class AddressList : public QObject | 32 | class AddressList : public QObject |
33 | { | 33 | { |
34 | Q_OBJECT | 34 | Q_OBJECT |
@@ -36,23 +36,23 @@ class AddressList : public QObject | |||
36 | public: | 36 | public: |
37 | AddressList(); | 37 | AddressList(); |
38 | ~AddressList(); | 38 | ~AddressList(); |
39 | void addContact(const QString &email, const QString &name); | 39 | void addContact(const QString &email, const QString &name); |
40 | bool containsEmail(const QString &email); | 40 | bool containsEmail(const QString &email); |
41 | bool containsName(const QString &name); | 41 | bool containsName(const QString &name); |
42 | QString getNameByEmail(const QString &email); | 42 | QString getNameByEmail(const QString &email); |
43 | QString getEmailByName(const QString &name); | 43 | QString getEmailByName(const QString &name); |
44 | QList<Contact>* getContactList(); | 44 | QList<AContact>* getContactList(); |
45 | 45 | ||
46 | private: | 46 | private: |
47 | int getEmailRef(const QString &email); | 47 | int getEmailRef(const QString &email); |
48 | int getNameRef(const QString &name); | 48 | int getNameRef(const QString &name); |
49 | QString getRightString(const QString &in); | 49 | QString getRightString(const QString &in); |
50 | void read(); | 50 | void read(); |
51 | 51 | ||
52 | private: | 52 | private: |
53 | QList<Contact> addresses; | 53 | QList<AContact> addresses; |
54 | QString filename; | 54 | QString filename; |
55 | bool dirty; | 55 | bool dirty; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | #endif | 58 | #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 | |||
@@ -32,22 +32,22 @@ WriteMail::WriteMail( QWidget* parent, const char* name, WFlags fl ):QMainWindo | |||
32 | 32 | ||
33 | WriteMail::~WriteMail() | 33 | WriteMail::~WriteMail() |
34 | { | 34 | { |
35 | delete addAtt; | 35 | delete addAtt; |
36 | } | 36 | } |
37 | 37 | ||
38 | void WriteMail::setAddressList(AddressList *list) | 38 | void WriteMail::setAddressList(AddressList *list) |
39 | { | 39 | { |
40 | Contact *cPtr; | 40 | AContact *cPtr; |
41 | 41 | ||
42 | addressList = list; | 42 | addressList = list; |
43 | 43 | ||
44 | addressView->clear(); | 44 | addressView->clear(); |
45 | QList<Contact> *cListPtr = addressList->getContactList(); | 45 | QList<AContact> *cListPtr = addressList->getContactList(); |
46 | QListViewItem *item; | 46 | QListViewItem *item; |
47 | for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) { | 47 | for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) { |
48 | item = new QListViewItem(addressView, cPtr->name, cPtr->email); | 48 | item = new QListViewItem(addressView, cPtr->name, cPtr->email); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | void WriteMail::init() | 52 | void WriteMail::init() |
53 | { | 53 | { |
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 | |||
@@ -38,17 +38,17 @@ AddressList::~AddressList() | |||
38 | 38 | ||
39 | void AddressList::addContact(const QString &email, const QString &name) | 39 | void AddressList::addContact(const QString &email, const QString &name) |
40 | { | 40 | { |
41 | //skip if not a valid email address, | 41 | //skip if not a valid email address, |
42 | if (email.find( '@') == -1) | 42 | if (email.find( '@') == -1) |
43 | return; | 43 | return; |
44 | 44 | ||
45 | if ( ! containsEmail(email) ) { | 45 | if ( ! containsEmail(email) ) { |
46 | Contact *in = new Contact; | 46 | AContact *in = new AContact; |
47 | in->email = email; | 47 | in->email = email; |
48 | in->name = name; | 48 | in->name = name; |
49 | addresses.append(in); | 49 | addresses.append(in); |
50 | dirty = TRUE; | 50 | dirty = TRUE; |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | bool AddressList::containsEmail(const QString &email) | 54 | bool AddressList::containsEmail(const QString &email) |
@@ -60,61 +60,61 @@ bool AddressList::containsName(const QString &name) | |||
60 | { | 60 | { |
61 | return ( getNameRef(name) != -1 ); | 61 | return ( getNameRef(name) != -1 ); |
62 | } | 62 | } |
63 | 63 | ||
64 | QString AddressList::getNameByEmail(const QString &email) | 64 | QString AddressList::getNameByEmail(const QString &email) |
65 | { | 65 | { |
66 | int pos = getEmailRef(email); | 66 | int pos = getEmailRef(email); |
67 | if (pos != -1) { | 67 | if (pos != -1) { |
68 | Contact *ptr = addresses.at(pos); | 68 | AContact *ptr = addresses.at(pos); |
69 | return ptr->name; | 69 | return ptr->name; |
70 | } | 70 | } |
71 | 71 | ||
72 | return NULL; | 72 | return QString::null; |
73 | } | 73 | } |
74 | 74 | ||
75 | QString AddressList::getEmailByName(const QString &name) | 75 | QString AddressList::getEmailByName(const QString &name) |
76 | { | 76 | { |
77 | int pos = getNameRef(name); | 77 | int pos = getNameRef(name); |
78 | if (pos != -1) { | 78 | if (pos != -1) { |
79 | Contact *ptr = addresses.at(pos); | 79 | AContact *ptr = addresses.at(pos); |
80 | return ptr->email; | 80 | return ptr->email; |
81 | } | 81 | } |
82 | 82 | ||
83 | return NULL; | 83 | return QString::null; |
84 | } | 84 | } |
85 | 85 | ||
86 | int AddressList::getEmailRef(const QString &email) | 86 | int AddressList::getEmailRef(const QString &email) |
87 | { | 87 | { |
88 | int pos = 0; | 88 | int pos = 0; |
89 | Contact *ptr; | 89 | AContact *ptr; |
90 | 90 | ||
91 | for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { | 91 | for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { |
92 | if (ptr->email == email) | 92 | if (ptr->email == email) |
93 | return pos; | 93 | return pos; |
94 | pos++; | 94 | pos++; |
95 | } | 95 | } |
96 | return -1; | 96 | return -1; |
97 | } | 97 | } |
98 | 98 | ||
99 | int AddressList::getNameRef(const QString &name) | 99 | int AddressList::getNameRef(const QString &name) |
100 | { | 100 | { |
101 | int pos = 0; | 101 | int pos = 0; |
102 | Contact *ptr; | 102 | AContact *ptr; |
103 | 103 | ||
104 | for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { | 104 | for (ptr = addresses.first(); ptr != 0; ptr = addresses.next() ) { |
105 | if (ptr->name == name) | 105 | if (ptr->name == name) |
106 | return pos; | 106 | return pos; |
107 | pos++; | 107 | pos++; |
108 | } | 108 | } |
109 | return -1; | 109 | return -1; |
110 | } | 110 | } |
111 | 111 | ||
112 | QList<Contact>* AddressList::getContactList() | 112 | QList<AContact>* AddressList::getContactList() |
113 | { | 113 | { |
114 | return &addresses; | 114 | return &addresses; |
115 | } | 115 | } |
116 | 116 | ||
117 | void AddressList::read() | 117 | void AddressList::read() |
118 | { | 118 | { |
119 | OContactAccess::List::Iterator it; | 119 | OContactAccess::List::Iterator it; |
120 | 120 | ||
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 | |||
@@ -18,17 +18,17 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef ADDRESSLIST_H | 20 | #ifndef ADDRESSLIST_H |
21 | #define ADDRESSLIST_H | 21 | #define ADDRESSLIST_H |
22 | 22 | ||
23 | #include <qobject.h> | 23 | #include <qobject.h> |
24 | #include <qlist.h> | 24 | #include <qlist.h> |
25 | 25 | ||
26 | struct Contact | 26 | struct AContact |
27 | { | 27 | { |
28 | QString email; | 28 | QString email; |
29 | QString name; | 29 | QString name; |
30 | }; | 30 | }; |
31 | 31 | ||
32 | class AddressList : public QObject | 32 | class AddressList : public QObject |
33 | { | 33 | { |
34 | Q_OBJECT | 34 | Q_OBJECT |
@@ -36,23 +36,23 @@ class AddressList : public QObject | |||
36 | public: | 36 | public: |
37 | AddressList(); | 37 | AddressList(); |
38 | ~AddressList(); | 38 | ~AddressList(); |
39 | void addContact(const QString &email, const QString &name); | 39 | void addContact(const QString &email, const QString &name); |
40 | bool containsEmail(const QString &email); | 40 | bool containsEmail(const QString &email); |
41 | bool containsName(const QString &name); | 41 | bool containsName(const QString &name); |
42 | QString getNameByEmail(const QString &email); | 42 | QString getNameByEmail(const QString &email); |
43 | QString getEmailByName(const QString &name); | 43 | QString getEmailByName(const QString &name); |
44 | QList<Contact>* getContactList(); | 44 | QList<AContact>* getContactList(); |
45 | 45 | ||
46 | private: | 46 | private: |
47 | int getEmailRef(const QString &email); | 47 | int getEmailRef(const QString &email); |
48 | int getNameRef(const QString &name); | 48 | int getNameRef(const QString &name); |
49 | QString getRightString(const QString &in); | 49 | QString getRightString(const QString &in); |
50 | void read(); | 50 | void read(); |
51 | 51 | ||
52 | private: | 52 | private: |
53 | QList<Contact> addresses; | 53 | QList<AContact> addresses; |
54 | QString filename; | 54 | QString filename; |
55 | bool dirty; | 55 | bool dirty; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | #endif | 58 | #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 | |||
@@ -32,22 +32,22 @@ WriteMail::WriteMail( QWidget* parent, const char* name, WFlags fl ):QMainWindo | |||
32 | 32 | ||
33 | WriteMail::~WriteMail() | 33 | WriteMail::~WriteMail() |
34 | { | 34 | { |
35 | delete addAtt; | 35 | delete addAtt; |
36 | } | 36 | } |
37 | 37 | ||
38 | void WriteMail::setAddressList(AddressList *list) | 38 | void WriteMail::setAddressList(AddressList *list) |
39 | { | 39 | { |
40 | Contact *cPtr; | 40 | AContact *cPtr; |
41 | 41 | ||
42 | addressList = list; | 42 | addressList = list; |
43 | 43 | ||
44 | addressView->clear(); | 44 | addressView->clear(); |
45 | QList<Contact> *cListPtr = addressList->getContactList(); | 45 | QList<AContact> *cListPtr = addressList->getContactList(); |
46 | QListViewItem *item; | 46 | QListViewItem *item; |
47 | for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) { | 47 | for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) { |
48 | item = new QListViewItem(addressView, cPtr->name, cPtr->email); | 48 | item = new QListViewItem(addressView, cPtr->name, cPtr->email); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | void WriteMail::init() | 52 | void WriteMail::init() |
53 | { | 53 | { |