Author: schubi2 Date: Mon Jan 14 14:31:23 2008 New Revision: 8271 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8271&view=rev Log: ordering combiSolutions Modified: trunk/libzypp/zypp/ResolverProblem.cc trunk/libzypp/zypp/ResolverProblem.h trunk/libzypp/zypp/sat/SATResolver.cc trunk/libzypp/zypp/solver/detail/ProblemSolutionCombi.cc trunk/libzypp/zypp/solver/detail/ProblemSolutionCombi.h Modified: trunk/libzypp/zypp/ResolverProblem.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResolverProblem.cc?rev=8271&r1=8270&r2=8271&view=diff ============================================================================== --- trunk/libzypp/zypp/ResolverProblem.cc (original) +++ trunk/libzypp/zypp/ResolverProblem.cc Mon Jan 14 14:31:23 2008 @@ -101,9 +101,14 @@ **/ void -ResolverProblem::addSolution( ProblemSolution_Ptr solution ) +ResolverProblem::addSolution( ProblemSolution_Ptr solution, + bool inFront ) { - _solutions.push_back (solution); + if (inFront) { + _solutions.push_front (solution); + } else { + _solutions.push_back (solution); + } } void Modified: trunk/libzypp/zypp/ResolverProblem.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResolverProblem.h?rev=8271&r1=8270&r2=8271&view=diff ============================================================================== --- trunk/libzypp/zypp/ResolverProblem.h (original) +++ trunk/libzypp/zypp/ResolverProblem.h Mon Jan 14 14:31:23 2008 @@ -97,7 +97,7 @@ * Add a solution to this problem. This class takes over ownership of * the problem and will delete it when neccessary. **/ - void addSolution( ProblemSolution_Ptr solution ); + void addSolution( ProblemSolution_Ptr solution, bool inFront = false ); }; /////////////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/sat/SATResolver.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SATResolver.cc?rev=8271&r1=8270&r2=8271&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/SATResolver.cc (original) +++ trunk/libzypp/zypp/sat/SATResolver.cc Mon Jan 14 14:31:23 2008 @@ -796,7 +796,8 @@ } } } - resolverProblem->addSolution (problemSolution); + resolverProblem->addSolution (problemSolution, + problemSolution->actionCount() > 1 ? true : false); // Solutions with more than 1 action will be shown first. MIL << "------------------------------------" << endl; } // save problem Modified: trunk/libzypp/zypp/solver/detail/ProblemSolutionCombi.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/ProblemSolutionCombi.cc?rev=8271&r1=8270&r2=8271&view=diff ============================================================================== --- trunk/libzypp/zypp/solver/detail/ProblemSolutionCombi.cc (original) +++ trunk/libzypp/zypp/solver/detail/ProblemSolutionCombi.cc Mon Jan 14 14:31:23 2008 @@ -48,6 +48,7 @@ ProblemSolutionCombi::ProblemSolutionCombi( ResolverProblem_Ptr parent) : ProblemSolution (parent, "", "") + , actNumber(0) { _description = ""; _details = ""; @@ -56,6 +57,7 @@ void ProblemSolutionCombi::addSingleAction( PoolItem_Ref item, const TransactionKind action) { addAction (new TransactionSolutionAction(item, action)); + actNumber++; } void ProblemSolutionCombi::addDescription( const std::string description) Modified: trunk/libzypp/zypp/solver/detail/ProblemSolutionCombi.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/ProblemSolutionCombi.h?rev=8271&r1=8270&r2=8271&view=diff ============================================================================== --- trunk/libzypp/zypp/solver/detail/ProblemSolutionCombi.h (original) +++ trunk/libzypp/zypp/solver/detail/ProblemSolutionCombi.h Mon Jan 14 14:31:23 2008 @@ -44,6 +44,8 @@ **/ class ProblemSolutionCombi : public ProblemSolution { + protected: + int actNumber; // number of actions public: /** @@ -54,10 +56,17 @@ * Add a single action */ void addSingleAction( PoolItem_Ref item, const TransactionKind action); + + /** + * returns the number of actions + */ + int actionCount() { return actNumber;} + /** * Set description text */ - void addDescription( const std::string description); + void addDescription( const std::string description); + }; /////////////////////////////////////////////////////////////////// -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org