00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <sstream>
00026
00027 #include "zypp/base/String.h"
00028 #include "zypp/base/Gettext.h"
00029 #include "zypp/solver/detail/ProblemSolutionKeep.h"
00030 #include "zypp/solver/detail/ResolverInfo.h"
00031
00032 using namespace std;
00033
00035 namespace zypp
00036 {
00037
00038 namespace solver
00039 {
00040
00041 namespace detail
00042 {
00043
00044 IMPL_PTR_TYPE(ProblemSolutionKeep);
00045
00046
00047
00048 ProblemSolutionKeep::ProblemSolutionKeep( ResolverProblem_Ptr parent,
00049 PoolItem_Ref item )
00050 : ProblemSolution (parent, "", "")
00051 {
00052
00053 _description = str::form (_("keep %s"), item->name().c_str() );
00054
00055 _details = str::form (_("keep %s"), ResolverInfo::toString (item).c_str());
00056
00057 addAction ( new TransactionSolutionAction (item,
00058 KEEP));
00059 }
00060
00061 ProblemSolutionKeep::ProblemSolutionKeep( ResolverProblem_Ptr parent,
00062 PoolItemList & itemList )
00063 : ProblemSolution (parent, "", "")
00064 {
00065 _description = _("Keep resolvables");
00066
00067 for (PoolItemList::iterator iter = itemList.begin();
00068 iter != itemList.end(); iter++) {
00069 PoolItem_Ref item = *iter;
00070 addAction ( new TransactionSolutionAction (item, KEEP));
00071 }
00072
00073 ostringstream details;
00074 details << _actions;
00075 _details = details.str();
00076
00077 }
00078
00080 };
00083 };
00086 };