rename IsOnSystemEventLoop -> IsUseSystemEventLoop

to match the underlying field and avoid confusion.

The "IsOn" prefix normally means "is the current thread running on",
which is not what this method means

Change-Id: I3399a707582c9b0c681cd4aa03bc9f94860fc7fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177960
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2024-12-06 13:22:13 +02:00
parent 10c2eee93b
commit 8f9f04421b
7 changed files with 16 additions and 16 deletions

View file

@ -2088,7 +2088,7 @@ void Desktop::OpenClients()
bool bExistsSessionData = false;
bool const bDisableRecovery
= getenv("OOO_DISABLE_RECOVERY") != nullptr
|| IsOnSystemEventLoop()
|| IsUseSystemEventLoop()
|| !officecfg::Office::Recovery::RecoveryInfo::Enabled::get();
impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData);

View file

@ -1296,11 +1296,11 @@ public:
static css::uno::Reference< css::ui::dialogs::XFolderPicker2 >
createFolderPicker( const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
/** Returns true, if the VCL plugin runs on the system event loop.
/** Returns true, if the VCL plugin should run on the system event loop.
*
* AKA the VCL plugin can't handle nested event loops, like WASM or mobile.
*/
static bool IsOnSystemEventLoop();
static bool IsUseSystemEventLoop();
///@}

View file

@ -288,7 +288,7 @@ static void loop(void * arg) {
}
bool SvpSalInstance::DoExecute(int &) {
assert(Application::IsOnSystemEventLoop());
assert(Application::IsUseSystemEventLoop());
// emscripten_set_main_loop will unwind the stack by throwing a JavaScript exception, so we need
// to manually undo the call of AcquireYieldMutex() done in InitVCL:
ReleaseYieldMutex(false);
@ -299,7 +299,7 @@ bool SvpSalInstance::DoExecute(int &) {
}
void SvpSalInstance::DoQuit() {
assert(Application::IsOnSystemEventLoop());
assert(Application::IsUseSystemEventLoop());
}
#endif

View file

@ -778,8 +778,8 @@ std::unique_ptr<QApplication> QtInstance::CreateQApplication(int& nArgc, char**
bool QtInstance::DoExecute(int& nExitCode)
{
const bool bIsOnSystemEventLoop = Application::IsOnSystemEventLoop();
if (bIsOnSystemEventLoop)
const bool bIsUseSystemEventLoop = Application::IsUseSystemEventLoop();
if (bIsUseSystemEventLoop)
{
#if defined EMSCRIPTEN
// For Emscripten, QApplication::exec() will unwind the stack by throwing a JavaScript
@ -791,12 +791,12 @@ bool QtInstance::DoExecute(int& nExitCode)
O3TL_UNREACHABLE;
#endif
}
return bIsOnSystemEventLoop;
return bIsUseSystemEventLoop;
}
void QtInstance::DoQuit()
{
if (Application::IsOnSystemEventLoop())
if (Application::IsUseSystemEventLoop())
QApplication::quit();
}

View file

@ -42,7 +42,7 @@ QtTimer::QtTimer()
void QtTimer::timeoutActivated()
{
SolarMutexGuard aGuard;
if (Application::IsOnSystemEventLoop())
if (Application::IsUseSystemEventLoop())
{
const ImplSVData* pSVData = ImplGetSVData();
assert(pSVData && pSVData->mpDefInst);

View file

@ -169,14 +169,14 @@ bool SalInstance::CallEventCallback(void const* pEvent, int nBytes)
bool SalInstance::DoExecute(int&)
{
// can't run on system event loop without implementing DoExecute and DoQuit
if (Application::IsOnSystemEventLoop())
if (Application::IsUseSystemEventLoop())
std::abort();
return false;
}
void SalInstance::DoQuit()
{
if (Application::IsOnSystemEventLoop())
if (Application::IsUseSystemEventLoop())
std::abort();
}

View file

@ -350,7 +350,7 @@ void Application::Execute()
int nExitCode = 0;
if (!pSVData->mpDefInst->DoExecute(nExitCode))
{
if (Application::IsOnSystemEventLoop())
if (Application::IsUseSystemEventLoop())
{
SAL_WARN("vcl.schedule", "Can't omit DoExecute when running on system event loop!");
std::abort();
@ -395,7 +395,7 @@ static bool ImplYield(bool i_bWait, bool i_bAllEvents)
bool Application::Reschedule( bool i_bAllEvents )
{
static const bool bAbort = Application::IsOnSystemEventLoop();
static const bool bAbort = Application::IsUseSystemEventLoop();
if (bAbort)
{
SAL_WARN("vcl.schedule", "Application::Reschedule(" << i_bAllEvents << ")");
@ -404,7 +404,7 @@ bool Application::Reschedule( bool i_bAllEvents )
return ImplYield(false, i_bAllEvents);
}
bool Application::IsOnSystemEventLoop()
bool Application::IsUseSystemEventLoop()
{
return ImplGetSVData()->maAppData.m_bUseSystemLoop;
}
@ -464,7 +464,7 @@ SAL_DLLPUBLIC_EXPORT void unit_lok_process_events_to_idle()
void Application::Yield()
{
static const bool bAbort = Application::IsOnSystemEventLoop();
static const bool bAbort = Application::IsUseSystemEventLoop();
if (bAbort)
{
SAL_WARN("vcl.schedule", "Application::Yield()");