]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcache.cc
methods/gzip.cc: With FileFd now being able to read gzipped files, there
[apt.git] / apt-pkg / pkgcache.cc
index b0ce6e5989728f351b5428beddfade624525d37c..038bd7ec4a7986706e1ae24b11fcdece6e26c8d7 100644 (file)
 // 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 <apt-pkg/macros.h>
 
 #include <apti18n.h>
     
@@ -35,7 +36,6 @@
 #include <unistd.h>
 
 #include <ctype.h>
-#include <system.h>
                                                                        /*}}}*/
 
 using std::string;
@@ -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();
 };
 
                                                                        /*}}}*/