Bug 350887 - Error when trying to practise conjugations
Summary: Error when trying to practise conjugations
Status: RESOLVED FIXED
Alias: None
Product: parley
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: parley bug tracker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-02 18:04 UTC by Zsolt Szakács
Modified: 2016-04-23 16:39 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zsolt Szakács 2015-08-02 18:04:14 UTC
In Parey 2.1.0, based on KF 5.12.0, when I switch the practice mode to "Conjugations" and click on the "Start Practice" button on the toolbar, I get an error message that says, "The vocabulary document contains no entries that can be used for the chosen type of practice." This happens regardless of whether I have set information about conjugations or not for any vocabulary item in the Editor.

Reproducible: Always

Steps to Reproduce:
1. Select File -> New, click on OK
2. Add at least one tense in the "Tenses" tab and click on OK
3. In the Editor, create at least one entry
4. Select "Verb" as a part of speech category
5. Fill out the word forms section
6. Go to Practice
7. Select "Conjugations" as the Practice Mode and check any item from the list of tenses
8. Click on "Start Practice" on the toolbar

Actual Results:  
The error message "The vocabulary document contains no entries that can be used for the chosen type of practice." pops up


Using Manjaro Linux x86-64.
Comment 1 Andreas Cord-Landwehr 2016-03-01 19:15:29 UTC
Git commit a6c0dbdbf6fdb0190e4dec881154fd64d112a705 by Andreas Cord-Landwehr, on behalf of Hartmut Riesenbeck.
Committed on 01/03/2016 at 19:13.
Pushed by cordlandwehr into branch 'master'.

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.
REVIEW: 127155

M  +6    -0    src/collection/entryfilter.cpp

http://commits.kde.org/parley/a6c0dbdbf6fdb0190e4dec881154fd64d112a705