equal
deleted
inserted
replaced
120 void AddressBook::submitContact() |
120 void AddressBook::submitContact() |
121 { |
121 { |
122 QString name = nameLine->text(); |
122 QString name = nameLine->text(); |
123 QString address = addressText->toPlainText(); |
123 QString address = addressText->toPlainText(); |
124 |
124 |
125 if (name == "" || address == "") { |
125 if (name.isEmpty() || address.isEmpty()) { |
126 QMessageBox::information(this, tr("Empty Field"), |
126 QMessageBox::information(this, tr("Empty Field"), |
127 tr("Please enter a name and address.")); |
127 tr("Please enter a name and address.")); |
|
128 return; |
128 } |
129 } |
129 |
130 |
130 if (!contacts.contains(name)) { |
131 if (!contacts.contains(name)) { |
131 contacts.insert(name, address); |
132 contacts.insert(name, address); |
132 QMessageBox::information(this, tr("Add Successful"), |
133 QMessageBox::information(this, tr("Add Successful"), |