diff --git a/src/app/commands/cmd_import_sprite_sheet.cpp b/src/app/commands/cmd_import_sprite_sheet.cpp index e0c4ec4f4..a97d89ffa 100644 --- a/src/app/commands/cmd_import_sprite_sheet.cpp +++ b/src/app/commands/cmd_import_sprite_sheet.cpp @@ -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()) { diff --git a/src/app/commands/command.h b/src/app/commands/command.h index 6a4ae9291..a7569b181 100644 --- a/src/app/commands/command.h +++ b/src/app/commands/command.h @@ -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;