[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Fri Sep 11 22:39:26 CEST 2009
SVN commit 1022479 by tgridel:
FileLoader: finish loading properly
M +19 -13 FileLoader.cpp
M +1 -1 FileLoader.h
M +1 -5 FileManager.cpp
M +0 -1 FileManager.h
M +0 -2 MarbleModel.cpp
--- trunk/KDE/kdeedu/marble/src/lib/FileLoader.cpp #1022478:1022479
@@ -91,7 +91,8 @@
QDateTime sourceLastModified;
QDateTime cacheLastModified;
- if ( QFile::exists( defaultsrcname ) ) {
+ if ( QFile::exists( defaultsrcname ) )
+ {
sourceLastModified = QFileInfo( defaultsrcname ).lastModified();
cacheLastModified = QFileInfo( defaultcachename ).lastModified();
@@ -101,31 +102,36 @@
bool loadok = false;
- if ( !cacheoutdated ) {
+ if ( !cacheoutdated )
+ {
loadok = loadFile( defaultcachename );
if ( loadok )
emit newGeoDataDocumentAdded( m_document );
}
qDebug() << "Loading ended" << loadok;
- if ( loadok ) {
+ if ( loadok )
+ {
qDebug() << "placemarksLoaded";
- return;
}
}
-
-
- if ( QFile::exists( defaultsrcname ) ) {
- // Read the KML file.
- importKml( defaultsrcname );
+ else
+ {
+ if ( QFile::exists( defaultsrcname ) )
+ {
+ // Read the KML file.
+ importKml( defaultsrcname );
+ }
+ else
+ {
+ qDebug() << "No Default Placemark Source File for " << m_filepath;
+ }
}
- else {
- qDebug() << "No Default Placemark Source File for " << m_filepath;
- emit fileLoaderFailed( this );
- }
} else {
// Read the KML Data
importKmlFromData();
}
+
+ emit loaderFinished( this );
}
const quint32 MarbleMagicNumber = 0x31415926;
--- trunk/KDE/kdeedu/marble/src/lib/FileLoader.h #1022478:1022479
@@ -30,7 +30,7 @@
QString path() const;
Q_SIGNALS:
- void fileLoaderFailed( FileLoader* );
+ void loaderFinished( FileLoader* );
void newGeoDataDocumentAdded( GeoDataDocument* );
private:
void importKml( const QString& filename );
--- trunk/KDE/kdeedu/marble/src/lib/FileManager.cpp #1022478:1022479
@@ -109,7 +109,7 @@
void FileManager::appendLoader( FileLoader *loader )
{
- connect ( loader, SIGNAL( fileLoaderFailed( FileLoader* ) ),
+ connect ( loader, SIGNAL( loaderFinished( FileLoader* ) ),
this, SLOT( cleanupLoader( FileLoader* ) ) );
connect ( loader, SIGNAL( newGeoDataDocumentAdded( GeoDataDocument* ) ),
@@ -200,10 +200,6 @@
// do not set this file if it only contains points
if( doc->isVisible() && d->m_datafacade->geometryModel() )
d->m_datafacade->geometryModel()->setGeoDataRoot( doc );
-
- if( d->m_loaderList.isEmpty() ) {
- emit finalize();
- }
}
void FileManager::cleanupLoader( FileLoader* loader )
--- trunk/KDE/kdeedu/marble/src/lib/FileManager.h #1022478:1022479
@@ -90,7 +90,6 @@
Q_SIGNALS:
void fileAdded( int index );
void fileRemoved( int index );
- void finalize();
private Q_SLOTS:
void addGeoDataDocument( GeoDataDocument *document );
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #1022478:1022479
@@ -184,8 +184,6 @@
d->m_placemarkselectionmodel = new QItemSelectionModel( d->m_popSortModel );
d->m_placemarkLayout = new PlacemarkLayout( this );
- connect( d->m_fileManager, SIGNAL( finalize() ),
- d->m_placemarkLayout, SLOT( requestStyleReset() ) );
connect( d->m_placemarkselectionmodel, SIGNAL( selectionChanged( QItemSelection,
QItemSelection) ),
d->m_placemarkLayout, SLOT( requestStyleReset() ) );
More information about the Marble-commits
mailing list