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

Report exit status when used command-line (fixes #3312) #3438

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void wayland_hacks()
}
#endif

void requestCaptureAndWait(const CaptureRequest& req)
int requestCaptureAndWait(const CaptureRequest& req)
{
Flameshot* flameshot = Flameshot::instance();
flameshot->requestCapture(req);
Expand All @@ -66,7 +66,7 @@ void requestCaptureAndWait(const CaptureRequest& req)
AbstractLogger::info() << "Screenshot aborted.";
qApp->exit(1);
});
qApp->exec();
return qApp->exec();
}

QSharedMemory* guiMutexLock()
Expand Down Expand Up @@ -428,7 +428,7 @@ int main(int argc, char* argv[])
req.addSaveTask();
}
}
requestCaptureAndWait(req);
return requestCaptureAndWait(req);
} else if (parser.isSet(fullArgument)) { // FULL
reinitializeAsQApplication(argc, argv);

Expand Down Expand Up @@ -463,7 +463,7 @@ int main(int argc, char* argv[])
if (!clipboard && path.isEmpty() && !raw && !upload) {
req.addSaveTask();
}
requestCaptureAndWait(req);
return requestCaptureAndWait(req);
} else if (parser.isSet(screenArgument)) { // SCREEN
reinitializeAsQApplication(argc, argv);

Expand Down Expand Up @@ -513,7 +513,7 @@ int main(int argc, char* argv[])
req.addSaveTask();
}

requestCaptureAndWait(req);
return requestCaptureAndWait(req);
} else if (parser.isSet(configArgument)) { // CONFIG
bool autostart = parser.isSet(autostartOption);
bool filename = parser.isSet(filenameOption);
Expand Down