DaleFarnsworth / codeplug

Obsolete. Code for reading, modifying, and writing codeplug files for the MD-380 DMR radio - Obsolete. Further development will be tracked in github.com/DaleFarnsworth-DMR
https://www.farnsworth.org/dale/codeplug
49 stars 10 forks source link

Crash when trying to edit a zonefile after a channel rename #17

Closed bminish closed 6 years ago

bminish commented 6 years ago

When renaming a channel WHILE the zone window is also open, there is an inconsistency with how the channel is named in the zone. Presumably because the zone editor does not know it would now be an appropriate to reload the zone and repopulate the display. However when you try to remove the entry with the old name there is a crash

Delete Member pops up a dialog box that says

"fieldNameToField:%!(EXTRA string=bad list record name 'DpMR446_1')"

If you hit 'cancel' or 'ignore' editcp crashes

What probably ought to happen is that you go back to the zone and the zone is reread to get the new channel name

Steps to recreate

  1. open a code plug
  2. open the channels editor
  3. open the zone editor
  4. select a zone
  5. rename a channel in this zone in the channels editor
  6. try to remove the old name from the zone in the zone editor

I have not checked to see if similar issues occur when for example renaming a TG referenced in an open channel. interactions in scan lists etc

in my terminal this is returned after the crash

$ ./editcp panic: runtime error: index out of range

goroutine 1 [running, locked to thread]: github.com/dalefarnsworth/codeplug/codeplug.(Record).RemoveFieldsChange(0xc420330f20, 0x0, 0x0, 0x0, 0x0) /media/sf_GOPATH0/src/github.com/dalefarnsworth/codeplug/codeplug/change.go:238 +0x12a github.com/dalefarnsworth/codeplug/ui.(VBox).AddFieldMembers.func3() /media/sf_GOPATH0/src/github.com/dalefarnsworth/codeplug/ui/fieldList.go:660 +0x136 github.com/dalefarnsworth/codeplug/ui.(Button).ConnectClicked.func1(0x8bd700) /media/sf_GOPATH0/src/github.com/dalefarnsworth/codeplug/ui/ui.go:1409 +0x24 github.com/therecipe/qt/widgets.callbackQAbstractButton_Clicked(0x2c84a50, 0xc400000000) /home/user/work/src/github.com/therecipe/qt/widgets/widgets-minimal.go:117 +0x7d github.com/therecipe/qt/widgets._cgoexpwrap_49467942c257_callbackQAbstractButton_Clicked(0x2c84a50, 0x0) github.com/therecipe/qt/widgets/_obj/_cgo_gotypes.go:16857 +0x34 github.com/therecipe/qt/widgets._Cfunc_QApplication_QApplication_Exec(0xc400000000) github.com/therecipe/qt/widgets/_obj/_cgo_gotypes.go:2496 +0x49 github.com/therecipe/qt/widgets.(QApplication).Exec(0xc4200ea9c0, 0xc4200eaa00) /home/user/work/src/github.com/therecipe/qt/widgets/widgets-minimal.go:2865 +0x22 github.com/dalefarnsworth/codeplug/ui.(*App).Exec(0xc4200ea9c0) /media/sf_GOPATH0/src/github.com/dalefarnsworth/codeplug/ui/ui.go:78 +0x2d main.main() /media/sf_GOPATH0/src/github.com/dalefarnsworth/codeplug/editcp/editcp.go:268 +0x1a6

DaleFarnsworth commented 6 years ago

Fixed in v0.16.0. If you still see problems, please re-open this issue.