20#include "moc_qgsprofilesourceregistry.cpp"
29 qDeleteAll( mSources );
40 if ( mSources.contains( profileSource ) )
45 for (
const auto &source : std::as_const( mSources ) )
54 mSources.append( profileSource );
61 const int index = mSources.indexOf( profileSource );
65 delete mSources.takeAt( index );
74 for (
auto it = mSources.begin(); it != mSources.end(); ++it )
76 if ( ( *it )->profileSourceId() == sourceId )
78 const int index = mSources.indexOf( *it );
79 delete mSources.takeAt( index );
91 if ( source->profileSourceId() == sourceId )
Interface for classes which can generate elevation profiles.
virtual QString profileSourceId() const
Returns a unique identifier for this profile source.
virtual QString profileSourceName() const
Returns a name for displaying this profile source in the elevation profile layer tree.
QgsAbstractProfileSource * findSourceById(const QString &sourceId) const
Finds a registered profile source by id.
void profileSourceUnregistered(const QString &sourceId)
Signal emitted once a profile source is unregistered.
~QgsProfileSourceRegistry() override
Q_DECL_DEPRECATED bool unregisterProfileSource(QgsAbstractProfileSource *source)
Unregisters a profile source and destroys its instance.
bool registerProfileSource(QgsAbstractProfileSource *source)
Registers a profile source and takes ownership of it.
QList< QgsAbstractProfileSource * > profileSources() const
Returns a list of registered profile sources.
QgsProfileSourceRegistry()
Constructor - creates a registry of profile sources.
void profileSourceRegistered(const QString &sourceId, const QString &sourceName)
Signal emitted once a profile source is registered.
#define QgsDebugError(str)