1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-22 16:41:18 +01:00

Remove CommandContext::GetProject() ...

... which called ::GetActiveProject(), but one purpose of the CommandContext
class was to eliminate many uses of that global function, because a
CommandContext must always be constructed from a reference to a project
(which was always in fact the active one), then passed around to where it is
needed!

Also, just use the project member directly -- because CommandContext was
intended as just a P.O.D (plain-old-data) structure.

This also eliminates a dependency of CommandContext.cpp on Project.cpp.

This is not enough by itself to break any dependency cycles.
This commit is contained in:
Paul Licameli
2019-05-11 16:19:43 -04:00
parent 1c0453106d
commit 9eb9104859
16 changed files with 86 additions and 90 deletions

View File

@@ -25,7 +25,7 @@ class CommandContext;
class CommandHandler
{
private:
std::unique_ptr<CommandContext> mCurrentContext;
std::unique_ptr<const CommandContext> mCurrentContext;
public:
CommandHandler();