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 <jaroslaw.kobus@qt.io>
This commit is contained in:
Orgad Shaneh
2022-10-11 17:00:11 +03:00
committed by Orgad Shaneh
parent 0793184956
commit 92d84738cf

View File

@@ -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)