From 733c655d1ee70274a5c6f0e4caa404e1608cec12 Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Wed, 1 Mar 2006 13:31:21 +0000 Subject: [PATCH] better layout of the solutions - Bug 148042 --- zypp/solver/detail/ResolverInfoMisc.cc | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/zypp/solver/detail/ResolverInfoMisc.cc b/zypp/solver/detail/ResolverInfoMisc.cc index 874037e..7f221ba 100644 --- a/zypp/solver/detail/ResolverInfoMisc.cc +++ b/zypp/solver/detail/ResolverInfoMisc.cc @@ -132,7 +132,13 @@ ResolverInfoMisc::message (void) const { string msg; - string affected_str = ResolverInfo::toString(affected()); + string affected_str = ""; + if (affected()) + affected_str = affected()->name(); + + string other_str = ""; + if (other()) + other_str = other()->name(); switch (type()) { @@ -189,7 +195,7 @@ ResolverInfoMisc::message (void) const // Translator: %s = name of package,patch,... msg = str::form (_("Can't install %s, since %s is already marked as needing to be installed"), affected_str.c_str(), - toString (other()).c_str()); + other_str.c_str()); } break; @@ -250,7 +256,7 @@ ResolverInfoMisc::message (void) const // TranslatorExample: Updating foo-1.1 to foo-1.2 // TranslatorExplanation: Just a progress indicator that something is scheduled for upgrade msg = str::form (_("Updating %s to %s"), - ResolverInfo::toString (other()).c_str(), + other_str.c_str(), affected_str.c_str()); } break; @@ -338,7 +344,7 @@ ResolverInfoMisc::message (void) const // TranslatorExample: Upgrade to foo to avoid removing bar is not possible // TranslatorExplanation: bar requires something from foo msg = str::form (_("Upgrade to %s to avoid removing %s is not possible."), - ResolverInfo::toString (other()).c_str(), + other_str.c_str(), affected_str.c_str()); } break; @@ -354,7 +360,7 @@ ResolverInfoMisc::message (void) const // Translator: 1.%s = name of package,patch,...; 2.%s = dependency; msg = str::form (_("%s provides %s, but is scheduled to be uninstalled."), - ResolverInfo::toString (other()).c_str(), + other_str.c_str(), ResolverInfo::toString (_capability).c_str()); } break; @@ -370,7 +376,7 @@ ResolverInfoMisc::message (void) const // Translator: 1.%s = name of package,patch,...; 2.%s = dependency; 3.%s type (package, patch, ...) msg = str::form (_("%s provides %s, but another version of that %s is already installed."), - other()->name().c_str(), + other_str.c_str(), ResolverInfo::toString (_capability).c_str(), translateResTraits(other()->kind()).c_str()); } @@ -387,7 +393,7 @@ ResolverInfoMisc::message (void) const // Translator: 1.%s = name of package,patch,...; 2.%s = dependency; msg = str::form (_("%s provides %s, but it is uninstallable. Try installing it on its own for more details."), - other()->name().c_str(), + other_str.c_str(), ResolverInfo::toString (_capability).c_str()); } break; @@ -403,7 +409,7 @@ ResolverInfoMisc::message (void) const // Translator: 1.%s = name of package,patch,...; 2.%s = dependency; msg = str::form (_("%s provides %s, but it is locked."), - other()->name().c_str(), + other_str.c_str(), ResolverInfo::toString (_capability).c_str()); } break; @@ -440,7 +446,7 @@ ResolverInfoMisc::message (void) const // TranslatorExample: foo is required by other to-be-installed resolvable, so it won't be unlinked. // TranslatorExplanation: Cant uninstall foo since it is required by an to-be-installed resolvable msg = str::form (_("%s is required by other to-be-installed resolvable, so it won't be unlinked."), - affected()->name().c_str()); + affected_str.c_str()); } break; @@ -457,7 +463,7 @@ ResolverInfoMisc::message (void) const // TranslatorExample: foo is required by other installed resolvable, so it won't be unlinked. // TranslatorExplanation: Cant uninstall foo since it is required by an installed resolvable msg = str::form (_("%s is required by other installed resolvable, so it won't be unlinked."), - affected()->name().c_str()); + affected_str.c_str()); } break; @@ -474,7 +480,7 @@ ResolverInfoMisc::message (void) const // TranslatorExample: foo is locked and cannot be uninstalled. // TranslatorExplanation: foo is to-be-uninstalled but it is locked msg = str::form (_("%s is locked and cannot be uninstalled."), - affected()->name().c_str()); + affected_str.c_str()); } break; -- 2.7.4