equal
deleted
inserted
replaced
136 void AddressBook::submitContact() |
136 void AddressBook::submitContact() |
137 { |
137 { |
138 QString name = nameLine->text(); |
138 QString name = nameLine->text(); |
139 QString address = addressText->toPlainText(); |
139 QString address = addressText->toPlainText(); |
140 |
140 |
141 if (name == "" || address == "") { |
141 if (name.isEmpty() || address.isEmpty()) { |
142 QMessageBox::information(this, tr("Empty Field"), |
142 QMessageBox::information(this, tr("Empty Field"), |
143 tr("Please enter a name and address.")); |
143 tr("Please enter a name and address.")); |
144 } |
144 return; |
|
145 } |
145 |
146 |
146 if (currentMode == AddingMode) { |
147 if (currentMode == AddingMode) { |
147 |
148 |
148 if (!contacts.contains(name)) { |
149 if (!contacts.contains(name)) { |
149 contacts.insert(name, address); |
150 contacts.insert(name, address); |