Review Request: KFilePlacesModel: Translate system bookmarks dynamically
Peter Penz
peter.penz at gmx.at
Sat May 2 18:07:11 BST 2009
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/650/
-----------------------------------------------------------
(Updated 2009-05-02 10:07:11.364598)
Review request for kdelibs.
Changes
-------
I've uploaded a new version of the patch. I agree with Oswald that the previous version is too expensive from a performance point of view. I followed Kevin Ottens advice to move the logic into the KFilePlacesItem itself and - voila! - the patch got straight forward.
I'm unsure whether there might be an alternative to line 28 of the patch:
+ m_text = i18n(bookmark.text().toUtf8().data());
It is assured that a translation for a systembookmark is given as the caller of KFilePlacesItem::createSystemBookmark() must provide a i18n()-ized version of the label. The patch seems to work fine, but as I've not seen such a usage of i18n() I'm unsure whether there is an alternative approach to this.
Summary
-------
The patch fixes the issue that system bookmarks like "Home", "Root", "Network" and "Trash" are not retranslated if the user changes the language.
Root cause of the issue:
The system bookmarks are only translated once after the first access to the bookmarks. Afterwards the bookmark labels are handled as "normal" text.
Solution:
The bookmarks are stored untranslated in the model and get translated dynamically for the user interface when the list view requests the label. For sure it is still possible that the user changes the label of a system bookmark.
If there are no objections/comments, I'll commit the patch on May the 5th.
This addresses bug https://bugs.kde.org/show_bug.cgi?id=177536.
https://bugs.kde.org/show_bug.cgi?id=https://bugs.kde.org/show_bug.cgi?id=177536
Diffs (updated)
-----
home/kde/trunk/KDE/kdelibs/kfile/kfileplacesitem.cpp 961249
home/kde/trunk/KDE/kdelibs/kfile/kfileplacesitem_p.h 961249
home/kde/trunk/KDE/kdelibs/kfile/kfileplacesmodel.cpp 961249
Diff: http://reviewboard.kde.org/r/650/diff
Testing
-------
Thanks,
Peter
More information about the kde-core-devel
mailing list