@@ -45,7 +45,7 @@ void wayland_hacks()
4545}
4646#endif
4747
48- void requestCaptureAndWait (const CaptureRequest& req)
48+ int requestCaptureAndWait (const CaptureRequest& req)
4949{
5050 Flameshot* flameshot = Flameshot::instance ();
5151 flameshot->requestCapture (req);
@@ -66,7 +66,7 @@ void requestCaptureAndWait(const CaptureRequest& req)
6666 AbstractLogger::info () << " Screenshot aborted." ;
6767 qApp->exit (1 );
6868 });
69- qApp->exec ();
69+ return qApp->exec ();
7070}
7171
7272QSharedMemory* guiMutexLock ()
@@ -428,7 +428,7 @@ int main(int argc, char* argv[])
428428 req.addSaveTask ();
429429 }
430430 }
431- requestCaptureAndWait (req);
431+ return requestCaptureAndWait (req);
432432 } else if (parser.isSet (fullArgument)) { // FULL
433433 reinitializeAsQApplication (argc, argv);
434434
@@ -463,7 +463,7 @@ int main(int argc, char* argv[])
463463 if (!clipboard && path.isEmpty () && !raw && !upload) {
464464 req.addSaveTask ();
465465 }
466- requestCaptureAndWait (req);
466+ return requestCaptureAndWait (req);
467467 } else if (parser.isSet (screenArgument)) { // SCREEN
468468 reinitializeAsQApplication (argc, argv);
469469
@@ -513,7 +513,7 @@ int main(int argc, char* argv[])
513513 req.addSaveTask ();
514514 }
515515
516- requestCaptureAndWait (req);
516+ return requestCaptureAndWait (req);
517517 } else if (parser.isSet (configArgument)) { // CONFIG
518518 bool autostart = parser.isSet (autostartOption);
519519 bool filename = parser.isSet (filenameOption);
0 commit comments