From 91e1f7d49830289d8e9d3fdd7ebbe7544a9838b8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:42:42 +0100 Subject: acquire: Fold pkgAcquireStatus2 into pkgAcquireStatus Clean up the code, make it neat, lalala --- apt-pkg/acquire.cc | 11 ++--------- apt-pkg/acquire.h | 14 +------------- 2 files changed, 3 insertions(+), 22 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 541785b03..fc256b39e 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -1444,9 +1444,8 @@ void pkgAcquireStatus::Fetched(unsigned long long Size,unsigned long long Resume /*}}}*/ bool pkgAcquireStatus::ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector &&Changes)/*{{{*/ { - auto const virt = dynamic_cast(this); - if (virt != nullptr) - return virt->ReleaseInfoChanges(LastRelease, CurrentRelease, std::move(Changes)); + (void) LastRelease; + (void) CurrentRelease; return ReleaseInfoChangesAsGlobalErrors(std::move(Changes)); } /*}}}*/ @@ -1464,12 +1463,6 @@ bool pkgAcquireStatus::ReleaseInfoChangesAsGlobalErrors(std::vector &&Changes) -{ - return ReleaseInfoChangesAsGlobalErrors(std::move(Changes)); -} -pkgAcquireStatus2::pkgAcquireStatus2() : pkgAcquireStatus() {} -pkgAcquireStatus2::~pkgAcquireStatus2() {} pkgAcquire::UriIterator::UriIterator(pkgAcquire::Queue *Q) : d(NULL), CurQ(Q), CurItem(0) diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index 1cf4da5bf..0b7b34d54 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -819,17 +819,13 @@ class pkgAcquireStatus * success it will print for each change the message attached to it via GlobalError either as an * error (if DefaultAction == false) or as a notice otherwise. * - * \b Note: To keep ABI compatibility for now this method isn't marked as - * virtual, but you can derive your class from #pkgAcquireStatus2 which has it - * marked as virtual. TODO on next ABI break: merge both classes. - * * @param LastRelease can be used to extract further information from the previous Release file * @param CurrentRelease can be used to extract further information from the current Release file * @param Changes is an array of changes alongside explanatory messages * which should be presented in some way to the user. * @return \b true if all changes are accepted by user, otherwise or if user can't be asked \b false */ - bool ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector &&Changes); + virtual bool ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector &&Changes); APT_HIDDEN static bool ReleaseInfoChangesAsGlobalErrors(std::vector &&Changes); /** \brief Invoked when an item is confirmed to be up-to-date. @@ -871,14 +867,6 @@ class pkgAcquireStatus /** \brief Initialize all counters to 0 and the time to the current time. */ pkgAcquireStatus(); virtual ~pkgAcquireStatus(); -}; -class pkgAcquireStatus2: public pkgAcquireStatus -{ -public: - virtual bool ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector &&Changes); - - pkgAcquireStatus2(); - virtual ~pkgAcquireStatus2(); }; /*}}}*/ /** @} */ -- cgit v1.2.3