Make Command::execute() private so it can be called only from app::Context

This commit is contained in:
David Capello 2018-07-04 16:43:38 -03:00
parent 3704bb4093
commit f0d61b0557
2 changed files with 5 additions and 4 deletions

View File

@ -124,8 +124,7 @@ protected:
Command* openFile = Commands::instance()->byId(CommandId::OpenFile());
Params params;
params.set("filename", "");
openFile->loadParams(params);
openFile->execute(m_context);
m_context->executeCommand(openFile, params);
// The user have selected another document.
if (oldActiveDocument != m_context->activeDocument()) {

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2001-2017 David Capello
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -36,7 +36,6 @@ namespace app {
void loadParams(const Params& params);
bool isEnabled(Context* context);
bool isChecked(Context* context);
void execute(Context* context);
protected:
virtual bool onNeedsParams() const;
@ -51,6 +50,9 @@ namespace app {
}
private:
friend class Context;
void execute(Context* context);
std::string m_id;
std::string m_friendlyName;
CommandFlags m_flags;