| Summary: | Catalog::altTrans() / m_storage sometimes filled with repeat entry | ||
|---|---|---|---|
| Product: | [Applications] lokalize | Reporter: | Finley Watson <fin-w> |
| Component: | translation memory | Assignee: | Simon Depiets <sdepiets> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | aacid, shafff |
| Priority: | NOR | ||
| Version First Reported In: | 24.08.2 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/sdk/lokalize/-/commit/b79e41273df1360bb11fa94dc953c6cf8b25bbff | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Finley Watson
2024-10-11 04:51:08 UTC
This also causes problems for the alttransview.cpp AltTransView::process() logic, not just for displaying entries, because the function should exit early if there are no entries.
The empty initial entry is added to m_storage in catalog.cpp Catalog::altTrans() because that function returns a QVector<AltTrans>, and the first entry (typically? always?) has empty source and target strings because of this code, where the altTrans() contains an entry that has empty source and target strings:
if (m_storage)
result = m_storage->altTrans(pos);
A possibly relevant merge request was started @ https://invent.kde.org/sdk/lokalize/-/merge_requests/192 Git commit 64903c06c65e8bbdd9a27ea50ba03c1c5183b731 by Finley Watson. Committed on 28/12/2024 at 14:21. Pushed by jjazeix into branch 'master'. Do not return QVector with an empty AltTrans Only return a QVector containing data when data actually exists for at least one field of the AltTrans struct. M +6 -3 src/catalog/gettext/gettextstorage.cpp https://invent.kde.org/sdk/lokalize/-/commit/64903c06c65e8bbdd9a27ea50ba03c1c5183b731 Git commit b79e41273df1360bb11fa94dc953c6cf8b25bbff by Albert Astals Cid, on behalf of Finley Watson. Committed on 02/01/2025 at 22:58. Pushed by aacid into branch 'release/24.12'. Do not return QVector with an empty AltTrans Only return a QVector containing data when data actually exists for at least one field of the AltTrans struct. (cherry picked from commit 64903c06c65e8bbdd9a27ea50ba03c1c5183b731) M +6 -3 src/catalog/gettext/gettextstorage.cpp https://invent.kde.org/sdk/lokalize/-/commit/b79e41273df1360bb11fa94dc953c6cf8b25bbff |