void RepoManager::refreshServices()
{
- // cannot user for_, because it uses const version
- for (ServiceConstIterator it = _pimpl->services.begin();
- it != _pimpl->services.end(); ++it)
+ // copy the set of services since refreshService
+ // can eventually invalidate the iterator
+ ServiceSet services;
+ services.insert(serviceBegin(), serviceEnd());
+ for_(it, services.begin(), services.end())
{
if ( !it->enabled() )
continue;
- MIL << "refresh: " << it->alias() << " with url: "<< it->url().asString() << endl;
refreshService(*it);
}
}
void RepoManager::refreshService( const ServiceInfo & service )
{
+ MIL << "going to refresh service '" << service.alias()
+ << "', url: "<< service.url().asString() << endl;
+
//! \todo add callbacks for apps (start, end, repo removed, repo added, repo changed)
-/*
+
repo::ServiceType type = service.type();
// if the type is unknown, try probing.
if ( type == repo::ServiceType::NONE )
{
ServiceInfo modifiedservice = service;
modifiedservice.setType(type);
- modifyService(service.alias(), modifiedservice); // FIXME this causes a segfault, whe the same code from repos doesn't?
+ modifyService(service.alias(), modifiedservice);
break;
}
}
}
}
-*/
+
// download the repo index file
media::MediaManager mediamanager;
//if (service.url().empty())
CatalogsToDisable catalogsToDisable;
public:
- Impl() : repo::RepoInfoBase::Impl() {}
-
- Impl(const Url & url_) : url(url_) {}
+ Impl()
+ : repo::RepoInfoBase::Impl()
+ , type(repo::ServiceType::NONE_e)
+ {}
+
+ Impl(const Url & url_)
+ : repo::RepoInfoBase::Impl()
+ , url(url_)
+ , type(repo::ServiceType::NONE_e)
+ {}
+
+ ~Impl()
+ {}
void setProbedType( const repo::ServiceType & t ) const
{
: repo::RepoInfoBase(alias), _pimpl( new Impl(url) )
{}
+ ServiceInfo::~ServiceInfo()
+ {}
+
Url ServiceInfo::url() const { return _pimpl->url; }
void ServiceInfo::setUrl( const Url& url ) { _pimpl->url = url; }