X-Git-Url: https://ruin.nu/git/?p=adress.git;a=blobdiff_plain;f=mainwindow.cpp;h=f07283884ccbb285d906bbc5b305dd0c7a7f8fcc;hp=094e54f9156730600c168633283073fa350c3d55;hb=4afecc26047eac097df5debb682e8fe2eb21f26d;hpb=db7da3f9f53fbde62cdde4ace214f50df3527e18 diff --git a/mainwindow.cpp b/mainwindow.cpp index 094e54f..f072838 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -156,6 +156,34 @@ void MainWindow::slotModify(QListViewItem* lvi) if(modify.exec() == QDialog::Accepted) updateView(); } + +void MainWindow::slotModify() +{ + QListViewItem* lvi = ContactView->selectedItem(); + + if (lvi == '\0') + { + return; + } + + int num = lvi->text(0).toInt(); + + if (num < 1 || num > CContact::getNum()) + return; + + CContact* contact = CContact::getFirst(); + + for (int i = 1; i < num; i++, contact = contact->getNext()) + { + if (contact->getNext() == '\0') + { + return; + } + } + ContactModifier modify(contact); + if(modify.exec() == QDialog::Accepted) + updateView(); +} /* * This funtion puts all contacts in the listview */