Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command queries can be zero-arg testing methods #1207

Merged
merged 7 commits into from
Dec 16, 2023

Commits on Dec 16, 2023

  1. Perform prims should follow normal branching convention

    All the C++ prims follow a style that conditional forward jumps are not
    taken except in the error case. This is because the default prediction
    for a forward jump is that it is not taken.
    blairmcg committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    0c528d4 View commit details
    Browse the repository at this point in the history
  2. Command queries can be zero-arg testing methods

    Many command queries do nothing other than set the enablement of the
    command, in which case the code is simpler and smaller if a command query
    method can be a simple testing method that takes no arguments and returns
    true if the command is to be enabled, or false if disabled.
    
    This seems to apply to the majority of cases visited so far, and in quite
    a few cases allows for the use of existing testing methods to be used,
    reducing the proliferation of individual query methods specific to
    individual commands or related groups of commands.
    
    Also perform some validation of the query annotations, since it is easy to
    make a small mistake, such as mispelling a selector, and end up breaking
    the command handling in the development tools. As the command queries are
    often called repeatedly as a background/idle task to revalidate the UI
    state (e.g. for toolbar buttons), this can cause repetitive errors that
    are at best annoying, and at worst terminal.
    blairmcg committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    54178e0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    620951f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2327dee View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e83f934 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4566959 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    21b0ef2 View commit details
    Browse the repository at this point in the history