From 672795a37e6a33c0e361329de604e0853c5b45c1 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Fri, 27 Sep 2013 21:06:34 -0400 Subject: [PATCH] BDecisionProvider: Make YesNoDecisionNeeded() non-abstract. - A subset of jobs that require a BContext don't in fact make use of the decision provider. As such, make the default implementation usable for those cases so one doesn't need to always create a dummy derived class. --- headers/os/package/Context.h | 2 +- src/kits/package/Context.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/headers/os/package/Context.h b/headers/os/package/Context.h index e0d70da1ea..c5d5244a28 100644 --- a/headers/os/package/Context.h +++ b/headers/os/package/Context.h @@ -25,7 +25,7 @@ struct BDecisionProvider { virtual bool YesNoDecisionNeeded(const BString& description, const BString& question, const BString& yes, const BString& no, - const BString& defaultChoice) = 0; + const BString& defaultChoice); // virtual bool ActionsAcceptanceDecisionNeeded( // const BString& description, // const BString& question) = 0; diff --git a/src/kits/package/Context.cpp b/src/kits/package/Context.cpp index 7ed7d146ff..eb18acc9f8 100644 --- a/src/kits/package/Context.cpp +++ b/src/kits/package/Context.cpp @@ -29,6 +29,15 @@ BDecisionProvider::~BDecisionProvider() } +bool +BDecisionProvider::YesNoDecisionNeeded(const BString& description, + const BString& question, const BString& yes, const BString& no, + const BString& defaultChoice) +{ + return defaultChoice == yes; +} + + BContext::BContext(BDecisionProvider& decisionProvider, BJobStateListener& jobStateListener) :