QmakeProjectManager: Restore incremental re-parsing

This was broken in commit 37aecdd112, where we overlooked that a special
type of IDocument was used that triggers a re-parse of only the affected
part of the project tree. As a result, all changes to a .pri or .pro file
would trigger a re-parse of the entire project.

Fixes: QTCREATORBUG-24572
Change-Id: I480cff4e53cf86a17e1eaac0eb9b32901bc87051
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-09-10 10:39:56 +02:00
parent a50f1baf5d
commit f3bd07efd1
4 changed files with 73 additions and 42 deletions

View File

@@ -63,41 +63,6 @@ using namespace QmakeProjectManager::Internal;
using namespace QMakeInternal;
using namespace Utils;
namespace {
class QmakePriFileDocument : public Core::IDocument
{
public:
QmakePriFileDocument(QmakePriFile *qmakePriFile, const Utils::FilePath &filePath) :
IDocument(nullptr), m_priFile(qmakePriFile)
{
setId("Qmake.PriFile");
setMimeType(QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE));
setFilePath(filePath);
}
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override
{
Q_UNUSED(state)
Q_UNUSED(type)
return BehaviorSilent;
}
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override
{
Q_UNUSED(errorString)
Q_UNUSED(flag)
if (type == TypePermissions)
return true;
m_priFile->scheduleUpdate();
return true;
}
private:
QmakePriFile *m_priFile;
};
} // namespace
namespace QmakeProjectManager {
static Q_LOGGING_CATEGORY(qmakeParse, "qtc.qmake.parsing", QtWarningMsg);