6 CContact* CContact::first = '\0';
9 QString toLower(QString& s)
12 transform(st.begin(), st.end(), st.begin(), tolower);
17 CContact::CContact(const QString &firstname, const QString &lastname, const QString &adress, const QString &phonenumber)
19 strings[0] = firstname;
20 strings[1] = lastname;
22 strings[3] = phonenumber;
37 void CContact::remove()
39 if (next != '\0' && prev != '\0')
44 else if (next != '\0' && prev == '\0')
49 else if (next == '\0' && prev != '\0')
70 CContact* contact = first;
71 while (contact != '\0')
73 int test = strings[1].upper().compare(contact->strings[1].upper());
77 //int test2 = strcasecmp(strfdsfdngs[0].c_str(), contact->strings[0].c_str());
78 int test2 = strings[0].upper().compare(contact->strings[0].upper());
102 if (first == contact)
106 contact->prev = this;
110 prev = contact->prev;
112 contact->prev = this;
116 if (contact->next == '\0')
120 contact->next = this;
125 contact = contact->next;
130 QString CContact::firstname()
135 QString CContact::lastname()
140 QString CContact::adress()
145 QString CContact::phoneNumber()
150 bool CContact::search(int i, QString s)
154 //char* s1 = s.c_str();
155 int test = strings[i - 1 ].find(s,0,false );
156 // cout << strings[i - 1] << "\n" << s << "\n" << test << "\nTryck Enter";
158 if (test == 0) //QString::npos) //4294967295)
167 void CContact::modify(int i, QString s)
171 // cout << "Modifierar strängen " << i << " med namnet " << strings[0] << " \n";
175 // cout << "Tar bort gammal konfiguration\n";
177 // cout << "Lägger till den på rätt plats+n";
183 CContact* CContact::getFirst()
188 int CContact::getNum()
194 CContact* CContact::getNext()
199 CContact* CContact::getPrev()