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.
This commit is contained in:
Rene Gollent 2013-09-27 21:06:34 -04:00
parent a7a7aaaf3d
commit 672795a37e
2 changed files with 10 additions and 1 deletions

View File

@ -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;

View File

@ -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)
: