SourceDict -> QHash<QString, DataContainer*>

the typedef is still there, but don't use anywhere in the code
This commit is contained in:
Marco Martin 2013-04-04 16:39:48 +02:00
parent 12b5b7639d
commit 5c051f10eb
2 changed files with 5 additions and 46 deletions

View File

@ -269,7 +269,7 @@ void DataEngine::setPollingInterval(uint frequency)
void DataEngine::removeSource(const QString &source)
{
SourceDict::iterator it = d->sources.find(source);
QHash<QString, DataContainer*>::iterator it = d->sources.find(source);
if (it != d->sources.end()) {
DataContainer *s = it.value();
s->d->store();
@ -309,7 +309,7 @@ void DataEngine::setValid(bool valid)
d->valid = valid;
}
DataEngine::SourceDict DataEngine::containerDict() const
QHash<QString, DataContainer*> DataEngine::containerDict() const
{
return d->sources;
}
@ -365,18 +365,6 @@ void DataEngine::forceImmediateUpdateOfAllVisualizations()
}
}
void DataEngine::setDefaultService(const QString &serviceName)
{
d->serviceName = serviceName;
}
Service* DataEngine::createDefaultService(QObject *parent)
{
QVariantList args;
args << QVariant::fromValue<DataEngine*>(this);
return PluginLoader::self()->loadService(d->serviceName, args, parent);
}
Package DataEngine::package() const
{
return d->package ? *d->package : Package();
@ -490,7 +478,7 @@ bool DataEnginePrivate::isUsed() const
DataContainer *DataEnginePrivate::source(const QString &sourceName, bool createWhenMissing)
{
DataEngine::SourceDict::const_iterator it = sources.constFind(sourceName);
QHash<QString, DataContainer*>::const_iterator it = sources.constFind(sourceName);
if (it != sources.constEnd()) {
DataContainer *s = it.value();
return s;
@ -547,7 +535,7 @@ void DataEnginePrivate::connectSource(DataContainer *s, QObject *visualization,
void DataEnginePrivate::sourceDestroyed(QObject *object)
{
DataEngine::SourceDict::iterator it = sources.begin();
QHash<QString, DataContainer*>::iterator it = sources.begin();
while (it != sources.end()) {
if (it.value() == object) {
sources.erase(it);

View File

@ -212,19 +212,6 @@ NoAlignment) const;
**/
Package package() const;
/**
* Initializes and returns a new service from the name that was set
* with setDefaultService. (service name is set internally). Remember to dispose
* of the Service* when you are finished with it (even if a parent is passed)
* A DataEngine* is sent to the created service via the QVariantList arguments.
*
* @see setDefaultService
* @param the parent of the object, if any, for the returned service
* @return the newly created service
* @since 4.5
*/
Q_INVOKABLE Service* createDefaultService(QObject *parent = 0);
/**
* @return a listing of all known DataEngines by name
*
@ -425,7 +412,7 @@ NoAlignment) const;
/**
* @return the list of active DataContainers.
*/
SourceDict containerDict() const;
QHash<QString, DataContainer*> containerDict() const;
/**
* Reimplemented from QObject
@ -437,22 +424,6 @@ NoAlignment) const;
**/
void setIcon(const QString &icon);
/**
* Should be set if there will be 1 main service.
* This saves any users of this DataEngine from having to know the service name to load.
* It is not created until createDefaultService is called.
*
* @code
* DataEngine *engine = dataEngine("foo");
* Service *service = engine->createDefaultService(this);
* @endcode
*
* @see createDefaultService
* @param serviceName the name of the service to load (plugin name)
* @since 4.5
*/
void setDefaultService(const QString &serviceName);
/**
* Sets a source to be stored for easy retrieval
* when the real source of the data (usually a network connection)