npruehs / tome-editor

Tome is a generic data editor for games supporting arbitrary input and output formats.
GNU Lesser General Public License v3.0
36 stars 7 forks source link

Tome 0.9 - Major Issue / crash: handling the case of record string ids inconsistent / faulty #120

Closed pgrimsehl closed 7 years ago

pgrimsehl commented 7 years ago

In the current version, some parts of Tome ignore the case of record string ids while others don't. Over all, the handling is inconsistent and faulty:

Handling when loading a project:

  1. Create a new project using string ids
  2. Add a record with id "GameSpeed"
  3. Add a record with id "Gamespeed"
  4. Save the project
  5. Load the project
  6. The record "Gamespeed" was removed

Handling when editing a project::

  1. Create a new project using string ids
  2. Add a record with id "GameSpeed"
  3. Add a record with id "Gamespeed"
  4. Add a child record "test" to "Gamespeed"
  5. The record "Gamespeed" is removed, "test" is child of "GameSpeed" now
  6. Delete "GameSpeed"
  7. Try to create a record with id "Gamespeed" -> this will NOT work, Tome tells you to choose a different name
  8. Add a record with id "GameSpeed" (works fine)
  9. Try to change the id "GameSpeed" to "Gamespeed" -> this will NOT work, Tome tells you to choose a different name

Tome crashes, when trying to to the following steps

  1. Create a new project using string ids
  2. Add a record with id "Gamespeed"
  3. Try to change the id "Gamespeed" to "GameSpeed", Tome crashes while accessing the TreeWidgetItem, which is unavailable.
1   QString::operator=                         qstring.cpp               1821 0x6e3e419a     
2   Tome::RecordTreeWidgetItem::setDisplayName recordtreewidgetitem.cpp  44   0x7ff7ca277065 
3   Tome::RecordTreeWidget::updateRecord       recordtreewidget.cpp      162  0x7ff7ca277acb 
4   MainWindow::onRecordUpdated                mainwindow.cpp            1699 0x7ff7ca1fa696 
5   MainWindow::qt_static_metacall             moc_mainwindow.cpp        356  0x7ff7ca2d7880 
6   QMetaObject::activate                      qobject.cpp               3742 0x6e6932b2     
7   QMetaObject::activate                      qobject.cpp               3603 0x6e692a28     
8   Tome::RecordsController::recordUpdated     moc_recordscontroller.cpp 275  0x7ff7ca2dc9f8 
9   Tome::RecordsController::updateRecord      recordscontroller.cpp     738  0x7ff7ca25ed71 
10  Tome::UpdateRecordCommand::redo            updaterecordcommand.cpp   63   0x7ff7ca2be85c 
11  QUndoStack::push                           qundostack.cpp            585  0x6f4a3a69     
12  Tome::UndoController::doCommand            undocontroller.cpp        32   0x7ff7ca2b5492 
13  MainWindow::on_actionEdit_Record_triggered mainwindow.cpp            890  0x7ff7ca1f7eec 
14  MainWindow::treeWidgetDoubleClicked        mainwindow.cpp            1459 0x7ff7ca1fb238 
15  MainWindow::qt_static_metacall             moc_mainwindow.cpp        363  0x7ff7ca2d79af 
16  QMetaObject::activate                      qobject.cpp               3742 0x6e6932b2     
17  QMetaObject::activate                      qobject.cpp               3603 0x6e692a28     
18  QAbstractItemView::doubleClicked           moc_qabstractitemview.cpp 656  0x6f2890ae     
19  QTreeView::mouseDoubleClickEvent           qtreeview.cpp             1944 0x6f2f8022     
20  QWidget::event                             qwidget.cpp               8785 0x6ee72a63     

Unfortunately I couldn't figure out the problem myself, but with regard to the other issues with string ids I think the problem lies deeper.

npruehs commented 7 years ago

Confirmed - thanks for bringing this up!