From cd7bbc479f8e2f277092a9557bb486ab664deba6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 30 Jul 2010 09:51:42 +0200 Subject: - [ABI BREAK] add an ErrorType option to CacheSetHelper * cmdline/apt-cache.cc: - use Notice instead of Error in the CacheSetHelper messages for compat reasons. Otherwise tools like sbuild blow up --- apt-pkg/cacheset.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'apt-pkg/cacheset.h') diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index c8c3dd096..3f4f0066b 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -32,7 +32,9 @@ class CacheSetHelper { /*{{{*/ printed out. */ public: /*{{{*/ - CacheSetHelper(bool const &ShowError = true) : ShowError(ShowError) {}; + CacheSetHelper(bool const &ShowError = true, + GlobalError::MsgType ErrorType = GlobalError::ERROR) : + ShowError(ShowError), ErrorType(ErrorType) {}; virtual ~CacheSetHelper() {}; virtual void showTaskSelection(PackageSet const &pkgset, string const &pattern) {}; @@ -58,9 +60,21 @@ public: /*{{{*/ bool showErrors() const { return ShowError; }; bool showErrors(bool const &newValue) { if (ShowError == newValue) return ShowError; else return ((ShowError = newValue) == false); }; + GlobalError::MsgType errorType() const { return ErrorType; }; + GlobalError::MsgType errorType(GlobalError::MsgType const &newValue) + { + if (ErrorType == newValue) return ErrorType; + else { + GlobalError::MsgType const &oldValue = ErrorType; + ErrorType = newValue; + return oldValue; + } + }; + /*}}}*/ protected: bool ShowError; + GlobalError::MsgType ErrorType; }; /*}}}*/ class PackageSet : public std::set { /*{{{*/ /** \class APT::PackageSet -- cgit v1.2.3