summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r--apt-pkg/pkgcache.cc28
1 files changed, 18 insertions, 10 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index b0ce6e598..eb7e4957a 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -22,11 +22,11 @@
// Include Files /*{{{*/
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/policy.h>
-#include <apt-pkg/indexfile.h>
#include <apt-pkg/version.h>
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apti18n.h>
@@ -298,7 +298,7 @@ const char *
pkgCache::PkgIterator::CandVersion() const
{
//TargetVer is empty, so don't use it.
- VerIterator version = pkgPolicy::pkgPolicy(Owner).GetCandidateVer(*this);
+ VerIterator version = pkgPolicy(Owner).GetCandidateVer(*this);
if (version.IsGood())
return version.VerStr();
return 0;
@@ -674,14 +674,22 @@ string pkgCache::PkgFileIterator::RelStr()
*/
pkgCache::DescIterator pkgCache::VerIterator::TranslatedDescription() const
{
- pkgCache::DescIterator DescDefault = DescriptionList();
- pkgCache::DescIterator Desc = DescDefault;
- for (; Desc.end() == false; Desc++)
- if (pkgIndexFile::LanguageCode() == Desc.LanguageCode())
- break;
- if (Desc.end() == true)
- Desc = DescDefault;
- return Desc;
+ std::vector<string> const lang = APT::Configuration::getLanguages();
+ for (std::vector<string>::const_iterator l = lang.begin();
+ l != lang.end(); l++)
+ {
+ pkgCache::DescIterator DescDefault = DescriptionList();
+ pkgCache::DescIterator Desc = DescDefault;
+
+ for (; Desc.end() == false; Desc++)
+ if (*l == Desc.LanguageCode())
+ break;
+ if (Desc.end() == true)
+ Desc = DescDefault;
+ return Desc;
+ }
+
+ return DescriptionList();
};
/*}}}*/