diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index ef30703c9b7..6b11f4fea56 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -6,6 +6,7 @@ #include "commandline.h" #include "environment.h" #include "fileutils.h" +#include "guard.h" #include "hostosinfo.h" #include "macroexpander.h" #include "qtcassert.h" @@ -174,6 +175,7 @@ public: const MacroExpander *m_macroExpander = globalMacroExpander(); std::function m_openTerminal; bool m_allowPathFromDevice = false; + Guard m_callGuard; }; PathChooserPrivate::PathChooserPrivate() @@ -350,11 +352,15 @@ QString PathChooser::expandedDirectory(const QString &input, const Environment & void PathChooser::setPath(const QString &path) { + QTC_ASSERT(!d->m_callGuard.isLocked(), return); + GuardLocker locker(d->m_callGuard); d->m_lineEdit->setTextKeepingActiveCursor(QDir::toNativeSeparators(path)); } void PathChooser::setFilePath(const FilePath &fn) { + QTC_ASSERT(!d->m_callGuard.isLocked(), return); + GuardLocker locker(d->m_callGuard); d->m_lineEdit->setTextKeepingActiveCursor(fn.toUserOutput()); }