Skip to content
  • Scott Harvey's avatar
    Resolve compiler fallthrough warnings · 978f9ee7
    Scott Harvey authored and rk flx's avatar rk flx committed
    Summary:
    Added "break;" and "return;" where needed to resolve fallthrough warnings
    
    - Resolve compiler fallthrough warning in Main.cpp, line 135
    Added call to `quitOnLastWindowClosed(false)` at the end of `BackgroundMode` block,
    ensuring this flag is set directly, rather than allowing it to be set via fallthrough into the
    `DBusMode` block beneath. Added `break` to properly end the `BackgroundMode` block.
    
    - Resolve compiler fallthrough warning in SpectacleCore.cpp, line 212
    Added explicit call to emit 'allDone()' signal, rather than allowing execution to fall through
    into block for DBusMode, which previously emitted the signal. This change also removes the
    emission of signal 'grabFailed()' during a BackgroundMode failure, which only happened due
    to the fallthrough into the DBus block, but signaling on the bus is not needed in `BackgroundMode`.
    
    Test Plan:
      - Compile Spectacle
      - Ensure warnings at Main.cpp:135 and SpectacleCore.cpp:212 are eliminated
    
    Reviewers: #spectacle, rkflx, ngraham
    
    Reviewed By: #spectacle, rkflx, ngraham
    
    Differential Revision: https://phabricator.kde.org/D10936
    978f9ee7