[Digikam-devel] Re: Weird error message
Michael G. Hansen
mike at mghansen.de
Thu Apr 14 22:04:25 BST 2011
On 04/10/2011 06:06 PM, Andi Clemens wrote:
> Hi all,
>
> I get this error message whenever I start digiKam:
> KGlobal::locale::Warning your global KLocale is being recreated with a
> valid main component instead of a fake component, this usually means you
> tried to call i18n related functions before your main component was
> created. You should not do that since it most likely will not work
>
> Do you see this, too?
I think I found the causes for this problem, or at least some of them,
by intercepting calls to i18n, see valgrind log below. One example is
this line:
http://lxr.kde.org/source/extragear/graphics/digikam/utilities/advancedrename/parser/options/dateoption.cpp#46
static const QString dateFormatLinkDescr = i18nc("date format settings",
"format settings");
Here, we should use ki18nc instead, but the string is used in the next line:
static const QString dateFormatLink =
QString("<a
href='http://doc.trolltech.com/latest/qdatetime.html#toString'>%1</a>").arg(dateFormatLinkDescr);
So I think we have to move it to some place which will be called after
the creation of KApplication.
Michael
(sid-kde-46)mike at operator:/c/temp/kdebuild/digikam-sc$ valgrind
--tool=memcheck ./core/tests/advancedrenametest
==27142== Memcheck, a memory error detector
==27142== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==27142== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for
copyright info
==27142== Command: ./core/tests/advancedrenametest
==27142==
**27142** 802 at 0x6E97D92: VALGRIND_PRINTF_BACKTRACE(char const*,
...) (valgrind.h:4233)
==27142== by 0x6E99708: i18nc(char const*, char const*)
(klocalizedstring.h:802)
==27142== by 0x70641F7:
__static_initialization_and_destruction_0(int, int)
(imageguidewidget.cpp:54)
==27142== by 0x7102555: ??? (in
/c/temp/kdebuild/digikam-sc/lib/libdigikamcore.so.2.0.0)
==27142== by 0x6E47332: ??? (in
/c/temp/kdebuild/digikam-sc/lib/libdigikamcore.so.2.0.0)
unnamed app(27142)/digikam (core) i18nc:
/usr/local/include/klocalizedstring.h 802
**27142** 802 at 0x6E97D92: VALGRIND_PRINTF_BACKTRACE(char const*,
...) (valgrind.h:4233)
==27142== by 0x6E99708: i18nc(char const*, char const*)
(klocalizedstring.h:802)
==27142== by 0x706422E:
__static_initialization_and_destruction_0(int, int)
(imageguidewidget.cpp:55)
==27142== by 0x7102555: ??? (in
/c/temp/kdebuild/digikam-sc/lib/libdigikamcore.so.2.0.0)
==27142== by 0x6E47332: ??? (in
/c/temp/kdebuild/digikam-sc/lib/libdigikamcore.so.2.0.0)
unnamed app(27142)/digikam (core) i18nc:
/usr/local/include/klocalizedstring.h 802
**27142** 802 at 0x423460: VALGRIND_PRINTF_BACKTRACE(char const*, ...)
(valgrind.h:4233)
==27142== by 0x424656: i18nc(char const*, char const*)
(klocalizedstring.h:802)
==27142== by 0x4314F6: __static_initialization_and_destruction_0(int,
int) (dateoption.cpp:46)
==27142== by 0x44CD85: ??? (in
/c/temp/kdebuild/digikam-sc/core/tests/advancedrenametest)
==27142== by 0x4133C2: ??? (in
/c/temp/kdebuild/digikam-sc/core/tests/advancedrenametest)
==27142== by 0x7FF00047F: ???
==27142== by 0x44CD14: __libc_csu_init (in
/c/temp/kdebuild/digikam-sc/core/tests/advancedrenametest)
==27142== by 0x91EEBDF: (below main) (libc-start.c:187)
unnamed app(27142)/digikam (core) i18nc:
/usr/local/include/klocalizedstring.h 802
KGlobal::locale::Warning your global KLocale is being recreated with a
valid main component instead of a fake component, this usually means you
tried to call i18n related functions before your main component was
created. You should not do that since it most likely will not work
More information about the Digikam-devel
mailing list