22#include "moc_qgsprofilesourceregistry.cpp"
24using namespace Qt::StringLiterals;
33 qDeleteAll( mSources );
44 if ( mSources.contains( profileSource ) )
49 for (
const auto &source : std::as_const( mSources ) )
58 mSources.append( profileSource );
65 const int index = mSources.indexOf( profileSource );
69 delete mSources.takeAt( index );
78 for (
auto it = mSources.begin(); it != mSources.end(); ++it )
80 if ( ( *it )->profileSourceId() == sourceId )
82 const int index = mSources.indexOf( *it );
83 delete mSources.takeAt( index );
95 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)