Fix practise conjugations.
To make practice conjugations work two bugs had to be fixed: The first bug was caused by uninitialized member variable m_toTranslation in EntryFilter constructor. This caused that DocumentSettings could not be loaded and EntryFilter::m_tenses was empty (later in EntryFilter::cleanupInvalid method). Changed constructor to initialize m_toTranslation from Prefs::learningLanguage() and m_fromTranslation from Prefs::knownLanguage(). The second was not necessary to load the document settings, but was inserted for the sake of order. The member m_tenses is used in EntryFilter::cleanupInvalid method to remove entries which don't have any of the tenses which are configured for practice. Now that document settings was not loaded propperly before, m_tenses is empty. Because m_tenses was empty, all entries were removed and the error dialog was shown. After this was fixed, it came out that the conjugation prcatice widget didn't display the verbs to_translation and from_translation. This was caused by an incomplete initialisation of TestEntry objects in EntryFilter::conjugationTestEntries method. This was fixed by init the To- and From-Language of each new test enty from m_toTranslation and m_fromTranslation of EntryFilter. BUG: 350887 REVIEW: 127155
parent
a8af5058
Please register or sign in to comment