[Kstars-devel] branches/kstars/summer/kstars/kstars/comast
Prakash Mohan
prak902000 at gmail.com
Fri Jul 10 17:37:31 CEST 2009
SVN commit 994458 by prakash:
Readability improvment patch, avoid calling of KStars::Instance() so often.
CCMAIL: kstars-devel at kde.org
M +8 -8 log.cpp
--- branches/kstars/summer/kstars/kstars/comast/log.cpp #994457:994458
@@ -35,7 +35,7 @@
QString Comast::Log::writeLog( bool _native ) {
ks = KStars::Instance();
- m_targetList = KStars::Instance()->observingList()->sessionList();
+ m_targetList = ks->observingList()->sessionList();
native = _native;
writeBegin();
if( native )
@@ -149,9 +149,9 @@
writer->writeCharacters( QString::number( o->dec()->radians() ) );
writer->writeEndElement();
writer->writeEndElement();
- if( native && ! KStars::Instance()->observingList()->getTime( o ).isEmpty() ) {
+ if( native && ! ks->observingList()->getTime( o ).isEmpty() ) {
writer->writeStartElement("time");
- writer->writeCDATA( KStars::Instance()->observingList()->getTime( o ) );
+ writer->writeCDATA( ks->observingList()->getTime( o ) );
writer->writeEndElement();
}
writer->writeStartElement( "constellation" );
@@ -247,13 +247,13 @@
if( reader->name() == "name" ) {
QString Name = reader->readElementText();
if( Name != "star" ) {
- o = KStars::Instance()->data()->objectNamed( Name );
- if( ! o ) o = KStars::Instance()->data()->skyComposite()->findStarByGenetiveName( Name );
- if( o ) KStars::Instance()->observingList()->slotAddObject( o, true );
+ o = ks->data()->objectNamed( Name );
+ if( ! o ) o = ks->data()->skyComposite()->findStarByGenetiveName( Name );
+ if( o ) ks->observingList()->slotAddObject( o, true );
}
} else if( reader->name() == "time" ) {
if( o )
- KStars::Instance()->observingList()->setTime( o, QTime::fromString( reader->readElementText(), "h:mm:ss AP" ) );
+ ks->observingList()->setTime( o, QTime::fromString( reader->readElementText(), "h:mm:ss AP" ) );
}
// else if( reader->name() == "datasource" )
// kDebug() << reader->readElementText();
@@ -305,5 +305,5 @@
readUnknownElement();
}
}
- KStars::Instance()->observingList()->setGeoDate( name, province, country, date );
+ ks->observingList()->setGeoDate( name, province, country, date );
}
More information about the Kstars-devel
mailing list