[Kstars-devel] KDE/kdeedu/kstars/kstars/skyobjects

Akarsh Simha akarshsimha at gmail.com
Thu Jun 4 14:36:35 CEST 2009


> > I don't think there are any QStrings in StarObject. I remember getting
> > rid of them and replacing them with char arrays, because we do a raw
> > memcpy. That was why we moved the userLog and other strings into
> > AuxInfo.
> >
> It does have. Following fields are in SkyObject class. 
> 
>     QString Name, Name2, LongName;

Thanks for pointing out! Yes, I remember now that James has been
suggesting that these be removed from SkyObject because we are wasting
memory keeping them for all those billions of unnamed stars.

Since we do memcpy() only for unnamed stars, raw copying of QString
doesn't cause a problem. So this will probably cause a problem if we
try to delete the StarObject directly, if it was created using
memcpy(). 

I'm also very unhappy with the way names are handled in KStars. In
some cases, Name stores the localized name (eg: Planets) and in some
cases (eg: Sun), Name stores the US English name. This creates a whole
lot of translation issues all around KStars, which I've been patching
with dirty fixes so far.

James was suggesting that we move SkyObject to "UnnamedSkyObject" and
inherit SkyObject from it, IIRC. All those unnamed stars can then be
UnnamedSkyObjects.

I see that there's no documentation about this counterintuitive and
delicate way of doing things anywhere, apart from the comments in the
files. I'll try to write some this weekend.

Regards
Akarsh


More information about the Kstars-devel mailing list