[Kstars-devel] KDE/kdeedu/kstars/kstars
James Bowlin
bowlin at mindspring.com
Fri Aug 17 02:00:08 CEST 2007
SVN commit 701001 by jbowlin:
Am now displaying progress messages on splash screen when reloading
star data. This also fixed the problem of the splash screen sometimes
being blank. Unfortunately this unleashed a much worse bug where
calling qApp->processEvents() causes the skymap (main window) to turn
entirely light gray (the default background color).
Commented out the paint() and qApp->flush() calls in KStarsSplash
because they no longer seem to be needed.
Removed the KStarsData parameter from KSFileReader::setProgress().
It is no longer needed since KStarsData is now a singleton.
CCMAIL: kstars-devel at kde.org
M +2 -3 ksfilereader.cpp
M +1 -4 ksfilereader.h
M +3 -4 kstarssplash.cpp
M +1 -2 skycomponents/constellationboundarylines.cpp
M +1 -1 skycomponents/deepskycomponent.cpp
M +6 -4 skycomponents/starcomponent.cpp
--- trunk/KDE/kdeedu/kstars/kstars/ksfilereader.cpp #701000:701001
@@ -53,7 +53,7 @@
return true;
}
-void KSFileReader::setProgress( KStarsData* data, QString label,
+void KSFileReader::setProgress( QString label,
unsigned int totalLines,
unsigned int numUpdates,
unsigned int firstNumUpdates)
@@ -66,7 +66,7 @@
m_targetIncrement = m_totalLines / numUpdates;
connect( this, SIGNAL( progressText( const QString & ) ),
- data, SIGNAL( progressText( const QString & ) ) );
+ KStarsData::Instance(), SIGNAL( progressText( const QString & ) ) );
}
@@ -80,7 +80,6 @@
int percent = 1 + (m_curLine * 100) / m_totalLines;
- //kDebug() << m_label.arg( percent ) << endl;
emit progressText( QString("%1 (%2%)").arg( m_label ).arg( percent ) );
qApp->processEvents();
}
--- trunk/KDE/kdeedu/kstars/kstars/ksfilereader.h #701000:701001
@@ -24,7 +24,6 @@
//class QFile;
class QString;
-class KStarsData;
/* @class KSFileReader
* I totally rewrote this because the earlier scheme of reading all the lines of
@@ -110,14 +109,12 @@
/* @short Prepares this instance to emit progress reports on how much
* of the file has been read (in percent).
- * @param data unfortunately we need a pointer to KStarsData in order
- * to send the progress messages.
* @param totalLines the total number of lines in the file
* @param numUpdates the number of progress reports to send
* @param firstNumUpdates set to 100 to get the first report at 1%
* or set to 20 to get the first report at 5% etc.
*/
- void setProgress( KStarsData* data, QString label,
+ void setProgress( QString label,
unsigned int totalLines,
unsigned int numUpdates=10,
unsigned int firstNumUpdates=0);
--- trunk/KDE/kdeedu/kstars/kstars/kstarssplash.cpp #701000:701001
@@ -91,8 +91,7 @@
textCurrentStatus->setObjectName( "label2" );
textCurrentStatus->setPalette( pal );
textCurrentStatus->setAlignment( Qt::AlignHCenter );
- if ( customMessage.isEmpty() )
- topLayout->addWidget( textCurrentStatus );
+ topLayout->addWidget( textCurrentStatus );
setMessage(QString()); // force repaint of widget with no text
}
@@ -107,13 +106,13 @@
void KStarsSplash::setMessage( const QString &s ) {
textCurrentStatus->setText( s );
- repaint(); // repaint splash screen
+ //repaint(); // repaint splash screen -jbb: this seems no longer needed
/**
*Flush all event data. This is needed because events will buffered and
*repaint call will queued in event buffer. With flush all X11 events of
*this application will flushed.
*/
- qApp->flush();
+ //qApp->flush(); -jbb: this seems no longer needed
}
#include "kstarssplash.moc"
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/constellationboundarylines.cpp #701000:701001
@@ -87,8 +87,7 @@
KSFileReader fileReader;
if ( ! fileReader.open( fname ) ) return;
- fileReader.setProgress( data,
- i18n("Loading Consellation Boundaries"), 13124, 10, 100 );
+ fileReader.setProgress( i18n("Loading Consellation Boundaries"), 13124, 10, 100 );
lastRa = lastDec = -1000.0;
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/deepskycomponent.cpp #701000:701001
@@ -62,7 +62,7 @@
KSFileReader fileReader;
if ( ! fileReader.open( "ngcic.dat" ) ) return;
- fileReader.setProgress( data, i18n("Loading NGC/IC objects"), 13444, 5, 100);
+ fileReader.setProgress( i18n("Loading NGC/IC objects"), 13444, 5, 100);
while ( fileReader.hasMoreLines() ) {
QString line, con, ss, name, name2, longname;
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/starcomponent.cpp #701000:701001
@@ -151,6 +151,9 @@
if ( ! hideFaintStars && ( m_FaintMagnitude < maglim ) ) {
if ( ! m_splash ) {
m_splash = new KStarsSplash(0, i18n("Please wait while loading faint stars ...") );
+ QObject::connect( KStarsData::Instance(), SIGNAL( progressText(QString) ),
+ m_splash, SLOT( setMessage(QString) ));
+
m_splash->show();
m_splash->raise();
}
@@ -163,7 +166,6 @@
}
}
-
//adjust maglimit for ZoomLevel
double lgmin = log10(MINZOOM);
double lgmax = log10(MAXZOOM);
@@ -258,9 +260,9 @@
KSFileReader fileReader;
if ( ! fileReader.open( "stars.dat" ) ) return;
- if ( lastFilePos == 0 ) {
- fileReader.setProgress( m_Data, i18n("Loading stars"), 125994, 100 );
- }
+ //if ( lastFilePos == 0 ) {
+ fileReader.setProgress( i18n("Loading stars"), 125994, 100 );
+ //}
if (lastFilePos > 0 ) fileReader.seek( lastFilePos );
More information about the Kstars-devel
mailing list