Review Request: KFilePlacesModel: Translate system bookmarks dynamically

Oswald Buddenhagen ossi at kde.org
Sat May 2 18:55:17 BST 2009



> On 2009-05-02 10:14:56, Oswald Buddenhagen wrote:
> > you could/should store the untranslated string as a byte array
> 
> Peter Penz wrote:
>     KBookmark::setMetaData() only allows having a QString as value for a key :-(
>     
>     QString::QString(const char *str) interprets the input (in our case "Home", "Network", "Root" and "Trash") as ASCII encoded characters and converts it internally to Unicode. In line 28 it is converted to an UTF8 encoded char* string as requested by i18n(). I agree that using a byte array would be preferrable, but as KBookmark does not support it, I'd leave it as it is (at least I've no idea how to store it as byte array without making the code unnecessary complex).

too bad.
given that you know that the string is ascii, you can use toLatin1 instead of toUtf8 for efficiency. but that's splitting hairs. :D


- Oswald


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/650/#review1032
-----------------------------------------------------------


On 2009-05-02 10:11:55, Peter Penz wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/650/
> -----------------------------------------------------------
> 
> (Updated 2009-05-02 10:11:55)
> 
> 
> Review request for kdelibs.
> 
> 
> 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
> -----
> 
>   trunk/KDE/kdelibs/kfile/kfileplacesitem.cpp 961249 
>   trunk/KDE/kdelibs/kfile/kfileplacesitem_p.h 961249 
>   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