global.cpp: Ensure qApp does not emit signal because of local QEventLoop
The reason is that QApplication will somehow listen for the QEventLoop quitting (not sure exactly how but the two are tied in https://codebrowser.dev/qt5/qtbase/src/corelib/kernel/qeventloop.cpp.html) and then fires QGuiApplication::saveStateRequest
which triggers KXmlGui's KMWSessionManager to fire saveState
which will save the gui session of the current Dolphin instance before the state was even loaded.
The blockSignal
prevents this chain of action.
I which I wouldn't have need that but KActivities::Consumer initialization runs only in mainthread and is asynchronous at the same time, which means I can't use a separate thread to load it.
That made a QEventLoop necessary to have a synchronous start here necessary.
cc @felixernst
Edited by Méven Car