Author: jkupec Date: Fri Sep 12 01:22:27 2008 New Revision: 11022 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11022&view=rev Log: - service probing on refresh enabled - some cleanup Modified: trunk/libzypp/zypp/RepoInfo.h trunk/libzypp/zypp/RepoManager.cc trunk/libzypp/zypp/ServiceInfo.cc trunk/libzypp/zypp/ServiceInfo.h Modified: trunk/libzypp/zypp/RepoInfo.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoInfo.h?rev=11022&r1=11021&r2=11022&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoInfo.h (original) +++ trunk/libzypp/zypp/RepoInfo.h Fri Sep 12 01:22:27 2008 @@ -68,7 +68,7 @@ public: RepoInfo(); - ~RepoInfo(); + virtual ~RepoInfo(); /** * Repository priority for solver. Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=11022&r1=11021&r2=11022&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Fri Sep 12 01:22:27 2008 @@ -1470,22 +1470,26 @@ 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 ) @@ -1504,13 +1508,13 @@ { 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()) Modified: trunk/libzypp/zypp/ServiceInfo.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ServiceInfo.cc?rev=11022&r1=11021&r2=11022&view=diff ============================================================================== --- trunk/libzypp/zypp/ServiceInfo.cc (original) +++ trunk/libzypp/zypp/ServiceInfo.cc Fri Sep 12 01:22:27 2008 @@ -55,9 +55,19 @@ CatalogsToDisable catalogsToDisable; public: - Impl() : repo::RepoInfoBase::Impl() {} + Impl() + : repo::RepoInfoBase::Impl() + , type(repo::ServiceType::NONE_e) + {} + + Impl(const Url & url_) + : repo::RepoInfoBase::Impl() + , url(url_) + , type(repo::ServiceType::NONE_e) + {} - Impl(const Url & url_) : url(url_) {} + ~Impl() + {} void setProbedType( const repo::ServiceType & t ) const { @@ -97,6 +107,9 @@ : 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; } Modified: trunk/libzypp/zypp/ServiceInfo.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ServiceInfo.h?rev=11022&r1=11021&r2=11022&view=diff ============================================================================== --- trunk/libzypp/zypp/ServiceInfo.h (original) +++ trunk/libzypp/zypp/ServiceInfo.h Fri Sep 12 01:22:27 2008 @@ -51,6 +51,8 @@ */ ServiceInfo( const std::string & alias, const Url& url ); + virtual ~ServiceInfo(); + public: /** Represents an empty service. */ static const ServiceInfo noService; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org