To all,
For informations, this commit from Patrick into marble from trunk must speed-up digiKam startup to use shared components for all marble instances... Gilles Caulier
---------- Forwarded message ---------- From: Patrick Spendrin <[hidden email]> Date: 2008/11/26 Subject: KDE/kdeedu/marble/src/lib To: [hidden email] Cc: [hidden email] SVN commit 889199 by sengels: reuse some stuff and make marblewidget faster [hidden email] M +21 -8 MarbleModel.cpp --- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #889198:889199 @@ -8,12 +8,14 @@ // Copyright 2006-2007 Torsten Rahn <[hidden email]>" // Copyright 2007 Inge Wallin <[hidden email]>" // Copyright 2008 Jens-Michael Hoffmann <[hidden email]> +// Copyright 2008 Patrick Spendrin <[hidden email]> // #include "MarbleModel.h" #include <cmath> +#include <QtCore/QAtomicInt> #include <QtCore/QDebug> #include <QtCore/QTime> #include <QtCore/QTimer> @@ -79,20 +81,21 @@ void notifyModelChanged(); void geoDataDocumentLoaded( GeoDataDocument& document ); + static QAtomicInt refCounter; MarbleModel *m_parent; MarbleDataFacade *m_dataFacade; // View and paint stuff GeoSceneDocument *m_mapTheme; LayerManager *m_layerManager; - TextureColorizer *m_texcolorizer; + static TextureColorizer *m_texcolorizer; HttpDownloadManager *m_downloadManager; TileLoader *m_tileLoader; AbstractScanlineTextureMapper *m_texmapper; - VectorComposer *m_veccomposer; // FIXME: Make not a pointer. + static VectorComposer *m_veccomposer; // FIXME: Make not a pointer. GridMap *m_gridmap; // Places on the map @@ -118,10 +121,15 @@ FileViewModel *m_fileviewmodel; }; +VectorComposer *MarbleModelPrivate::m_veccomposer = 0; +TextureColorizer *MarbleModelPrivate::m_texcolorizer = 0; +QAtomicInt MarbleModelPrivate::refCounter(0); + MarbleModel::MarbleModel( QObject *parent ) : QObject( parent ), d( new MarbleModelPrivate( this ) ) { + MarbleModelPrivate::refCounter.ref(); d->m_dataFacade = new MarbleDataFacade( this ); d->m_layerManager = new LayerManager( d->m_dataFacade, this ); @@ -143,11 +151,13 @@ // this, SLOT( paintTile(TextureTile*, int, int, int, GeoSceneTexture*, bool) ) ); d->m_texmapper = 0; - d->m_veccomposer = new VectorComposer(); - d->m_gridmap = new GridMap( this ); - d->m_texcolorizer = new TextureColorizer( MarbleDirs::path( "seacolors.leg" ), - MarbleDirs::path( "landcolors.leg" ) ); + + if( MarbleModelPrivate::refCounter == 1 ) { + d->m_veccomposer = new VectorComposer(); + d->m_texcolorizer = new TextureColorizer( MarbleDirs::path( "seacolors.leg" ), + MarbleDirs::path( "landcolors.leg" ) ); + } d->m_placemarkmanager = new PlaceMarkManager(); @@ -206,8 +216,11 @@ delete d->m_tileLoader; // disconnects from downloadManager in dtor delete d->m_downloadManager; - delete d->m_veccomposer; - delete d->m_texcolorizer; + if( MarbleModelPrivate::refCounter == 1 ) { + delete d->m_veccomposer; + delete d->m_texcolorizer; + MarbleModelPrivate::refCounter.deref(); + } delete d->m_gridmap; delete d->m_geometrymodel; delete d->m_placemarkmodel; _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
mercoledì 26 novembre 2008 alle 13:04, Gilles Caulier ha scritto:
> To all, > > For informations, this commit from Patrick into marble from trunk must > speed-up digiKam startup to use shared components for all marble > instances... > > Gilles Caulier > > > > ---------- Forwarded message ---------- > From: Patrick Spendrin <[hidden email]> > Date: 2008/11/26 > Subject: KDE/kdeedu/marble/src/lib > To: [hidden email] > Cc: [hidden email] > > > SVN commit 889199 by sengels: > > reuse some stuff and make marblewidget faster > CCMAIL:[hidden email] <CCMAIL%[hidden email]> > > M +21 -8 MarbleModel.cpp Angelo _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel signature.asc (204 bytes) Download Attachment |
I think this changes are done in private marble widget implementation.
Patrick can confirm... Gilles 2008/11/26 Angelo Naselli <[hidden email]> mercoledì 26 novembre 2008 alle 13:04, Gilles Caulier ha scritto: _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Bugzilla from anaselli@linux.it
Angelo Naselli schrieb:
> mercoledì 26 novembre 2008 alle 13:04, Gilles Caulier ha scritto: >> To all, >> >> For informations, this commit from Patrick into marble from trunk must >> speed-up digiKam startup to use shared components for all marble >> instances... >> >> Gilles Caulier >> >> >> >> ---------- Forwarded message ---------- >> From: Patrick Spendrin <[hidden email]> >> Date: 2008/11/26 >> Subject: KDE/kdeedu/marble/src/lib >> To: [hidden email] >> Cc: [hidden email] >> >> >> SVN commit 889199 by sengels: >> >> reuse some stuff and make marblewidget faster >> CCMAIL:[hidden email] <CCMAIL%[hidden email]> >> >> M +21 -8 MarbleModel.cpp > Does that mean another kde 4.2 backport? or digikam builds anyway without > that change? and they are even bc so others don't have to recompile if they don't want. regards, Patrick > > Angelo > > > ------------------------------------------------------------------------ > > _______________________________________________ > Digikam-devel mailing list > [hidden email] > https://mail.kde.org/mailman/listinfo/digikam-devel -- web: http://windows.kde.org mailing list: [hidden email] irc: #kde-windows (irc.freenode.net) _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
mercoledì 26 novembre 2008 alle 16:55, Patrick Spendrin ha scritto:
> no, these changes are private. > and they are even bc so others don't have to recompile if they don't want. > regards, > Patrick Thanks _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel signature.asc (204 bytes) Download Attachment |
Free forum by Nabble | Edit this page |