From 92d84738cfe5dfd01a631f9187d4301dd2c884c9 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 11 Oct 2022 17:00:11 +0300 Subject: [PATCH] VcsCommand: Call GlobalFileChangeBlocker functions directly Since we now always run on the main thread, there is no reason to use invokeMethod. Change-Id: Id5fbade283b5d196f0ae7e5102bffee618a20881 Reviewed-by: Jarek Kobus --- src/plugins/vcsbase/vcscommand.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/plugins/vcsbase/vcscommand.cpp b/src/plugins/vcsbase/vcscommand.cpp index c62508d57bc..1043478ad1b 100644 --- a/src/plugins/vcsbase/vcscommand.cpp +++ b/src/plugins/vcsbase/vcscommand.cpp @@ -115,22 +115,16 @@ int VcsCommandPrivate::timeoutS() const void VcsCommandPrivate::setup() { m_futureInterface.reportStarted(); - if (m_flags & RunFlags::ExpectRepoChanges) { - QMetaObject::invokeMethod(GlobalFileChangeBlocker::instance(), [] { - GlobalFileChangeBlocker::instance()->forceBlocked(true); - }); - } + if (m_flags & RunFlags::ExpectRepoChanges) + GlobalFileChangeBlocker::instance()->forceBlocked(true); } void VcsCommandPrivate::cleanup() { QTC_ASSERT(m_futureInterface.isRunning(), return); m_futureInterface.reportFinished(); - if (m_flags & RunFlags::ExpectRepoChanges) { - QMetaObject::invokeMethod(GlobalFileChangeBlocker::instance(), [] { - GlobalFileChangeBlocker::instance()->forceBlocked(false); - }); - } + if (m_flags & RunFlags::ExpectRepoChanges) + GlobalFileChangeBlocker::instance()->forceBlocked(false); } void VcsCommandPrivate::setupProcess(QtcProcess *process, const Job &job)