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

Khudyakov Alexey alexey.skladnoy at gmail.com
Sat Aug 29 10:15:46 CEST 2009


В сообщении от Суббота 29 августа 2009 00:07:09 автор Prakash Mohan написал:
> SVN commit 1016760 by prakash:
>
> Add a parametric constructor in the Observation classs to set the values
> from the Objects of the Comast namespace directly, unlike the current one
> which uses just qstrings. Use the constructor in the execute for adding
> observations. This fixes a crash when there are no Observer or Site or
> Eyepeice stored while saving the logs.
>
> CCMAIL: kstars-devel at kde.org

> +Observation::Observation( QString id, Observer* observer, Session*
> session, SkyObject* target, KStarsDateTime begin, double faintestStar,
> double seeing, Scope* scope, Eyepiece* eyepiece, Lens *lens, Filter*
> filter,  QString result, QString lang ) { +    if( observer )
> +        m_Observer = observer->id();
> +    if( target )
> +        m_Target = target->name();
> +    if( session ) {
> +        m_Session = session->id();
> +        m_Site = session->site();
> +    }
> +    if( scope )
> +        m_Scope = scope->id();
> +    if( lens )
> +        m_Lens = lens->id();
> +    if( filter )
> +        m_Filter = filter->id();
> +    if( eyepiece )
> +        m_Eyepiece = eyepiece->id();
> +    m_Name = id;
> +    m_Begin = begin;
> +    m_FaintestStar = faintestStar;
> +    m_Seeing = seeing;
> +    m_Result = result;
> +    m_Lang = lang;
> +}

Hmm... Is it implied that some parameters could be left out? If not I think 
isn't it better to use references.

And at any rate its better to add const annotation to pointers or references.


More information about the Kstars-devel mailing list