Beispiel #1
0
QString GeoLocation::fullName() const {
    if ( province().isEmpty() ) {
        return QString("%1, %2").arg(translatedName(), translatedCountry());
    } else {
        return QString("%1, %2, %3").arg(translatedName(), translatedProvince(), translatedCountry());
    }
}
Beispiel #2
0
QString GeoLocation::fullName() const {
	QString s;
	if ( province().isEmpty() ) {
		s = translatedName() + ", " + translatedCountry();
	} else {
		s = translatedName() + ", " + translatedProvince() + ", " + translatedCountry();
	}
	
	return s;
}
QString StarObject::nameLabel( bool drawName, bool drawMag ) const
{
    QString sName;
    if ( drawName ) {
        if ( translatedName() != i18n("star") && ! translatedName().isEmpty() )
            sName = translatedName();
        else if ( ! gname().trimmed().isEmpty() )
            sName = gname( true );
        else {
            if ( drawMag )
                return KGlobal::locale()->formatNumber( mag(), 1 );
        }
        if ( ! drawMag )
            return sName;
        else
            return sName + ' ' + KGlobal::locale()->formatNumber( mag(), 1 );
    }
    return KGlobal::locale()->formatNumber( mag(), 1 );
}
Beispiel #4
0
QString DeepSkyObject::labelString() const
{
    QString oName;
    if( Options::showDeepSkyNames() )
    {
        if( Options::deepSkyLongLabels() && translatedLongName() != translatedName() )
            oName = translatedLongName() + " (" + translatedName() + ')';
        else
            oName = translatedName();
    }

    if( Options::showDeepSkyMagnitudes() )
    {
        if( Options::showDeepSkyNames() )
            oName += " ";
        oName += "[" + QLocale().toString( mag(), 'f', 1 ) + "m]";
    }

    return oName;
}
Beispiel #5
0
void SkyObject::setLongName( const QString &longname ) {
	delete LongName;
	if ( longname.isEmpty() ) {
		if ( hasName() )
			LongName = new QString(translatedName());
		else if ( hasName2() )
			LongName = new QString(*Name2);
		else
			LongName = 0;
	} else {
		LongName = new QString(longname);
	}
}