[kln2-devel] prefs
Brought to you by:
wiecko
From: Carlo <si...@bl...> - 2004-10-12 22:25:51
|
Hi, now exercises save their own preferences, the implementation is a mix of what Marek suggested and what I had in mind. Basically KLearnNotes::saveOptions() loops trough exercises and ask them to save preferences (if he wants :). There is still a problem: sliders' position is not saved (in Staff and PianoKeyboard). This happens because sliders are private and there aren't funtions to get/set their position. This would require to implement a saveOptions() function also in these classes, ToDo? mmmm, I get so many warnings about missing KDE icons that I didn't even care about crashes! It seems like KLN is getting into another Segmentation Fault :/ If kln2 is not deleted the destroyer is not called, I think this is because it is created with new (it is a pointer) > prefs data is not saved --> for coherency we should call klnPrefs->flush() in KLN::saveOptions() so data are written to file when we ask to save them. KLN crashes in the destructor, but not because of functions we put in it. It crashes at the end of the destructor: when it executes code inserted by the compiler. But computers never fail... This is my stack: ??() QPtrList<QCanvasRectangle>::deleteItem @ qptrlist.h:150 QGList::clear () QPtrList<QCanvasRectangle>::clear (this) @ qptrlist.h:93 ~QPtrList (this) @ qptrlist.h:70 ~PianoKeyboardKey (this) @ musicwidget.moc.cpp:139 QCanvas::~QCanvas () QWidget::~QWidget () ~QFrame (this) @ guitartuner.cpp:36 ~Exercise (this) @ exercise.cpp:176 ~ExercisePianoToName (this) @ exe-piano_name.cpp:74 QWidget::~QWidget () QFrame::~QFrame () QWidget::~QWidget () QMainWindow::~QMainWindow () ~KLearnNotes2 (this) @ klearnnotes2.cpp:741 main (argc=1, argv=[...]) @ main.cpp:196 I didn't understand very much... anyway, why doesn't PianoKeyboardKey have a destructor? Regards, Carlo |