]> git.saurik.com Git - apt.git/commitdiff
* [ABI break] apt-pkg/acquire-item.{cc,h}:
authorMichael Vogt <michael.vogt@ubuntu.com>
Thu, 28 Jul 2011 08:26:39 +0000 (10:26 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Thu, 28 Jul 2011 08:26:39 +0000 (10:26 +0200)
  - cleanup around OptionalIndexTarget and SubIndexTarget

apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h
debian/changelog

index aa77824f815b186b441d04cebdcf1b435592978d..df83d1481524b4e308ea7a488c86a8a571d57617 100644 (file)
@@ -2071,13 +2071,3 @@ string pkgAcqFile::Custom600Headers()
    return "";
 }
                                                                        /*}}}*/
-bool IndexTarget::IsOptional() const {
-   if (strncmp(ShortDesc.c_str(), "Translation", 11) != 0)
-      return false;
-   return true;
-}
-bool IndexTarget::IsSubIndex() const {
-   if (ShortDesc != "TranslationIndex")
-      return false;
-   return true;
-}
index e6916a83454e2028d67ef8553464ae9d156f22ca..f39a90c0bfd7857d5ca0657b613d40441ec70740 100644 (file)
@@ -646,8 +646,9 @@ class pkgAcqIndexTrans : public pkgAcqIndex
 };
                                                                        /*}}}*/
 /** \brief Information about an index file. */                         /*{{{*/
-struct IndexTarget
+class IndexTarget
 {
+ public:
    /** \brief A URI from which the index file can be downloaded. */
    string URI;
 
@@ -662,14 +663,28 @@ struct IndexTarget
     */
    string MetaKey;
 
-   //FIXME: We should use virtual methods here instead…
-   bool IsOptional() const;
-   bool IsSubIndex() const;
+   virtual bool IsOptional() const {
+      return false;
+   }
+   virtual bool IsSubIndex() const {
+      return false;
+   }
 };
                                                                        /*}}}*/
 /** \brief Information about an optional index file. */                        /*{{{*/
-struct OptionalIndexTarget : public IndexTarget
+class OptionalIndexTarget : public IndexTarget
+{
+   virtual bool IsOptional() const {
+      return true;
+   }
+};
+                                                                       /*}}}*/
+/** \brief Information about an subindex index file. */                        /*{{{*/
+class SubIndexTarget : public IndexTarget
 {
+   virtual bool IsSubIndex() const {
+      return true;
+   }
 };
                                                                        /*}}}*/
 
index bc7e4dd594af272576e24ce1a0bc03d832709c5d..c8af59ab2e5a5d551511ad302db871adf6448030 100644 (file)
@@ -12,6 +12,8 @@ apt (0.8.16~exp4) UNRELEASED; urgency=low
   * merged latest fixes from debian-sid
   * apt-pkg/cdrom.{cc,h}:
     - cleanup old ABI break avoidance hacks
+  * [ABI break] apt-pkg/acquire-item.{cc,h}:
+    - cleanup around OptionalIndexTarget and SubIndexTarget
 
  -- Julian Andres Klode <jak@debian.org>  Wed, 20 Jul 2011 16:23:55 +0200