Bitcoin-Qt: fix known addressbook bugs
authorPhilip Kaufmann <phil.kaufmann@t-online.de>
Tue, 8 Jan 2013 07:17:58 +0000 (08:17 +0100)
committerCryptoManiac <balthazar@yandex.ru>
Sun, 23 Feb 2014 17:21:53 +0000 (21:21 +0400)
commitca4e9ec025fb252061b4841daf4eb05898a122f0
tree77ba1f1fb09a2964f28dbf38f6c2c1c16a321a78
parenta91fd48fb30aaf635bc7e7d3f0a5a429687de54a
Bitcoin-Qt: fix known addressbook bugs

- add qSort() for cachedAddressTable, as qLowerBound() and qUpperBound()
  require the list to be in ascending order (see
  http://harmattan-dev.nokia.com/docs/library/html/qt4/qtalgorithms.html#qLowerBound)
- add a new check in AddressTableModel::setData() to just return, when no
  changes were made to a label or an address (prevents entry duplication
  issue)
- remove "rec->label = value.toString();" from
  AddressTableModel::setData() as the label gets updated by
  AddressTablePriv::updateEntry() anyway (seems @sipa added this line via
  https://github.com/bitcoin/bitcoin/commit/1025440184ef100a22d07c7bb543ee45cf169d64#L6R225)
- add another new check in AddressTableModel::setData() to just return, if
  a duplicate address was found (prevents address overwrite)
- add a new check to EditAddressDialog::setModel() to prevent setting an
  invalid model
- re-work the switch-case statement in AddressTableModel::accept() to
  always break (as return get's called anyway) and order the list to match
  the enum definition
- make accept() in editaddressdialog.h a public slot, which it should be
- misc small coding style changes
src/qt/addresstablemodel.cpp
src/qt/addresstablemodel.h
src/qt/editaddressdialog.cpp
src/qt/editaddressdialog.h