Skip to content

Commit

Permalink
check pick list and installed obj for package classification
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoettlicher committed Jul 30, 2013
1 parent 5839554 commit 476ea52
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions src/YQPkgPackageKitGroupsFilterView.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,31 +282,30 @@ YQPkgPackageKitGroupsFilterView::filter()
for ( ZyppPoolIterator it = zyppPkgBegin();
it != zyppPkgEnd();
++it )
{
ZyppSel selectable = *it;

// Multiple instances of this package may or may not be in the same
// group, so let's check both the installed version (if there
// is any) and the candidate version.
//
// Make sure we emit only one filterMatch() signal if both exist
// and both are in the same group. We don't want multiple list
// entries for the same package!

bool match =
check( selectable, tryCastToZyppPkg( selectable->candidateObj() ) ) ||
check( selectable, tryCastToZyppPkg( selectable->installedObj() ) );

// If there is neither an installed nor a candidate package, check
// any other instance.

if ( ! match &&
! selectable->candidateObj() &&
! selectable->installedObj() )
check( selectable, tryCastToZyppPkg( selectable->theObj() ) );
}
{
ZyppSel selectable = *it;
bool match = false;

// If there is an installed obj, check this first. The bits are set for the installed
// obj only and the installed obj is not contained in the pick list if there in an
// identical candidate available from a repo.
if ( selectable->installedObj() )
{
match = check( selectable, tryCastToZyppPkg( selectable->installedObj() ) );
}
// And then check the pick list which contain all availables and all objects for multi
// version packages and the installed obj if there isn't same version in a repo.
if ( !match )
{
zypp::ui::Selectable::picklist_iterator it = selectable->picklistBegin();
while ( it != selectable->picklistEnd() && !match )
{
check( selectable, tryCastToZyppPkg( *it ) );
++it;
}
}
}
}

emit filterFinished();
}

Expand Down

0 comments on commit 476ea52

Please sign in to comment.