Changes between Version 1 and Version 2 of Ticket #7429, comment 10


Ignore:
Timestamp:
2012-02-21T11:37:20+01:00 (14 years ago)
Author:
xeen

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7429, comment 10

    v1 v2  
    1 This is hackish. If we don’t want to be there multiple instances of *Action, then we should enforce this by using a singleton. Not only does this solve our problem in a nice way via new SaveAction() → SaveAction.getInstance() rather than Main.main.menu.save; but it also prevents the problem from happening in the future. It probably will solve #7424 if applied to all offending actions, too.
     1This is hackish. If we don’t want there to be multiple instances of *Action, then we should enforce this by using a singleton. Not only does this solve our problem in a nice way via new SaveAction() → SaveAction.getInstance() rather than Main.main.menu.save; but it also prevents the problem from happening in the future. It probably will solve #7424 if applied to all offending actions, too.
    22
    33I’ll attach a patch for SaveAction. It implements the Singleton as I suggested and makes all methods that can be static, static. So in some cases simply writing SaveAction.doSave is enough.