Mailinglist Archive: yast-commit (195 mails)

< Previous Next >
[yast-commit] r63654 - in /branches/tmp/dmacvicar/zc10/qt/src: ./ include/
Author: dmacvicar
Date: Wed Mar 23 17:01:11 2011
New Revision: 63654

URL: http://svn.opensuse.org/viewcvs/yast?rev=63654&view=rev
Log:
Port to new ZYpp API. Not done yet

Added:
branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoFilterView.cc
branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoFilterView.lo
branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoList.cc
branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoList.lo
branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgRepoFilterView.h
branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgRepoList.h
Removed:
branches/tmp/dmacvicar/zc10/qt/src/YQPkgInstSrcFilterView.cc
branches/tmp/dmacvicar/zc10/qt/src/YQPkgInstSrcList.cc
branches/tmp/dmacvicar/zc10/qt/src/YQPkgSelList.cc
branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgInstSrcFilterView.h
branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgInstSrcList.h
branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgSelList.h
Modified:
branches/tmp/dmacvicar/zc10/qt/src/Makefile.am
branches/tmp/dmacvicar/zc10/qt/src/YQPackageSelector.cc
branches/tmp/dmacvicar/zc10/qt/src/YQPackageSelectorBase.cc
branches/tmp/dmacvicar/zc10/qt/src/YQPatternSelector.cc
branches/tmp/dmacvicar/zc10/qt/src/YQPkgConflictDialog.cc
branches/tmp/dmacvicar/zc10/qt/src/YQPkgDependenciesView.cc
branches/tmp/dmacvicar/zc10/qt/src/YQPkgFileListView.cc
branches/tmp/dmacvicar/zc10/qt/src/YQPkgLangList.cc
branches/tmp/dmacvicar/zc10/qt/src/include/YQPackageSelector.h
branches/tmp/dmacvicar/zc10/qt/src/include/YQPatternSelector.h
branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgDependenciesView.h
branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgLangList.h
branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgSearchFilterView.h
branches/tmp/dmacvicar/zc10/qt/src/include/YQZypp.h

Modified: branches/tmp/dmacvicar/zc10/qt/src/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/Makefile.am?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/Makefile.am (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/Makefile.am Wed Mar 23 17:01:11 2011
@@ -90,8 +90,8 @@
YQPkgDiskUsageWarningDialog.cc \
YQPkgFileListView.cc \
YQPkgGenericDetailsView.cc \
- YQPkgInstSrcFilterView.cc \
- YQPkgInstSrcList.cc \
+ YQPkgRepoFilterView.cc \
+ YQPkgRepoList.cc \
YQPkgLangList.cc \
YQPkgList.cc \
YQPkgObjList.cc \
@@ -103,7 +103,6 @@
YQPkgRpmGroupTagsFilterView.cc \
YQPkgSearchFilterView.cc \
YQPkgSelDescriptionView.cc \
- YQPkgSelList.cc \
YQPkgSelMapper.cc \
YQPkgStatusFilterView.cc \
YQPkgTechnicalDetailsView.cc \
@@ -191,8 +190,8 @@
YQPkgDiskUsageWarningDialog.moc \
YQPkgFileListView.moc \
YQPkgGenericDetailsView.moc \
- YQPkgInstSrcFilterView.moc \
- YQPkgInstSrcList.moc \
+ YQPkgRepoFilterView.moc \
+ YQPkgRepoList.moc \
YQPkgLangList.moc \
YQPkgList.moc \
YQPkgObjList.moc \
@@ -205,7 +204,6 @@
YQPkgRpmGroupTagsFilterView.moc \
YQPkgSearchFilterView.moc \
YQPkgSelDescriptionView.moc \
- YQPkgSelList.moc \
YQPkgStatusFilterView.moc \
YQPkgTechnicalDetailsView.moc \
YQPkgTextDialog.moc \
@@ -279,8 +277,8 @@
YQPkgDiskUsageWarningDialog.o YQPkgDiskUsageWarningDialog.lo:
YQPkgDiskUsageWarningDialog.moc
YQPkgFileListView.o YQPkgFileListView.lo:
YQPkgFileListView.moc
YQPkgGenericDetailsView.o YQPkgGenericDetailsView.lo:
YQPkgGenericDetailsView.moc
-YQPkgInstSrcFilterView.o YQPkgInstSrcFilterView.lo:
YQPkgInstSrcFilterView.moc
-YQPkgInstSrcList.o YQPkgInstSrcList.lo:
YQPkgInstSrcList.moc
+YQPkgRepoFilterView.o YQPkgRepoFilterView.lo: YQPkgRepoFilterView.moc
+YQPkgRepoList.o YQPkgRepoList.lo:
YQPkgRepoList.moc
YQPkgLangList.o YQPkgLangList.lo:
YQPkgLangList.moc
YQPkgList.o YQPkgList.lo: YQPkgList.moc
YQPkgObjList.o YQPkgObjList.lo:
YQPkgObjList.moc
@@ -292,7 +290,6 @@
YQPkgRpmGroupTagsFilterView.o YQPkgRpmGroupTagsFilterView.lo:
YQPkgRpmGroupTagsFilterView.moc
YQPkgSearchFilterView.o YQPkgSearchFilterView.lo:
YQPkgSearchFilterView.moc
YQPkgSelDescriptionView.o YQPkgSelDescriptionView.lo:
YQPkgSelDescriptionView.moc
-YQPkgSelList.o YQPkgSelList.lo:
YQPkgSelList.moc
YQPkgStatusFilterView.o YQPkgStatusFilterView.lo:
YQPkgStatusFilterView.moc
YQPkgTechnicalDetailsView.o YQPkgTechnicalDetailsView.lo:
YQPkgTechnicalDetailsView.moc
YQPkgTextDialog.o YQPkgTextDialog.lo:
YQPkgTextDialog.moc
@@ -364,8 +361,8 @@
YQPkgDiskUsageWarningDialog.moc: include/YQPkgDiskUsageWarningDialog.h
YQPkgFileListView.moc: include/YQPkgFileListView.h
YQPkgGenericDetailsView.moc: include/YQPkgGenericDetailsView.h
-YQPkgInstSrcFilterView.moc: include/YQPkgInstSrcFilterView.h
-YQPkgInstSrcList.moc: include/YQPkgInstSrcList.h
+YQPkgRepoFilterView.moc: include/YQPkgRepoFilterView.h
+YQPkgRepoList.moc: include/YQPkgRepoList.h
YQPkgLangList.moc: include/YQPkgLangList.h
YQPkgList.moc: include/YQPkgList.h
YQPkgObjList.moc: include/YQPkgObjList.h
@@ -377,7 +374,6 @@
YQPkgRpmGroupTagsFilterView.moc: include/YQPkgRpmGroupTagsFilterView.h
YQPkgSearchFilterView.moc: include/YQPkgSearchFilterView.h
YQPkgSelDescriptionView.moc: include/YQPkgSelDescriptionView.h
-YQPkgSelList.moc: include/YQPkgSelList.h
YQPkgStatusFilterView.moc: include/YQPkgStatusFilterView.h
YQPkgTechnicalDetailsView.moc: include/YQPkgTechnicalDetailsView.h
YQPkgTextDialog.moc: include/YQPkgTextDialog.h

Modified: branches/tmp/dmacvicar/zc10/qt/src/YQPackageSelector.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPackageSelector.cc?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPackageSelector.cc (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPackageSelector.cc Wed Mar 23 17:01:11
2011
@@ -60,8 +60,8 @@
#include "YQPkgDiskUsageList.h"
#include "YQPkgDiskUsageWarningDialog.h"
#include "YQPkgFileListView.h"
-#include "YQPkgInstSrcFilterView.h"
-#include "YQPkgInstSrcList.h"
+#include "YQPkgRepoFilterView.h"
+#include "YQPkgRepoList.h"
#include "YQPkgLangList.h"
#include "YQPkgList.h"
#include "YQPkgPatchFilterView.h"
@@ -70,7 +70,6 @@
#include "YQPkgProductDialog.h"
#include "YQPkgRpmGroupTagsFilterView.h"
#include "YQPkgSearchFilterView.h"
-#include "YQPkgSelList.h"
#include "YQPkgStatusFilterView.h"
#include "YQPkgTechnicalDetailsView.h"
#include "YQPkgTextDialog.h"
@@ -118,7 +117,6 @@
_pkgVersionsView = 0;
_rpmGroupTagsFilterView = 0;
_searchFilterView = 0;
- _selList = 0;
_statusFilterView = 0;
_updateProblemFilterView = 0;
_patchFilterView = 0;
@@ -152,7 +150,7 @@
}
else if ( _instSrcFilterView && _instSourcesMode )
{
- if ( YQPkgInstSrcList::countEnabledSources() > 1 )
+ if ( YQPkgRepoList::countEnabledRepositories() > 1 )
{
_filters->showPage( _instSrcFilterView );
_instSrcFilterView->filter();
@@ -187,12 +185,6 @@
_filters->showPage( _patternList );
_patternList->filter();
}
- else if ( _selList )
- {
- _filters->showPage( _selList );
- _selList->filter();
- }
-

if ( _diskUsageList )
_diskUsageList->updateDiskUsage();
@@ -307,29 +299,6 @@
_patternList, SLOT ( updateItemStates()
) );
}

-
- //
- // Selections view
- //
-
- if ( ! zyppPool().empty<zypp::Selection>() || _testMode )
- {
-
- _selList = new YQPkgSelList( parent, true );
- CHECK_PTR( _selList );
- _filters->addPage( _( "Selections" ), _selList );
-
- connect( _selList, SIGNAL( statusChanged()
),
- this, SLOT ( autoResolveDependencies()
) );
-
- connect( _pkgConflictDialog, SIGNAL( updatePackages()
),
- _selList, SLOT ( updateItemStates()
) );
-
- connect( this, SIGNAL( refresh()
),
- _selList, SLOT ( updateItemStates()
) );
- }
-
-
//
// RPM group tags view
//
@@ -363,7 +332,7 @@
// Inst source view
//

- _instSrcFilterView = new YQPkgInstSrcFilterView( parent );
+ _instSrcFilterView = new YQPkgRepoFilterView( parent );
CHECK_PTR( _instSrcFilterView );
_filters->addPage( _( "Installation Sources" ), _instSrcFilterView );

@@ -565,7 +534,7 @@
_autoDependenciesCheckBox->setChecked( true );
else
_autoDependenciesCheckBox->setChecked( AUTO_CHECK_DEPENDENCIES_DEFAULT
);
-
+

addHStretch( button_box );

@@ -811,7 +780,6 @@

connectFilter( _updateProblemFilterView, _pkgList, false );
connectFilter( _patternList, _pkgList );
- connectFilter( _selList, _pkgList );
connectFilter( _instSrcFilterView, _pkgList, false );
connectFilter( _rpmGroupTagsFilterView, _pkgList, false );
connectFilter( _langList, _pkgList );
@@ -858,12 +826,6 @@
_patternList, SLOT ( updateItemStates() ) );
}

- if ( _selList )
- {
- connect( _pkgConflictDialog, SIGNAL( updatePackages() ),
- _selList, SLOT ( updateItemStates() ) );
- }
-
if ( _diskUsageList )
{
connect( _pkgConflictDialog, SIGNAL( updatePackages() ),
@@ -1252,7 +1214,7 @@
}

if ( oldStatus != newStatus )
- selectable->set_status( newStatus );
+ selectable->setStatus( newStatus );
}


@@ -1367,7 +1329,7 @@

if ( ! subPkg->installedObj() )
{
- subPkg->set_status( S_Install );
+ subPkg->setStatus( S_Install );
y2milestone( "Installing subpackage %s", (const char *)
subPkgName );
}
break;
@@ -1380,12 +1342,12 @@

if ( ! subPkg->installedObj() )
{
- subPkg->set_status( S_Install );
+ subPkg->setStatus( S_Install );
y2milestone( "Installing subpackage %s", (const char *)
subPkgName );
}
else
{
- subPkg->set_status( S_Update );
+ subPkg->setStatus( S_Update );
y2milestone( "Updating subpackage %s", (const char *)
subPkgName );
}
break;

Modified: branches/tmp/dmacvicar/zc10/qt/src/YQPackageSelectorBase.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPackageSelectorBase.cc?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPackageSelectorBase.cc (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPackageSelectorBase.cc Wed Mar 23
17:01:11 2011
@@ -81,8 +81,6 @@

zyppPool().saveState<zypp::Package >();
zyppPool().saveState<zypp::Pattern >();
- zyppPool().saveState<zypp::Selection>();
- zyppPool().saveState<zypp::Language >();
zyppPool().saveState<zypp::Patch >();


@@ -138,7 +136,7 @@
YQUI::ui()->busyCursor();
int result = _pkgConflictDialog->verifySystem();
YQUI::ui()->normalCursor();
-
+
if ( result == QDialog::Accepted )
{
QMessageBox::information( this, "",
@@ -209,8 +207,6 @@
bool changes =
zyppPool().diffState<zypp::Package >() ||
zyppPool().diffState<zypp::Pattern >() ||
- zyppPool().diffState<zypp::Selection>() ||
- zyppPool().diffState<zypp::Language >() ||
zyppPool().diffState<zypp::Patch >();

if ( changes )
@@ -221,12 +217,6 @@
if ( zyppPool().diffState<zypp::Pattern>() )
y2milestone( "diffState() reports changed patterns" );

- if ( zyppPool().diffState<zypp::Selection>() )
- y2milestone( "diffState() reports changed selections" );
-
- if ( zyppPool().diffState<zypp::Language>() )
- y2milestone( "diffState() reports changed languages" );
-
if ( zyppPool().diffState<zypp::Patch>() )
y2milestone( "diffState() reports changed patches" );
}
@@ -242,8 +232,6 @@
{
zyppPool().restoreState<zypp::Package >();
zyppPool().restoreState<zypp::Pattern >();
- zyppPool().restoreState<zypp::Selection>();
- zyppPool().restoreState<zypp::Language >();
zyppPool().restoreState<zypp::Patch >();

y2milestone( "Closing PackageSelector with \"Cancel\"" );
@@ -315,7 +303,7 @@
YQPackageSelectorBase::showPendingLicenseAgreements( ZyppPoolIterator begin,
ZyppPoolIterator end )
{
bool allConfirmed = true;
-
+
for ( ZyppPoolIterator it = begin; it != end; ++it )
{
ZyppSel sel = (*it);

Modified: branches/tmp/dmacvicar/zc10/qt/src/YQPatternSelector.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPatternSelector.cc?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPatternSelector.cc (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPatternSelector.cc Wed Mar 23 17:01:11
2011
@@ -38,7 +38,6 @@
#include "YQPkgSelDescriptionView.h"
#include "YQPkgDiskUsageList.h"
#include "YQPkgPatternList.h"
-#include "YQPkgSelList.h"
#include "YQWizard.h"
#include "YQDialog.h"

@@ -60,7 +59,6 @@
: YQPackageSelectorBase( parent, opt )
{
_patternList = 0;
- _selList = 0;
_descriptionView = 0;
_wizard = findWizard();

@@ -72,14 +70,8 @@
_patternList->fillList();
_patternList->selectSomething();
}
- else if ( _selList )
- {
- _selList->fillList();
- _selList->selectSomething();
- }

- if ( zyppPool().empty<zypp::Pattern >() &&
- zyppPool().empty<zypp::Selection>() )
+ if ( zyppPool().empty<zypp::Pattern >() )
{
y2warning( "Neither patterns nor selections in ZyppPool" );
}
@@ -147,26 +139,6 @@
_patternList->header()->hide();
}

- if ( ! _patternList )
- {
- //
- // Fallback: selections list
- //
-
- /**
- * Create a selections list even if there are no selections, otherwise
- * the layout will look very weird. An empty selections list still
- * looks better than a lot of grey empty space.
- **/
-
- y2warning( "No patterns in ZyppPool - using selections instead" );
- _selList = new YQPkgSelList( vbox,
- false, // no autoFill - need to
connect to details view first
- false ); // no autoFilter -
filterMatch() is not connected
- CHECK_PTR( _selList );
- _selList->header()->hide();
- }
-
if ( _wizard ) // No button box - add "Details..." button here
{
//
@@ -297,21 +269,6 @@
}
}

- if ( _selList )
- {
- if ( _descriptionView )
- {
- connect( _selList, SIGNAL( selectionChanged( ZyppSel ) ),
- _descriptionView, SLOT ( showDetails ( ZyppSel ) ) );
- }
-
- if ( _diskUsageList )
- {
- connect( _selList, SIGNAL( updatePackages() ),
- _diskUsageList, SLOT ( updateDiskUsage() ) );
- }
- }
-
y2milestone( "Connection set up" );



Modified: branches/tmp/dmacvicar/zc10/qt/src/YQPkgConflictDialog.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPkgConflictDialog.cc?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPkgConflictDialog.cc (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPkgConflictDialog.cc Wed Mar 23
17:01:11 2011
@@ -246,7 +246,7 @@
QTime solveTime;
solveTime.start();

- bool success = zypp::getZYpp()->resolver()->verifySystem( true ); //
considerNewHardware
+ bool success = zypp::getZYpp()->resolver()->verifySystem(); //
considerNewHardware

y2debug( "System verified in %f s", solveTime.elapsed() / 1000.0 );


Modified: branches/tmp/dmacvicar/zc10/qt/src/YQPkgDependenciesView.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPkgDependenciesView.cc?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPkgDependenciesView.cc (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPkgDependenciesView.cc Wed Mar 23
17:01:11 2011
@@ -14,7 +14,7 @@

Author: Stefan Hundhammer <sh@xxxxxxx>

- Textdomain "packages-qt"
+ Textdomain "qt-pkg"

/-*/

@@ -90,7 +90,6 @@
row( "Obsoletes:", pkg->dep( zypp::Dep::OBSOLETES
) ) +
row( "Recommends:", pkg->dep( zypp::Dep::RECOMMENDS
) ) +
row( "Suggests:", pkg->dep( zypp::Dep::SUGGESTS
) ) +
- row( "Freshens:", pkg->dep( zypp::Dep::FRESHENS
) ) +
row( "Enances:", pkg->dep( zypp::Dep::ENHANCES
) ) +
row( "Supplements:", pkg->dep( zypp::Dep::SUPPLEMENTS
) )
);
@@ -121,7 +120,6 @@
row( "Obsoletes:", p1->dep( zypp::Dep::OBSOLETES ),
p2->dep( zypp::Dep::OBSOLETES ) ) +
row( "Recommends:", p1->dep( zypp::Dep::RECOMMENDS ),
p2->dep( zypp::Dep::RECOMMENDS ) ) +
row( "Suggests:", p1->dep( zypp::Dep::SUGGESTS ),
p2->dep( zypp::Dep::SUGGESTS ) ) +
- row( "Freshens:", p1->dep( zypp::Dep::FRESHENS ),
p2->dep( zypp::Dep::FRESHENS ) ) +
row( "Enances:", p1->dep( zypp::Dep::ENHANCES ),
p2->dep( zypp::Dep::ENHANCES ) ) +
row( "Supplements:", p1->dep( zypp::Dep::SUPPLEMENTS ),
p2->dep( zypp::Dep::SUPPLEMENTS ) )
);
@@ -132,7 +130,7 @@

QString
YQPkgDependenciesView::row( const QString & heading,
- const zypp::CapSet & capSet )
+ const zypp::Capabilities & capSet )
{
QString content = htmlLines( capSet );

@@ -148,8 +146,8 @@

QString
YQPkgDependenciesView::row( const QString & heading,
- const zypp::CapSet & capSet1,
- const zypp::CapSet & capSet2 )
+ const zypp::Capabilities & capSet1,
+ const zypp::Capabilities & capSet2 )
{
QString content1 = htmlLines( capSet1 );
QString content2 = htmlLines( capSet2 );
@@ -166,11 +164,11 @@


QString
-YQPkgDependenciesView::htmlLines( const zypp::CapSet & capSet )
+YQPkgDependenciesView::htmlLines( const zypp::Capabilities & capSet )
{
QString html;

- for ( zypp::CapSet::const_iterator it = capSet.begin();
+ for ( zypp::Capabilities::const_iterator it = capSet.begin();
it != capSet.end();
++it )
{

Modified: branches/tmp/dmacvicar/zc10/qt/src/YQPkgFileListView.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPkgFileListView.cc?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPkgFileListView.cc (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPkgFileListView.cc Wed Mar 23 17:01:11
2011
@@ -61,7 +61,12 @@

if ( installed )
{
- html += formatFileList( installed->filenames() );
+ // ma@: It might be worth passing Package::FileList directly
+ // instead of copying _all_ filenames into a list first.
+ // Package::FileList is a query, so it does not eat much memory.
+ zypp::Package::FileList f( installed->filelist() );
+ std::list<std::string> tmp( f.begin(), f.end() );
+ html += formatFileList( tmp );
}
else
{

Modified: branches/tmp/dmacvicar/zc10/qt/src/YQPkgLangList.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPkgLangList.cc?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPkgLangList.cc (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPkgLangList.cc Wed Mar 23 17:01:11 2011
@@ -14,45 +14,61 @@

Author: Stefan Hundhammer <sh@xxxxxxx>

- Textdomain "packages-qt"
+ Textdomain "qt-pkg"

/-*/


-#define y2log_component "qt-pkg"
-#include <ycp/y2log.h>
+#define YUILogComponent "qt-pkg"
+#include "YUILog.h"
#include <qregexp.h>

+#include <QHeaderView>
#include "YQi18n.h"
#include "utf8.h"
#include "YQPkgLangList.h"

+#include "zypp/sat/LocaleSupport.h"
+
using std::set;


YQPkgLangList::YQPkgLangList( QWidget * parent )
: YQPkgObjList( parent )
+#warning "base class works with zypp::Resolvable, but zypp::Locale isn't one
any longer!"
{
- y2debug( "Creating language list" );
+ yuiDebug() << "Creating language list" << endl;

int numCol = 0;
- addColumn( "" ); _statusCol = numCol++;
+ QStringList headers;
+ headers << ""; _statusCol = numCol++;

// Translators: Table column heading for language ISO code like "de_DE",
"en_US"
// Please keep this short to avoid stretching the column too wide!
- addColumn( _( "Code" ) ); _nameCol = numCol++;
+ headers << _( "Code" ); _nameCol = numCol++;

// Full (human readable) language / country name like "German (Austria)"
- addColumn( _( "Language" ) ); _summaryCol = numCol++;
+ headers << _( "Language"); _summaryCol = numCol++;
setAllColumnsShowFocus( true );
+ setHeaderLabels(headers);
+ header()->setResizeMode( _nameCol, QHeaderView::ResizeToContents );
+ header()->setResizeMode( _summaryCol, QHeaderView::Stretch );
+
+
+ setSortingEnabled( true );
+ header()->setSortIndicatorShown( true );
+ header()->setClickable( true );
+
+ sortByColumn( nameCol(), Qt::AscendingOrder );

- connect( this, SIGNAL( selectionChanged ( QListViewItem * ) ),
+ connect( this, SIGNAL( currentItemChanged ( QListViewItem *,
QListViewItem * ) ),
this, SLOT ( filter() ) );

fillList();
selectSomething();
+ resizeColumnToContents(_statusCol);

- y2debug( "Creating language list done" );
+ yuiDebug() << "Creating language list done" << endl;
}


@@ -66,22 +82,18 @@
YQPkgLangList::fillList()
{
clear();
- y2debug( "Filling language list" );
+ yuiDebug() << "Filling language list" << endl;

+ zypp::LocaleSet locales = zypp::getZYpp()->pool().getAvailableLocales();

- for ( ZyppPoolIterator it = zyppLangBegin();
- it != zyppLangEnd();
+ for ( zypp::LocaleSet::const_iterator it = locales.begin();
+ it != locales.end();
++it )
{
- ZyppLang zyppLang = tryCastToZyppLang( (*it)->theObj() );
-
- if ( zyppLang )
- addLangItem( *it, zyppLang );
- else
- y2error( "Found non-Language selectable" );
+ addLangItem( *it );
}

- y2debug( "Language list filled" );
+ yuiDebug() << "Language list filled" << endl;
}


@@ -100,79 +112,44 @@

if ( selection() )
{
- ZyppLang lang = selection()->zyppLang();
+ int total = 0;
+ int installed = 0;

- if ( lang )
- {
- string currentLang = lang->name();
+ zypp::Locale lang = selection()->zyppLang();

- //
- // Iterate over all selectables in pool
- //
-
- for ( ZyppPoolIterator it = zyppPkgBegin();
- it != zyppPkgEnd();
- ++it )
- {
- ZyppObj zyppObj = (*it)->theObj();
-
- if ( zyppObj )
- {
- //
- // Iterate over all "freshens" dependencies of this object
- //
-
- zypp::CapSet freshens = zyppObj->dep( zypp::Dep::FRESHENS );
-
- for ( zypp::CapSet::const_iterator cap_it =
freshens.begin();
- cap_it != freshens.end();
- ++cap_it )
- {
- if ( (*cap_it).index() == currentLang ) // obj freshens
this language
- {
- ZyppPkg pkg = tryCastToZyppPkg( zyppObj );
-
- if ( pkg )
- {
- y2debug( "Found pkg %s for lang %s",
- pkg->name().c_str(),
currentLang.c_str() );
-
- emit filterMatch( *it, pkg );
- }
- else
- {
- y2warning( "Found non-pkg obj %s for lang %s",
- pkg->name().c_str(),
currentLang.c_str() );
- }
- }
- }
- }
- }
- }
- }
+ zypp::sat::LocaleSupport myLocale( lang );
+ for_( it, myLocale.selectableBegin(), myLocale.selectableEnd() )
+ {
+ ZyppPkg zyppPkg = tryCastToZyppPkg( (*it)->theObj() );
+ if ( zyppPkg )
+ {
+ if ( (*it)->installedSize() > 0 )
+ ++installed;
+ ++total;
+
+ emit filterMatch( *it, zyppPkg );
+ }
+ }
+ //selection()->setInstalledPackages(installed);
+ //selection()->setTotalPackages(total);

+ //selection()->setText( _summaryCol, QString().sprintf("%s (%d/%d)",
zyppPattern->summary().c_str(), installed, total));
+
+ }
emit filterFinished();
}

-
void
-YQPkgLangList::addLangItem( ZyppSel selectable,
- ZyppLang zyppLang )
+YQPkgLangList::addLangItem( const zypp::Locale &zyppLang )
{
- if ( ! selectable )
- {
- y2error( "NULL ZyppSel!" );
- return;
- }
-
- new YQPkgLangListItem( this, selectable, zyppLang );
+ new YQPkgLangListItem( this, zyppLang );
}


YQPkgLangListItem *
YQPkgLangList::selection() const
{
- QListViewItem * item = selectedItem();
+ QTreeWidgetItem * item = currentItem();

if ( ! item )
return 0;
@@ -181,17 +158,34 @@
}


+void
+YQPkgLangList::updateActions( YQPkgObjListItem * item)
+{
+#if 0
+ YQPkgLangListItem *litem;
+ if ( !item)
+ litem = dynamic_cast<YQPkgLangListItem *> ( currentItem() );
+ else
+ litem = dynamic_cast<YQPkgLangListItem *> ( item );
+#endif
+
+ actionSetCurrentInstall->setEnabled( true );
+ actionSetCurrentDontInstall->setEnabled( true );
+ actionSetCurrentTaboo->setEnabled( true );
+ actionSetCurrentProtected->setEnabled( false );
+
+ actionSetCurrentKeepInstalled->setEnabled( false );
+ actionSetCurrentDelete->setEnabled( false );
+ actionSetCurrentUpdate->setEnabled( false );
+}


-
-
-YQPkgLangListItem::YQPkgLangListItem( YQPkgLangList * langList,
- ZyppSel selectable,
- ZyppLang lang )
- : YQPkgObjListItem( langList, selectable, lang )
- , _langList( langList )
+YQPkgLangListItem::YQPkgLangListItem( YQPkgLangList * langList,
+ const zypp::Locale & lang )
+ : YQPkgObjListItem( langList )
, _zyppLang( lang )
{
+ init();
}


@@ -209,6 +203,109 @@
}


+void
+YQPkgLangListItem::init()
+{
+#warning this is utterly broken - see bug #370233
+ // DO NOT CALL PARENT CLASS
+ _debugIsBroken = false;
+ _debugIsSatisfied = false;
+ _candidateIsNewer = false;
+ _installedIsNewer = false;
+
+ if ( nameCol() >= 0 ) setText( nameCol(), _zyppLang.code()
);
+ if ( summaryCol() >= 0 ) setText( summaryCol(), _zyppLang.name()
);
+
+ setStatusIcon();
+}
+
+
+ZyppStatus
+YQPkgLangListItem::status() const
+{
+ if ( zypp::getZYpp()->pool().isRequestedLocale( _zyppLang ) )
+ return S_Install;
+ else
+ return S_NoInst;
+}

+void
+YQPkgLangListItem::setStatus( ZyppStatus newStatus, bool sendSignals )
+{
+ ZyppStatus oldStatus = status();

+ switch ( newStatus )
+ {
+ case S_Install:
+ if ( ! zypp::getZYpp()->pool().isRequestedLocale( _zyppLang ) )
+ {
+ zypp::getZYpp()->pool().addRequestedLocale( _zyppLang );
+ }
+ break;
+ case S_NoInst:
+ if ( zypp::getZYpp()->pool().isRequestedLocale( _zyppLang ) )
+ {
+ zypp::getZYpp()->pool().eraseRequestedLocale( _zyppLang );
+ }
+ break;
+ default:
+ return;
+ }
+
+ if ( oldStatus != newStatus )
+ {
+ applyChanges();
+
+ if ( sendSignals )
+ {
+ _pkgObjList->updateItemStates();
+ _pkgObjList->sendUpdatePackages();
+ }
+ }
+
+ setStatusIcon();
+ _pkgObjList->sendStatusChanged();
+}
+
+bool
+YQPkgLangListItem::bySelection() const
+{
+ return zypp::getZYpp()->pool().isRequestedLocale( _zyppLang );
+}
+
+
+void
+YQPkgLangListItem::cycleStatus()
+{
+ if ( zypp::getZYpp()->pool().isRequestedLocale( _zyppLang ) )
+ {
+ zypp::getZYpp()->pool().eraseRequestedLocale( _zyppLang );
+ }
+ else
+ {
+ zypp::getZYpp()->pool().addRequestedLocale( _zyppLang );
+ }
+ setStatusIcon();
+ _pkgObjList->sendStatusChanged();
+}
+
+bool YQPkgLangListItem::operator<( const QTreeWidgetItem & otherListViewItem )
const
+{
+ const YQPkgLangListItem * other = dynamic_cast<const YQPkgLangListItem *>
(&otherListViewItem);
+ int col = treeWidget()->sortColumn();
+
+ if ( other )
+ {
+ if ( col == nameCol() )
+ {
+ return ( strcoll( this->zyppLang().code().c_str(),
other->zyppLang().code().c_str() ) < 0 );
+ }
+ if ( col == summaryCol() )
+ {
+ return ( strcoll( this->zyppLang().name().c_str(),
other->zyppLang().name().c_str() ) < 0 );
+ }
+ }
+
+ return QY2ListViewItem::operator<( otherListViewItem );
+}
#include "YQPkgLangList.moc"

Added: branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoFilterView.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoFilterView.cc?rev=63654&view=auto
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoFilterView.cc (added)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoFilterView.cc Wed Mar 23
17:01:11 2011
@@ -0,0 +1,247 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: YQPkgRepoFilterView.cc
+
+ Author: Stefan Hundhammer <sh@xxxxxxx>
+
+ Textdomain "qt-pkg"
+
+/-*/
+
+
+#define YUILogComponent "qt-pkg"
+#include "ycp/y2log.h"
+
+#include <qlayout.h>
+#include <qsplitter.h>
+#include <qframe.h>
+
+#include "QY2ComboTabWidget.h"
+#include "QY2LayoutUtils.h"
+#include "YQPkgRepoFilterView.h"
+#include "YQPkgRepoList.h"
+#include "YQPkgRpmGroupTagsFilterView.h"
+#include "YQPkgSearchFilterView.h"
+#include "YQPkgStatusFilterView.h"
+#include "YQi18n.h"
+
+
+YQPkgRepoFilterView::YQPkgRepoFilterView( QWidget * parent )
+ : QWidget( parent )
+{
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ //layout->setContentsMargins(0,0,0,0);
+
+ QSplitter * splitter = new QSplitter( Qt::Vertical, this );
+ CHECK_PTR( splitter );
+
+ layout->addWidget( splitter );
+
+ _repoList = new YQPkgRepoList( splitter );
+
+ CHECK_PTR( _repoList );
+ _repoList->setSizePolicy( QSizePolicy( QSizePolicy::Ignored,
QSizePolicy::Expanding ) );// hor/vert
+
+ // Directly propagate signals filterStart() and filterFinished()
+ // from primary filter to the outside
+
+ connect( _repoList, SIGNAL( filterStart() ),
+ this, SIGNAL( filterStart() ) );
+
+ connect( _repoList, SIGNAL( filterFinished() ),
+ this, SIGNAL( filterFinished() ) );
+
+
+ // Redirect filterMatch() and filterNearMatch() signals to secondary filter
+
+ connect( _repoList, SIGNAL( filterMatch ( ZyppSel,
ZyppPkg ) ),
+ this, SLOT ( primaryFilterMatch ( ZyppSel,
ZyppPkg ) ) );
+
+ connect( _repoList, SIGNAL( filterNearMatch ( ZyppSel,
ZyppPkg ) ),
+ this, SLOT ( primaryFilterNearMatch ( ZyppSel,
ZyppPkg ) ) );
+
+ layoutSecondaryFilters( splitter );
+
+ //splitter->setStretchFactor(0, 5);
+ //splitter->setStretchFactor(1, 1);
+ //splitter->setStretchFactor(2, 3);
+}
+
+
+YQPkgRepoFilterView::~YQPkgRepoFilterView()
+{
+ // NOP
+}
+
+ZyppRepo
+YQPkgRepoFilterView::selectedRepo() const
+{
+ YQPkgRepoListItem *selection = _repoList->selection();
+ if ( selection && selection->zyppRepo() )
+ return selection->zyppRepo();
+ return zypp::Repository::noRepository;
+}
+
+QWidget *
+YQPkgRepoFilterView::layoutSecondaryFilters( QWidget * parent )
+{
+ QWidget *vbox = new QWidget( parent );
+ CHECK_PTR( vbox );
+
+ QVBoxLayout *layout = new QVBoxLayout(vbox);
+ CHECK_PTR( layout );
+
+ //vbox->setLayout( layout );
+ //layout->setContentsMargins( 0, 0, 0, 0 );
+
+ // Translators: This is a combo box where the user can apply a secondary
filter
+ // in addition to the primary filter by repository - one of
+ // "All packages", "RPM groups", "search", "summary"
+ //
+ // And yes, the colon really belongs there since this is one of the very
+ // few cases where a combo box label is left to the combo box rather than
+ // above it.
+ _secondaryFilters = new QY2ComboTabWidget( _( "&Secondary Filter:" ));
+ CHECK_PTR( _secondaryFilters );
+ layout->addWidget(_secondaryFilters);
+
+ //
+ // All Packages
+ //
+
+ _allPackages = new QWidget( this );
+ CHECK_PTR( _allPackages );
+ _secondaryFilters->addPage( _( "All Packages" ), _allPackages );
+
+
+ // Unmaintaned packages: Packages that are not provided in any of
+ // the configured repositories
+
+ _unmaintainedPackages = new QWidget( this );
+ CHECK_PTR( _unmaintainedPackages );
+ _secondaryFilters->addPage( _( "Unmaintained Packages" ),
_unmaintainedPackages );
+
+ //
+ // RPM Groups
+ //
+
+ _rpmGroupTagsFilterView = new YQPkgRpmGroupTagsFilterView( this );
+ CHECK_PTR( _rpmGroupTagsFilterView );
+ _secondaryFilters->addPage( _( "Package Groups" ), _rpmGroupTagsFilterView
);
+
+ connect( _rpmGroupTagsFilterView, SIGNAL( filterStart() ),
+ _repoList, SLOT ( filter() ) );
+
+
+ //
+ // Package search view
+ //
+
+ _searchFilterView = new YQPkgSearchFilterView( this );
+ CHECK_PTR( _searchFilterView );
+
+ _searchFilterView->setSizePolicy( QSizePolicy::Minimum, // horizontal
+ QSizePolicy::Minimum ); // vertical
+ _secondaryFilters->addPage( _( "Search" ), _searchFilterView );
+
+ connect( _searchFilterView, SIGNAL( filterStart() ),
+ _repoList, SLOT ( filter() ) );
+
+ connect( _secondaryFilters, SIGNAL( currentChanged( QWidget * ) ),
+ this, SLOT ( filter() ) );
+
+
+ //
+ // Status change view
+ //
+
+ _statusFilterView = new YQPkgStatusFilterView( parent );
+ CHECK_PTR( _statusFilterView );
+
+ _searchFilterView->setSizePolicy( QSizePolicy::Minimum, // horizontal
+ QSizePolicy::Minimum ); // vertical
+
+ _secondaryFilters->addPage( _( "Installation Summary" ), _statusFilterView
);
+
+ connect( _statusFilterView, SIGNAL( filterStart() ),
+ _repoList, SLOT ( filter() ) );
+
+
+ return _secondaryFilters;
+}
+
+
+void YQPkgRepoFilterView::filter()
+{
+ _repoList->filter();
+}
+
+
+void YQPkgRepoFilterView::filterIfVisible()
+{
+ _repoList->filterIfVisible();
+}
+
+
+void YQPkgRepoFilterView::primaryFilterMatch( ZyppSel selectable,
+ ZyppPkg pkg )
+{
+ if ( secondaryFilterMatch( selectable, pkg ) )
+ emit filterMatch( selectable, pkg );
+}
+
+
+void YQPkgRepoFilterView::primaryFilterNearMatch( ZyppSel selectable,
+ ZyppPkg pkg )
+{
+ if ( secondaryFilterMatch( selectable, pkg ) )
+ emit filterNearMatch( selectable, pkg );
+}
+
+
+bool
+YQPkgRepoFilterView::secondaryFilterMatch( ZyppSel selectable,
+ ZyppPkg pkg )
+{
+ if ( _allPackages->isVisible() )
+ {
+ return true;
+ }
+ else if ( _unmaintainedPackages->isVisible() )
+ {
+ return ( selectable->availableSize() == 0 );
+ }
+ else if ( _rpmGroupTagsFilterView->isVisible() )
+ {
+ return _rpmGroupTagsFilterView->check( selectable, pkg );
+ }
+ else if ( _searchFilterView->isVisible() )
+ {
+ return _searchFilterView->check( selectable, pkg );
+ }
+ else if ( _statusFilterView->isVisible() )
+ {
+ return _statusFilterView->check( selectable, pkg );
+ }
+ else
+ {
+ return true;
+ }
+}
+
+
+
+
+
+
+#include "YQPkgRepoFilterView.moc"

Added: branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoFilterView.lo
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoFilterView.lo?rev=63654&view=auto
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoFilterView.lo (added)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoFilterView.lo Wed Mar 23
17:01:11 2011
@@ -0,0 +1,12 @@
+# YQPkgRepoFilterView.lo - a libtool object file
+# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18
22:14:06)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/YQPkgRepoFilterView.o'
+
+# Name of the non-PIC object.
+non_pic_object=none
+

Added: branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoList.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoList.cc?rev=63654&view=auto
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoList.cc (added)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoList.cc Wed Mar 23 17:01:11 2011
@@ -0,0 +1,306 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: YQPkgRepoList.cc
+
+ Author: Stefan Hundhammer <sh@xxxxxxx>
+
+ Textdomain "qt-pkg"
+
+/-*/
+
+#include <algorithm>
+#include <qdatetime.h>
+#include <qpixmap.h>
+
+#define YUILogComponent "qt-pkg"
+#include "ycp/y2log.h"
+#include <zypp/RepoManager.h>
+#include <zypp/PoolQuery.h>
+
+#include <qlistview.h>
+#include "YQPkgRepoList.h"
+#include "YQi18n.h"
+#include "utf8.h"
+
+using std::string;
+using std::list;
+using std::set;
+using std::vector;
+
+
+YQPkgRepoList::YQPkgRepoList( QWidget * parent )
+ : QY2ListView( parent )
+{
+ y2debug("Creating repository list");
+
+ _nameCol = -1;
+ _urlCol = -1;
+
+ int numCol = 0;
+
+ // Column headers for installation source list
+ addColumn( _( "Name" ) ); _nameCol = numCol++;
+ addColumn( _( "URL" ) ); _urlCol = numCol++;
+ setAllColumnsShowFocus( true );
+ setSelectionMode( QListView::Extended ); // allow multi-selection with
Ctrl-mouse
+
+ setAllColumnsShowFocus( true );
+ setSelectionMode( QListView::Extended ); // allow multi-selection with
Ctrl-mouse
+
+ connect( this, SIGNAL( itemSelectionChanged() ),
+ this, SLOT ( filterIfVisible()) );
+ //setIconSize(QSize(32,32));
+ fillList();
+ //setSortingEnabled( true );
+ //sortByColumn( nameCol(), Qt::AscendingOrder );
+ selectSomething();
+
+ y2debug("Creating repository list done");
+}
+
+
+YQPkgRepoList::~YQPkgRepoList()
+{
+ // NOP
+}
+
+
+void
+YQPkgRepoList::fillList()
+{
+ clear();
+ y2debug("Filling repository list");
+
+ for ( ZyppRepositoryIterator it = ZyppRepositoriesBegin();
+ it != ZyppRepositoriesEnd();
+ ++it )
+ {
+ addRepo( *it );
+ }
+
+ y2debug("Inst repository filled");
+}
+
+
+int
+YQPkgRepoList::countEnabledRepositories()
+{
+ return zyppPool().knownRepositoriesSize();
+}
+
+
+void
+YQPkgRepoList::filterIfVisible()
+{
+ if ( isVisible() )
+ filter();
+}
+
+
+void
+YQPkgRepoList::filter()
+{
+ emit filterStart();
+
+ y2milestone("Collecting packages in selected repositories...");
+ QTime stopWatch;
+ stopWatch.start();
+
+
+ //
+ // Collect all packages on this repository
+ //
+
+ QListViewItem * item = firstChild();
+
+ while ( item )
+ {
+
+ if ( item->isSelected() )
+ {
+ YQPkgRepoListItem * repoItem = dynamic_cast<YQPkgRepoListItem *>
(item);
+
+ if ( repoItem )
+ {
+ ZyppRepo currentRepo = repoItem->zyppRepo();
+
+ zypp::PoolQuery query;
+ query.addRepo( currentRepo.info().alias() );
+ query.addKind(zypp::ResKind::package);
+
+ for( zypp::PoolQuery::Selectable_iterator it =
query.selectableBegin();
+ it != query.selectableEnd(); it++)
+ {
+ emit filterMatch( *it, tryCastToZyppPkg( (*it)->theObj() )
);
+ }
+ }
+ }
+ }
+
+ y2debug("Packages sent to package list. Elapsed time: %f sec",
stopWatch.elapsed() / 1000.0);
+
+ emit filterFinished();
+}
+
+
+void
+YQPkgRepoList::addRepo( ZyppRepo repo )
+{
+ new YQPkgRepoListItem( this, repo );
+}
+
+
+YQPkgRepoListItem *
+YQPkgRepoList::selection() const
+{
+ QListViewItem * item = currentItem();
+
+ if ( ! item )
+ return 0;
+
+ return dynamic_cast<YQPkgRepoListItem *> (item);
+}
+
+
+
+
+
+
+YQPkgRepoListItem::YQPkgRepoListItem( YQPkgRepoList * repoList,
+ ZyppRepo repo )
+ : QY2ListViewItem( repoList )
+ , _repoList( repoList )
+ , _zyppRepo( repo )
+{
+ if ( nameCol() >= 0 )
+ {
+ string name = repo.info().name();
+ if ( ! name.empty() )
+ {
+ setText( nameCol(), fromUTF8( name ));
+ }
+ }
+
+ std::string infoToolTip;
+ infoToolTip += ("<b>" + repo.info().name() + "</b>");
+
+ ZyppProduct product = singleProduct( _zyppRepo );
+ if ( product )
+ {
+ infoToolTip += ("<p>" + product->summary() + "</p>");
+ }
+
+ if ( ! repo.info().baseUrlsEmpty() )
+ {
+ zypp::RepoInfo::urls_const_iterator it;
+ infoToolTip += "<ul>";
+
+ for ( it = repo.info().baseUrlsBegin();
+ it != repo.info().baseUrlsEnd();
+ ++it )
+ {
+ infoToolTip += ("<li>" + (*it).asString() + "</li>");
+ }
+ infoToolTip += "</ul>";
+ }
+ //setToolTip( nameCol(), infoToolTip.c_str() );
+
+ QString iconPath;
+ QString iconName = "yast-sw_source";
+
+ if ( ! repo.info().baseUrlsEmpty() )
+ {
+ zypp::Url repoUrl = *repo.info().baseUrlsBegin();
+
+ if ( urlCol() >= 0 )
+ {
+ setText( urlCol(), repoUrl.asString().c_str() );
+ }
+
+ if (QString(repoUrl.asString().c_str()).contains("KDE") )
+ iconName = "pattern-kde";
+ if (QString(repoUrl.asString().c_str()).contains("GNOME") )
+ iconName = "pattern-gnome";
+ if (QString(repoUrl.asString().c_str()).contains("KDE") )
+ iconName = "pattern-kde";
+ if (QString(repoUrl.asString().c_str()).contains("update") )
+ iconName = "yast-update";
+ if (QString(repoUrl.asString().c_str()).contains("home:") )
+ iconName = "yast-users";
+ }
+
+ if ( repo.isSystemRepo() )
+ iconName = "yast-host";
+
+
+ setPixmap( 0, QPixmap(
iconPath.sprintf("/usr/share/icons/hicolor/48x48/apps/%s.png",
iconName.ascii()) ));
+}
+
+
+
+YQPkgRepoListItem::~YQPkgRepoListItem()
+{
+ // NOP
+}
+
+
+ZyppProduct
+YQPkgRepoListItem::singleProduct( ZyppRepo zyppRepo )
+{
+ ZyppProduct product;
+
+ zypp::ResPool::byKind_iterator it = zypp::ResPool::instance().byKindBegin(
zypp::ResKind::product );
+ zypp::ResPool::byKind_iterator end = zypp::ResPool::instance().byKindEnd(
zypp::ResKind::product );
+
+ //
+ // Find the first product on this repository
+ //
+
+ while ( it != end && ! product )
+ {
+ if ( it->resolvable()->repoInfo().alias() == zyppRepo.info().alias() )
+ product = zypp::asKind<zypp::Product>( it->resolvable() );
+ ++it;
+ }
+
+ //
+ // Check if there is another product on this repository
+ //
+
+ while ( it != end )
+ {
+ if ( it->resolvable()->repoInfo().alias() == zyppRepo.info().alias() )
+ {
+ y2milestone("Multiple products in repository %s",
zyppRepo.info().alias().c_str());
+ ZyppProduct null;
+ return null;
+ }
+
+ ++it;
+ }
+
+ if ( ! product )
+ y2milestone("No product in repository ",
zyppRepo.info().alias().c_str());
+
+ return product;
+}
+
+bool
+YQPkgRepoListItem::operator< ( const QListViewItem & other ) const
+{
+ const YQPkgRepoListItem * otherItem = dynamic_cast<const YQPkgRepoListItem
*>(&other);
+
+ return zyppRepo().info().name() < otherItem->zyppRepo().info().name();
+}
+
+#include "YQPkgRepoList.moc"

Added: branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoList.lo
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoList.lo?rev=63654&view=auto
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoList.lo (added)
+++ branches/tmp/dmacvicar/zc10/qt/src/YQPkgRepoList.lo Wed Mar 23 17:01:11 2011
@@ -0,0 +1,12 @@
+# YQPkgRepoList.lo - a libtool object file
+# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18
22:14:06)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/YQPkgRepoList.o'
+
+# Name of the non-PIC object.
+non_pic_object=none
+

Modified: branches/tmp/dmacvicar/zc10/qt/src/include/YQPackageSelector.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/include/YQPackageSelector.h?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/include/YQPackageSelector.h (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/include/YQPackageSelector.h Wed Mar 23
17:01:11 2011
@@ -46,7 +46,7 @@
class YQPkgDescriptionView;
class YQPkgDiskUsageList;
class YQPkgFileListView;
-class YQPkgInstSrcFilterView;
+class YQPkgRepoFilterView;
class YQPkgLangList;
class YQPkgList;
class YQPkgPatternList;
@@ -301,13 +301,12 @@
YQPkgDependenciesView * _pkgDependenciesView;
YQPkgDescriptionView * _pkgDescriptionView;
YQPkgFileListView * _pkgFileListView;
- YQPkgInstSrcFilterView * _instSrcFilterView;
+ YQPkgRepoFilterView * _instSrcFilterView;
YQPkgLangList * _langList;
YQPkgList * _pkgList;
YQPkgPatternList * _patternList;
YQPkgRpmGroupTagsFilterView * _rpmGroupTagsFilterView;
YQPkgSearchFilterView * _searchFilterView;
- YQPkgSelList * _selList;
YQPkgStatusFilterView * _statusFilterView;
YQPkgTechnicalDetailsView * _pkgTechnicalDetailsView;
YQPkgUpdateProblemFilterView * _updateProblemFilterView;

Modified: branches/tmp/dmacvicar/zc10/qt/src/include/YQPatternSelector.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/include/YQPatternSelector.h?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/include/YQPatternSelector.h (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/include/YQPatternSelector.h Wed Mar 23
17:01:11 2011
@@ -31,7 +31,6 @@
class QPushButton;

class YQPkgSelDescriptionView;
-class YQPkgSelList;
class YQPkgPatternList;
class YQWizard;

@@ -84,7 +83,6 @@



- YQPkgSelList * _selList;
YQPkgPatternList * _patternList;
YQPkgSelDescriptionView * _descriptionView;
YQWizard * _wizard;

Modified: branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgDependenciesView.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgDependenciesView.h?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgDependenciesView.h
(original)
+++ branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgDependenciesView.h Wed Mar
23 17:01:11 2011
@@ -16,8 +16,6 @@

/-*/

-// -*- c++ -*-
-

#ifndef YQPkgDependenciesView_h
#define YQPkgDependenciesView_h
@@ -82,18 +80,18 @@
* Returns an empty string if capSet is empty.
**/
static QString row( const QString & heading,
- const zypp::CapSet & capSet );
+ const zypp::Capabilities & capSet );


/**
- * Format two zypp::CapSets (describing zypp::Dep::REQUIRES etc.)
+ * Format two zypp::Capabilities (describing zypp::Dep::REQUIRES etc.)
* with a heading in HTML lines.
*
* Returns an empty string both capSets are empty.
**/
static QString row( const QString & heading,
- const zypp::CapSet & capSet1,
- const zypp::CapSet & capSet2 );
+ const zypp::Capabilities & capSet1,
+ const zypp::Capabilities & capSet2 );

/**
* Returns a string containing a HTML table row with 'contents'.
@@ -102,13 +100,13 @@
**/
static QString row( const QString & contents )
{ return YQPkgGenericDetailsView::row( contents ); }
-
+
/**
- * Format a zypp::CapSet (describing zypp::Dep::REQUIRES etc.)
+ * Format a zypp::Capabilities (describing zypp::Dep::REQUIRES etc.)
* in HTML lines, separated with <BR>.
* Returns an empty string if capSet is empty.
**/
- static QString htmlLines( const zypp::CapSet & capSet );
+ static QString htmlLines( const zypp::Capabilities & capSet );
};



Modified: branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgLangList.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgLangList.h?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgLangList.h (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgLangList.h Wed Mar 23
17:01:11 2011
@@ -16,8 +16,6 @@

/-*/

-// -*- c++ -*-
-

#ifndef YQPkgLangList_h
#define YQPkgLangList_h
@@ -27,7 +25,6 @@

class YQPkgLangListItem;

-
/**
* @short Display a list of zypp::Selection objects.
**/
@@ -70,10 +67,13 @@
* this slot. Remember to connect filterStart() to clear() (inherited from
* QListView).
**/
- void addLangItem( ZyppSel selectable,
- ZyppLang lang );
+ void addLangItem( const zypp::Locale & lang );
+
+ /**
+ * update from base class to not access selectables
+ **/
+ virtual void updateActions( YQPkgObjListItem * item = 0);

-
public:

/**
@@ -120,9 +120,8 @@
* Constructor. Creates a YQPkgLangList item that corresponds to the
package
* manager object that 'pkg' refers to.
**/
- YQPkgLangListItem( YQPkgLangList * pkgSelList,
- ZyppSel selectable,
- ZyppLang lang );
+ YQPkgLangListItem( YQPkgLangList * pkgSelList,
+ const zypp::Locale & lang );

/**
* Destructor
@@ -132,13 +131,39 @@
/**
* Returns the original object within the package manager backend.
**/
- ZyppLang zyppLang() const { return _zyppLang; }
+ zypp::Locale zyppLang() const { return _zyppLang; }

+ /// overloaded
+ virtual void init();

// Columns

int statusCol() const { return _langList->statusCol(); }

+ /**
+ * override this two as we don't have a real selectable and
+ * the status depends on the language
+ **/
+ virtual ZyppStatus status() const;
+ virtual void setStatus( ZyppStatus newStatus, bool sendSignals = true );
+
+ /**
+ * Returns 'true' if this selectable's status is set by a selection
+ * (rather than by the user or by the dependency solver).
+ **/
+ virtual bool bySelection() const;
+
+ /**
+ * Cycle the package status to the next valid value.
+ **/
+ virtual void cycleStatus();
+
+ /**
+ * Sorting function. Redefined here (bnc#428355) as the one from
+ * parent YQPkgObjList can't be used - it refers to zyppObj's which
+ * are NULL here as zypp::Locale is not zypp::ResObject anymore
+ **/
+ virtual bool operator< ( const QListViewItem & other ) const;

protected:

@@ -154,7 +179,7 @@
// Data members

YQPkgLangList * _langList;
- ZyppLang _zyppLang;
+ zypp::Locale _zyppLang;
};



Added: branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgRepoFilterView.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgRepoFilterView.h?rev=63654&view=auto
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgRepoFilterView.h (added)
+++ branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgRepoFilterView.h Wed Mar 23
17:01:11 2011
@@ -0,0 +1,142 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: YQPkgRepoFilterView.h
+
+ Author: Stefan Hundhammer <sh@xxxxxxx>
+
+/-*/
+
+
+#ifndef YQPkgRepoFilterView_h
+#define YQPkgRepoFilterView_h
+
+#include "YQZypp.h"
+#include <qwidget.h>
+
+
+class YQPkgRepoList;
+class QY2ComboTabWidget;
+class YQPkgRpmGroupTagsFilterView;
+class YQPkgSearchFilterView;
+class YQPkgStatusFilterView;
+
+
+class YQPkgRepoFilterView : public QWidget
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * Constructor
+ **/
+ YQPkgRepoFilterView( QWidget * parent );
+
+ /**
+ * Destructor
+ **/
+ virtual ~YQPkgRepoFilterView();
+
+ /**
+ * Current selected repository, or if nothing is selected
+ */
+ zypp::Repository selectedRepo() const;
+
+signals:
+
+ /**
+ * Emitted when the filtering starts. Use this to clear package lists
+ * etc. prior to adding new entries.
+ **/
+ void filterStart();
+
+ /**
+ * Emitted during filtering for each pkg that matches the filter
+ * and the candidate package comes from the respective repository
+ **/
+ void filterMatch( ZyppSel selectable,
+ ZyppPkg pkg );
+
+ /**
+ * Emitted during filtering for each pkg that matches the filter
+ * and the candidate package does not come from the respective repository
+ **/
+ void filterNearMatch( ZyppSel selectable,
+ ZyppPkg pkg );
+
+ /**
+ * Emitted when filtering is finished.
+ **/
+ void filterFinished();
+
+public slots:
+
+ /**
+ * Filter according to the view's rules and current selection.
+ * Emits those signals:
+ * filterStart()
+ * filterMatch() for each pkg that matches the filter
+ * filterFinished()
+ **/
+ void filter();
+
+ /**
+ * Same as filter(), but only if this widget is currently visible.
+ **/
+ void filterIfVisible();
+
+
+protected slots:
+
+ /**
+ * Propagate a filter match from the primary filter
+ * and appy any selected secondary filter(s) to it
+ **/
+ void primaryFilterMatch( ZyppSel selectable,
+ ZyppPkg pkg );
+
+ /**
+ * Propagate a filter near match from the primary filter
+ * and appy any selected secondary filter(s) to it
+ **/
+ void primaryFilterNearMatch( ZyppSel selectable,
+ ZyppPkg pkg );
+
+protected:
+
+ /**
+ * Widget layout for the secondary filters
+ **/
+ QWidget * layoutSecondaryFilters( QWidget * parent );
+
+ /**
+ * Check if pkg matches the the currently selected secondary filter
+ **/
+ bool secondaryFilterMatch( ZyppSel selectable,
+ ZyppPkg pkg );
+
+
+ // Data members
+
+ YQPkgRepoList * _repoList;
+ QY2ComboTabWidget * _secondaryFilters;
+ QWidget * _allPackages;
+ QWidget *_unmaintainedPackages;
+ YQPkgRpmGroupTagsFilterView * _rpmGroupTagsFilterView;
+ YQPkgSearchFilterView * _searchFilterView;
+ YQPkgStatusFilterView * _statusFilterView;
+};
+
+
+
+#endif // ifndef YQPkgRepoFilterView_h

Added: branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgRepoList.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgRepoList.h?rev=63654&view=auto
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgRepoList.h (added)
+++ branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgRepoList.h Wed Mar 23
17:01:11 2011
@@ -0,0 +1,190 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: YQPkgRepoList.h
+
+ Author: Stefan Hundhammer <sh@xxxxxxx>
+
+/-*/
+
+
+#ifndef YQPkgRepoList_h
+#define YQPkgRepoList_h
+
+#include "YQZypp.h"
+#include "QY2ListView.h"
+#include <zypp/Repository.h>
+#include <zypp/Product.h>
+
+
+class YQPkgRepoListItem;
+
+typedef zypp::Repository ZyppRepo;
+
+
+/**
+ * @short Display a list of zypp::Selection objects.
+ **/
+class YQPkgRepoList : public QY2ListView
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * Constructor
+ **/
+ YQPkgRepoList( QWidget * parent );
+
+ /**
+ * Destructor
+ **/
+ virtual ~YQPkgRepoList();
+
+ /**
+ * Returns the number of enabled repositories.
+ **/
+ static int countEnabledRepositories();
+
+
+public slots:
+
+ /**
+ * Filter according to the view's rules and current selection.
+ * Emits those signals:
+ * filterStart()
+ * filterMatch() for each pkg that matches the filter
+ * filterFinished()
+ **/
+ void filter();
+
+ /**
+ * Same as filter(), but only if this widget is currently visible.
+ **/
+ void filterIfVisible();
+
+ /**
+ * Add a repository to the list.
+ **/
+ void addRepo( ZyppRepo repo );
+
+
+public:
+
+ // Column numbers
+
+ int nameCol() const { return _nameCol; }
+ int urlCol() const { return _urlCol; }
+
+
+ /**
+ * Returns the currently selected item or 0 if there is none.
+ **/
+ YQPkgRepoListItem * selection() const;
+
+
+signals:
+
+ /**
+ * Emitted when the filtering starts. Use this to clear package lists
+ * etc. prior to adding new entries.
+ **/
+ void filterStart();
+
+ /**
+ * Emitted during filtering for each pkg that matches the filter
+ * and the candidate package comes from the respective repository
+ **/
+ void filterMatch( ZyppSel selectable,
+ ZyppPkg pkg );
+
+ /**
+ * Emitted during filtering for each pkg that matches the filter
+ * and the candidate package does not come from the respective repository
+ **/
+ void filterNearMatch( ZyppSel selectable,
+ ZyppPkg pkg );
+
+ /**
+ * Emitted when filtering is finished.
+ **/
+ void filterFinished();
+
+
+protected slots:
+
+ /**
+ * Fill the list.
+ **/
+ void fillList();
+
+
+private:
+
+ //
+ // Data members
+ //
+
+ int _nameCol;
+ int _urlCol;
+
+};
+
+
+
+class YQPkgRepoListItem: public QY2ListViewItem
+{
+public:
+
+ /**
+ * Constructor
+ **/
+ YQPkgRepoListItem( YQPkgRepoList *parentList, ZyppRepo repo );
+
+ /**
+ * Destructor
+ **/
+ virtual ~YQPkgRepoListItem();
+
+ /**
+ * Returns the ZYPP repository this item corresponds to
+ **/
+ ZyppRepo zyppRepo() const { return _zyppRepo; }
+
+ /**
+ * Returns the parent list
+ **/
+ const YQPkgRepoList * repoList() const { return _repoList; }
+
+ /**
+ * Returns the product on a source if it has one single product
+ * or 0 if there are no or multiple products.
+ **/
+ static ZyppProduct singleProduct( ZyppRepo repo );
+
+
+ // Columns
+
+ int nameCol() const { return _repoList->nameCol(); }
+ int urlCol() const { return _repoList->urlCol(); }
+
+ virtual bool operator< ( const QListViewItem & other ) const;
+protected:
+
+ // Data members
+
+ YQPkgRepoList * _repoList;
+ ZyppRepo _zyppRepo;
+};
+
+
+#endif // ifndef YQPkgRepoList_h

Modified: branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgSearchFilterView.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgSearchFilterView.h?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgSearchFilterView.h
(original)
+++ branches/tmp/dmacvicar/zc10/qt/src/include/YQPkgSearchFilterView.h Wed Mar
23 17:01:11 2011
@@ -146,7 +146,7 @@
* zypp::Resolvable::dep( zypp::Dep::PROVIDES ),
* zypp::Resolvable::dep( zypp::Dep::REQUIRES )
**/
- bool check( const zypp::CapSet & capSet, const QRegExp & regexp );
+ bool check( const zypp::Capabilities & capSet, const QRegExp & regexp );

/**
* Key press event: Execute search upon 'Return'

Modified: branches/tmp/dmacvicar/zc10/qt/src/include/YQZypp.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/qt/src/include/YQZypp.h?rev=63654&r1=63653&r2=63654&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/qt/src/include/YQZypp.h (original)
+++ branches/tmp/dmacvicar/zc10/qt/src/include/YQZypp.h Wed Mar 23 17:01:11 2011
@@ -16,7 +16,6 @@

/-*/

-// -*- c++ -*-

#ifndef YQZypp_h
#define YQZypp_h
@@ -26,9 +25,7 @@
#include <zypp/ui/Selectable.h>
#include <zypp/ResObject.h>
#include <zypp/Package.h>
-#include <zypp/Selection.h>
#include <zypp/Pattern.h>
-#include <zypp/Language.h>
#include <zypp/Patch.h>
#include <zypp/Product.h>
#include <zypp/ZYppFactory.h>
@@ -36,17 +33,16 @@

#define FORCE_FULL_SOLVER_RUN_FILE "/var/lib/YaST2/force_full_solver_run"

-
-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;


//
@@ -57,15 +53,14 @@
typedef zypp::ui::Selectable::Ptr ZyppSel;
typedef zypp::ResObject::constPtr ZyppObj;
typedef zypp::Package::constPtr ZyppPkg;
-typedef zypp::Selection::constPtr ZyppSelection;
typedef zypp::Pattern::constPtr ZyppPattern;
-typedef zypp::Language::constPtr ZyppLang;
typedef zypp::Patch::constPtr ZyppPatch;
typedef zypp::Product::constPtr ZyppProduct;
+typedef zypp::PoolItem ZyppPoolItem;

typedef zypp::ResPoolProxy ZyppPool;
typedef zypp::ResPoolProxy::const_iterator ZyppPoolIterator;
-
+typedef zypp::ResPoolProxy::repository_iterator ZyppRepositoryIterator;

inline ZyppPool zyppPool() { return
zypp::getZYpp()->poolProxy(); }

@@ -75,42 +70,28 @@
inline ZyppPoolIterator zyppPkgBegin() { return
zyppBegin<zypp::Package>(); }
inline ZyppPoolIterator zyppPkgEnd() { return
zyppEnd<zypp::Package>(); }

-inline ZyppPoolIterator zyppSelectionsBegin() { return
zyppBegin<zypp::Selection>(); }
-inline ZyppPoolIterator zyppSelectionsEnd() { return
zyppEnd<zypp::Selection>(); }
-
inline ZyppPoolIterator zyppPatternsBegin() { return
zyppBegin<zypp::Pattern>(); }
inline ZyppPoolIterator zyppPatternsEnd() { return
zyppEnd<zypp::Pattern>(); }

-inline ZyppPoolIterator zyppLangBegin() { return
zyppBegin<zypp::Language>(); }
-inline ZyppPoolIterator zyppLangEnd() { return
zyppEnd<zypp::Language>(); }
-
inline ZyppPoolIterator zyppPatchesBegin() { return
zyppBegin<zypp::Patch>(); }
inline ZyppPoolIterator zyppPatchesEnd() { return
zyppEnd<zypp::Patch>(); }

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 )
{
return zypp::dynamic_pointer_cast<const zypp::Package>( zyppObj );
}

-inline ZyppSelection tryCastToZyppSelection( ZyppObj zyppObj )
-{
- return zypp::dynamic_pointer_cast<const zypp::Selection>( zyppObj );
-}
-
inline ZyppPattern tryCastToZyppPattern( ZyppObj zyppObj )
{
return zypp::dynamic_pointer_cast<const zypp::Pattern>( zyppObj );
}

-inline ZyppLang tryCastToZyppLang( ZyppObj zyppObj )
-{
- return zypp::dynamic_pointer_cast<const zypp::Language>( zyppObj );
-}
-
inline ZyppPatch tryCastToZyppPatch( ZyppObj zyppObj )
{
return zypp::dynamic_pointer_cast<const zypp::Patch>( zyppObj );

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages