Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 978f9ee7 authored by Scott Harvey's avatar Scott Harvey Committed by Henrik Fehlauer

Resolve compiler fallthrough warnings

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:
parent 159b7d50
......@@ -125,6 +125,10 @@ int main(int argc, char **argv)
if (parser.isSet(QStringLiteral("onclick"))) {
delayMsec = -1;
case SpectacleCore::DBusMode:
case SpectacleCore::GuiMode:
......@@ -208,6 +208,8 @@ void SpectacleCore::screenshotFailed()
switch (mStartMode) {
case BackgroundMode:
showErrorMessage(i18n("Screenshot capture canceled or failed"));
emit allDone();
case DBusMode:
emit grabFailed();
emit allDone();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment