forked from qt-creator/qt-creator
Allow blocking auto files refresh
While importing assets, qml files are generated under the import path and this triggers files update every time a file is added. This results into high CPU usage. Task-number: QDS-1675 Change-Id: Ia0775ef78bbffedfaf2c140365ee31718e7ee3a4 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
40899c7209
commit
07cbc49d33
@@ -57,11 +57,16 @@
|
||||
#include <QDebug>
|
||||
#include <QRegularExpression>
|
||||
#include <QTextCodec>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace QmlProjectManager::Internal;
|
||||
|
||||
namespace {
|
||||
Q_LOGGING_CATEGORY(infoLogger, "QmlProjectManager.QmlBuildSystem", QtInfoMsg)
|
||||
}
|
||||
|
||||
namespace QmlProjectManager {
|
||||
|
||||
QmlProject::QmlProject(const Utils::FilePath &fileName)
|
||||
@@ -276,6 +281,10 @@ QStringList QmlBuildSystem::makeAbsolute(const Utils::FilePath &path, const QStr
|
||||
|
||||
void QmlBuildSystem::refreshFiles(const QSet<QString> &/*added*/, const QSet<QString> &removed)
|
||||
{
|
||||
if (m_blockFilesUpdate) {
|
||||
qCDebug(infoLogger) << "Auto files refresh blocked.";
|
||||
return;
|
||||
}
|
||||
refresh(Files);
|
||||
if (!removed.isEmpty()) {
|
||||
if (auto modelManager = QmlJS::ModelManagerInterface::instance())
|
||||
|
Reference in New Issue
Block a user