[yast-commit] r39210 - in /branches/REFACTORING-10_3/qt/src/pkg: YQPackageSelector.cc YQPkgInstSrcList.cc YQPkgInstSrcList.h YQPkgPatchList.h YQPkgTechnicalDetailsView.cc YQPkgVersionsView.cc YQZypp.h

Author: mlandres Date: Fri Jul 6 13:44:17 2007 New Revision: 39210 URL: http://svn.opensuse.org/viewcvs/yast?rev=39210&view=rev Log: Adapt to refactored libzypp (installation sources replaced by repositories) Modified: branches/REFACTORING-10_3/qt/src/pkg/YQPackageSelector.cc branches/REFACTORING-10_3/qt/src/pkg/YQPkgInstSrcList.cc branches/REFACTORING-10_3/qt/src/pkg/YQPkgInstSrcList.h branches/REFACTORING-10_3/qt/src/pkg/YQPkgPatchList.h branches/REFACTORING-10_3/qt/src/pkg/YQPkgTechnicalDetailsView.cc branches/REFACTORING-10_3/qt/src/pkg/YQPkgVersionsView.cc branches/REFACTORING-10_3/qt/src/pkg/YQZypp.h Modified: branches/REFACTORING-10_3/qt/src/pkg/YQPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/REFACTORING-10_3/qt/src/pkg/YQ... ============================================================================== --- branches/REFACTORING-10_3/qt/src/pkg/YQPackageSelector.cc (original) +++ branches/REFACTORING-10_3/qt/src/pkg/YQPackageSelector.cc Fri Jul 6 13:44:17 2007 @@ -161,7 +161,7 @@ } else if ( _searchFilterView ) { - y2milestone( "No multiple inst sources - falling back to search mode" ); + y2milestone( "No multiple repositories - falling back to search mode" ); _filters->showPage( _searchFilterView ); _searchFilterView->filter(); QTimer::singleShot( 0, _searchFilterView, SLOT( setFocus() ) ); @@ -368,12 +368,12 @@ // - // Inst source view + // Repository view // _instSrcFilterView = new YQPkgInstSrcFilterView( parent ); CHECK_PTR( _instSrcFilterView ); - _filters->addPage( _( "Installation Sources" ), _instSrcFilterView ); + _filters->addPage( _( "Repositories" ), _instSrcFilterView ); // Modified: branches/REFACTORING-10_3/qt/src/pkg/YQPkgInstSrcList.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/REFACTORING-10_3/qt/src/pkg/YQ... ============================================================================== --- branches/REFACTORING-10_3/qt/src/pkg/YQPkgInstSrcList.cc (original) +++ branches/REFACTORING-10_3/qt/src/pkg/YQPkgInstSrcList.cc Fri Jul 6 13:44:17 2007 @@ -25,7 +25,7 @@ #include "YQi18n.h" #include "utf8.h" #include "YQPkgInstSrcList.h" -#include <zypp/SourceManager.h> +#include <zypp/RepoManager.h> #include <algorithm> using std::list; @@ -37,7 +37,7 @@ YQPkgInstSrcList::YQPkgInstSrcList( QWidget * parent ) : QY2ListView( parent ) { - y2debug( "Creating inst source list" ); + y2debug( "Creating repository list" ); _nameCol = -1; _urlCol = -1; @@ -57,7 +57,7 @@ fillList(); selectSomething(); - y2debug( "Creating inst source list done" ); + y2debug( "Creating repository list done" ); } @@ -71,43 +71,23 @@ YQPkgInstSrcList::fillList() { clear(); - y2debug( "Filling inst source list" ); + y2debug( "Filling repository list" ); - zypp::SourceManager_Ptr sourceManager = zypp::SourceManager::sourceManager(); - list<zypp::SourceManager::SourceId> sources = sourceManager->allSources(); - - for ( list<zypp::SourceManager::SourceId>::const_iterator it = sources.begin(); - it != sources.end(); + for ( ZyppRepositoryIterator it = ZyppRepositoriesBegin(); + it != ZyppRepositoriesEnd(); ++it ) { - zypp::Source_Ref src = sourceManager->findSource( *it ); - - if ( src && src.enabled() ) - addInstSrc( src ); + addInstSrc( *it ); } - y2debug( "Inst source list filled" ); + y2debug( "Inst repository filled" ); } int YQPkgInstSrcList::countEnabledSources() { - int count = 0; - zypp::SourceManager_Ptr sourceManager = zypp::SourceManager::sourceManager(); - list<zypp::SourceManager::SourceId> sources = sourceManager->allSources(); - - for ( list<zypp::SourceManager::SourceId>::const_iterator it = sources.begin(); - it != sources.end(); - ++it ) - { - zypp::Source_Ref src = sourceManager->findSource( *it ); - - if ( src && src.enabled() ) - ++count; - } - - return count; + return zyppPool().knownRepositoriesSize(); } @@ -124,13 +104,13 @@ { emit filterStart(); - y2milestone( "Collecting packages on selected installation sources..." ); + y2milestone( "Collecting packages in selected repositories..." ); QTime stopWatch; stopWatch.start(); // - // Collect all packages on this inst source + // Collect all packages on this repository // set<ZyppSel> exactMatches; @@ -153,7 +133,7 @@ ++sel_it ) { if ( (*sel_it)->candidateObj() && - (*sel_it)->candidateObj()->source() == currentSrc ) + (*sel_it)->candidateObj()->repository() == currentSrc ) { exactMatches.insert( *sel_it ); } @@ -163,7 +143,7 @@ while ( pkg_it != (*sel_it)->availableEnd() ) { - if ( (*pkg_it)->source() == currentSrc ) + if ( (*pkg_it)->repository() == currentSrc ) nearMatches.insert( *sel_it ); ++pkg_it; @@ -177,7 +157,7 @@ item = item->nextSibling(); } - + // // Send all exact matches to the list // (emit a filterMatch signal for each one) @@ -257,7 +237,12 @@ if ( urlCol() >= 0 ) { - setText( urlCol(), src.url().asString().c_str() ); + zypp::Url srcUrl; + if ( ! src.info().baseUrlsEmpty() ) + { + srcUrl = *src.info().baseUrlsBegin(); + } + setText( urlCol(), srcUrl.asString().c_str() ); } } @@ -277,7 +262,7 @@ zypp::ResStore::iterator it = zyppSrc.resolvables().begin(); // - // Find the first product on this inst src + // Find the first product on this repository // while ( it != zyppSrc.resolvables().end() && ! product ) @@ -287,15 +272,15 @@ } // - // Check if there is another product on this inst src + // Check if there is another product on this repository // while ( it != zyppSrc.resolvables().end() ) { if ( zypp::dynamic_pointer_cast<zypp::Product>( *it ) ) { - y2milestone( "Multiple products on installation source %s", - zyppSrc.alias().c_str() ); + y2milestone( "Multiple products in repository %s", + zyppSrc.info().alias().c_str() ); ZyppProduct null; return null; } @@ -304,8 +289,8 @@ } if ( ! product ) - y2milestone( "No product on installation source %s", - zyppSrc.alias().c_str() ); + y2milestone( "No product in repository %s", + zyppSrc.info().alias().c_str() ); return product; } Modified: branches/REFACTORING-10_3/qt/src/pkg/YQPkgInstSrcList.h URL: http://svn.opensuse.org/viewcvs/yast/branches/REFACTORING-10_3/qt/src/pkg/YQ... ============================================================================== --- branches/REFACTORING-10_3/qt/src/pkg/YQPkgInstSrcList.h (original) +++ branches/REFACTORING-10_3/qt/src/pkg/YQPkgInstSrcList.h Fri Jul 6 13:44:17 2007 @@ -24,13 +24,13 @@ #include "YQZypp.h" #include "QY2ListView.h" -#include <zypp/Source.h> +#include <zypp/Repository.h> #include <zypp/Product.h> class YQPkgInstSrcListItem; -typedef zypp::Source_Ref ZyppSrc; +typedef zypp::Repository ZyppSrc; /** @@ -78,8 +78,8 @@ * Add an inst source to the list. **/ void addInstSrc( ZyppSrc src ); - - + + public: // Column numbers @@ -87,7 +87,7 @@ int nameCol() const { return _nameCol; } int urlCol() const { return _urlCol; } - + /** * Returns the currently selected item or 0 if there is none. **/ @@ -138,7 +138,7 @@ int _nameCol; int _urlCol; - + }; Modified: branches/REFACTORING-10_3/qt/src/pkg/YQPkgPatchList.h URL: http://svn.opensuse.org/viewcvs/yast/branches/REFACTORING-10_3/qt/src/pkg/YQ... ============================================================================== --- branches/REFACTORING-10_3/qt/src/pkg/YQPkgPatchList.h (original) +++ branches/REFACTORING-10_3/qt/src/pkg/YQPkgPatchList.h Fri Jul 6 13:44:17 2007 @@ -65,7 +65,7 @@ **/ virtual ~YQPkgPatchList(); - + enum FilterCriteria { RelevantPatches, // needed + broken @@ -291,7 +291,7 @@ **/ virtual void applyChanges(); - + // Data members YQPkgPatchList * _patchList; Modified: branches/REFACTORING-10_3/qt/src/pkg/YQPkgTechnicalDetailsView.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/REFACTORING-10_3/qt/src/pkg/YQ... ============================================================================== --- branches/REFACTORING-10_3/qt/src/pkg/YQPkgTechnicalDetailsView.cc (original) +++ branches/REFACTORING-10_3/qt/src/pkg/YQPkgTechnicalDetailsView.cc Fri Jul 6 13:44:17 2007 @@ -133,7 +133,7 @@ row( hcell( _( "Package Group:" ) ) + cell( formatRpmGroup( pkg ) ) ) + row( hcell( _( "License:" ) ) + cell( pkg->license() ) ) + row( hcell( _( "Installed Size:" ) ) + cell( pkg->size().asString() ) ) + - row( hcell( _( "Archive Size:" ) ) + cell( pkg->archivesize().asString() ) ) + + row( hcell( _( "Download Size:" ) ) + cell( pkg->downloadSize().asString() ) ) + row( hcell( _( "Distribution:" ) ) + cell( pkg->distribution() ) ) + row( hcell( _( "Vendor:" ) ) + cell( pkg->vendor() ) ) + row( hcell( _( "Packager:" ) ) + cell( pkg->packager() ) ) + @@ -144,7 +144,7 @@ #ifdef FIXME_missing_in_zypp row( hcell( _( "Source RPM:" ) ) + cell( pkg->sourceloc() ) ) + #endif - row( hcell( _( "Media No.:" ) ) + cell( pkg->sourceMediaNr() ) ) + + row( hcell( _( "Media No.:" ) ) + cell( pkg->mediaNr() ) ) + row( hcell( _( "Authors:" ) ) + authorsListCell( pkg ) ) ); @@ -173,7 +173,7 @@ row( hcell( _( "Package Group:" ) ) + cell( formatRpmGroup( p1 ) ) + cell( formatRpmGroup( p2 ) ) ) + row( hcell( _( "License:" ) ) + cell( p1->license() ) + cell( p2->license() ) ) + row( hcell( _( "Installed Size:" ) ) + cell( p1->size().asString() ) + cell( p2->size().asString() ) ) + - row( hcell( _( "Archive Size:" ) ) + cell( p1->archivesize().asString() ) + cell( p2->archivesize().asString() ) ) + + row( hcell( _( "Download Size:" ) ) + cell( p1->downloadSize().asString() ) + cell( p2->downloadSize().asString() ) ) + row( hcell( _( "Distribution:" ) ) + cell( p1->distribution() ) + cell( p2->distribution() ) ) + row( hcell( _( "Vendor:" ) ) + cell( p1->vendor() ) + cell( p2->vendor() ) ) + row( hcell( _( "Packager:" ) ) + cell( p1->packager() ) + cell( p2->packager() ) ) + @@ -184,7 +184,7 @@ #ifdef FIXME_missing_in_zypp row( hcell( _( "Source RPM:" ) ) + cell( p1->sourceloc() ) + cell( p2->sourceloc() ) ) + #endif - row( hcell( _( "Media No.:" ) ) + cell( p1->sourceMediaNr() ) + cell( p2->sourceMediaNr() ) ) + + row( hcell( _( "Media No.:" ) ) + cell( p1->mediaNr() ) + cell( p2->mediaNr() ) ) + row( hcell( _( "Authors:" ) ) + authorsListCell( p1 ) + authorsListCell( p2 ) ) ); Modified: branches/REFACTORING-10_3/qt/src/pkg/YQPkgVersionsView.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/REFACTORING-10_3/qt/src/pkg/YQ... ============================================================================== --- branches/REFACTORING-10_3/qt/src/pkg/YQPkgVersionsView.cc (original) +++ branches/REFACTORING-10_3/qt/src/pkg/YQPkgVersionsView.cc Fri Jul 6 13:44:17 2007 @@ -21,7 +21,7 @@ #define y2log_component "qt-pkg" #include <YQZypp.h> -#include <zypp/Source.h> +#include <zypp/Repository.h> #include <ycp/y2log.h> #include <qtabwidget.h> #include <qregexp.h> @@ -51,11 +51,11 @@ _summaryCol = -42; int numCol = 0; - addColumn( _( "Version" ) ); _versionCol = numCol++; - addColumn( _( "Arch." ) ); _archCol = numCol++; - addColumn( _( "Product" ) ); _productCol = numCol++; - addColumn( _( "Installation Source" ) ); _instSrcCol = numCol++; - addColumn( _( "URL" ) ); _urlCol = numCol++; + addColumn( _( "Version" ) ); _versionCol = numCol++; + addColumn( _( "Arch." ) ); _archCol = numCol++; + addColumn( _( "Product" ) ); _productCol = numCol++; + addColumn( _( "Repository" ) ); _instSrcCol = numCol++; + addColumn( _( "URL" ) ); _urlCol = numCol++; _statusCol = _productCol; _nameCol = _versionCol; @@ -248,17 +248,22 @@ if ( versionCol() >= 0 ) setText( versionCol(), zyppObj->edition().asString().c_str() ); if ( archCol() >= 0 ) setText( archCol(), zyppObj->arch().asString().c_str() ); - if ( instSrcCol() >= 0 ) setText( instSrcCol(), zyppObj->source().alias().c_str() ); + if ( instSrcCol() >= 0 ) setText( instSrcCol(), zyppObj->repository().info().alias().c_str() ); if ( productCol() >= 0 ) { - ZyppProduct product = YQPkgInstSrcListItem::singleProduct( zyppObj->source() ); + ZyppProduct product = YQPkgInstSrcListItem::singleProduct( zyppObj->repository() ); if ( product ) setText( productCol(), product->summary() ); } if ( urlCol() >= 0 ) { - setText( urlCol(), zyppObj->source().url().asString().c_str() ); + zypp::Url srcUrl; + if ( ! zyppObj->repository().info().baseUrlsEmpty() ) + { + srcUrl = *zyppObj->repository().info().baseUrlsBegin(); + } + setText( urlCol(), srcUrl.asString().c_str() ); } if ( _selectable->hasInstalledObj() ) Modified: branches/REFACTORING-10_3/qt/src/pkg/YQZypp.h URL: http://svn.opensuse.org/viewcvs/yast/branches/REFACTORING-10_3/qt/src/pkg/YQ... ============================================================================== --- branches/REFACTORING-10_3/qt/src/pkg/YQZypp.h (original) +++ branches/REFACTORING-10_3/qt/src/pkg/YQZypp.h Fri Jul 6 13:44:17 2007 @@ -35,16 +35,16 @@ #include <zypp/ResPoolProxy.h> -using zypp::ui::S_Protected; -using zypp::ui::S_Taboo; -using zypp::ui::S_Del; -using zypp::ui::S_Update; -using zypp::ui::S_Install; -using zypp::ui::S_AutoDel; -using zypp::ui::S_AutoUpdate; -using zypp::ui::S_AutoInstall; -using zypp::ui::S_KeepInstalled; -using zypp::ui::S_NoInst; +using zypp::ui::S_Protected; +using zypp::ui::S_Taboo; +using zypp::ui::S_Del; +using zypp::ui::S_Update; +using zypp::ui::S_Install; +using zypp::ui::S_AutoDel; +using zypp::ui::S_AutoUpdate; +using zypp::ui::S_AutoInstall; +using zypp::ui::S_KeepInstalled; +using zypp::ui::S_NoInst; // @@ -63,7 +63,7 @@ typedef zypp::ResPoolProxy ZyppPool; typedef zypp::ResPoolProxy::const_iterator ZyppPoolIterator; - +typedef zypp::ResPoolProxy::repository_iterator ZyppRepositoryIterator; inline ZyppPool zyppPool() { return zypp::getZYpp()->poolProxy(); } @@ -88,6 +88,8 @@ inline ZyppPoolIterator zyppProductsBegin() { return zyppBegin<zypp::Product>(); } inline ZyppPoolIterator zyppProductsEnd() { return zyppEnd<zypp::Product>(); } +inline ZyppRepositoryIterator ZyppRepositoriesBegin() { return zyppPool().knownRepositoriesBegin(); } +inline ZyppRepositoryIterator ZyppRepositoriesEnd() { return zyppPool().knownRepositoriesEnd(); } inline ZyppPkg tryCastToZyppPkg( ZyppObj zyppObj ) { -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mlandres@svn.opensuse.org