[KPhotoAlbum] newToOldCategory in Database.cpp

Tobias Leupold tobias.leupold at gmx.de
Sun Oct 11 07:24:18 BST 2020


Iirc, we needed this back then when we kicked out the localized categories.

The original behavior was that e. g. "Locations" was passed through the
translations mechanism and was displayed as e. g. "Orte" with a German locale
(being actually called "Locations" though). This caused a lot of problems
later on, so we decided to initialize the category names once in the currently
used locale when the database is created and use this very name also in the
database.

As no l10n has been done anymore later on, a German speaking user would have
seen "Locations" on-screen (the actual name) instead of the localized "Orte",
so we had to move those category names once to their localized counterpart.

It's been some years, but I think this code would still be needed if a quite
old database was loaded with a recent version.

Am Sonntag, 11. Oktober 2020, 02:29:52 CEST schrieb Robert Krawitz:
> This appears to be to allow loading pre-version6 databases, where "Persons"
> was renamed to "People" and "Locations" to "Places".  But I can't find any
> code that actually uses it; neither caller to createImageInfo passes
> anything in here.
>
> Is that a bug, or is this something I can remove?  There's some cleanup I
> want to do in possibleLoadCompressedCategories() that might give us a
> little bit of improvement, but the newToOldCategory might get in my way a
> bit.  It's not going to be a huge improvement; those are likely to be hard
> to come by without a faster parser, but everything we can squeeze out in
> startup is a good thing (startup is very noticeable).
> _______________________________________________
> KPhotoAlbum mailing list
> KPhotoAlbum at mail.kdab.com
> https://mail.kdab.com/mailman/listinfo/kphotoalbum






More information about the Kphotoalbum mailing list