Helping libraries load their own translation catalogs

Albert Astals Cid aacid at kde.org
Mon Nov 22 19:05:45 GMT 2010


A Dilluns, 22 de novembre de 2010, David Faure va escriure:
> On Sunday 21 November 2010, Oswald Buddenhagen wrote:
> > On Sun, Nov 21, 2010 at 12:46:53AM +0000, Albert Astals Cid wrote:
> > > It achieves that by creating a static that instructs KGlobal to load a
> > > given translation catalog on global locale creation.
> > 
> > statics in shared libraries have always been like a red flag for us. i
> > don't know whether the reasons (some proprietary unix dynloader) are
> > still applicable.
> > qt has Q_CONSTRUCTOR_FUNCTION in qglobal.h nowadays. its implementation
> > seems more complicated than necessary to me (why the integer return
> > value?), so i wonder whether that's a workaround for something or just
> > random baroqueness.
> 
> Your message is not entirely useful because we don't know what to conclude
> from it :-) Can you ask the one who wrote it, or dig up the logs, to find
> out whether this is still needed or not, and which problems it solves?
> 
> What's for sure is that K_CATALOG_LOADER will fail when using static libs,
> but that's not something we generally support (although WinCE uses that),
> and static libs means generally only one or very few apps, so they can
> just hardcode insertCatalog calls.
> 
> Anyway, I'm fine with the patch. There's no destructor code so order-of-
> destruction won't be a problem, and the ctor code doesn't seem to rely on
> other things being created already, it will just create KGlobal if needed.
> (just one thing, "@since 4.6" missing in the new api)

I've commited it.

Albert




More information about the kde-core-devel mailing list