[PATCH] Update KAboutData after KApplication instance has been created

Johannes Sixt j.sixt at viscovery.net
Thu Mar 25 07:46:12 GMT 2010

Am 3/24/2010 23:00, schrieb Rafael Fernández López:
> The main problem was not that the widget was being created when the
> application instance was created (I checked that). It is smart and
> creates the about widget only when necessary. Basically it was that
> KComponentData was "caching" it as an instance, so changing the
> KAboutData afterwards (the instance you created on main.cpp) had no
> effect since it had been already cached.

> @@ -103,10 +107,12 @@
>  }
>  KComponentData::KComponentData(const KAboutData &aboutData,
MainComponentRegistration registerAsMain)
> -    : d(new KComponentDataPrivate(aboutData))
> +    : d(new KComponentDataPrivate(&aboutData))
>  {
>      Q_ASSERT(!aboutData.appName().isEmpty());

Are you sure that there are no users of KComponentData that pass a
reference to a temporary KAboutData? You would cache a pointer to a
temporary object!

-- Hannes
"Atomic objects are neither active nor radioactive." --
Doc.No N3035 (Working Draft, Standard for Programming Language C++)

More information about the kde-core-devel mailing list