UI improvements for "Force Full Update" action of problem reporter
Needs RevisionPublic

Authored by antonanikin on Mar 21 2018, 11:37 AM.

Details

Reviewers
kfunk
Group Reviewers
KDevelop
Summary

New version adds mechanism for temporarily blocking (disabling) "Force Full Update" button when model reset is started. This is done with using new ProblemModel::featuresChanged() signal which emitted by standard problem reporter and cppcheck plugins at start/end of analysis.

Old version always draw "Force Full Update" button in enabled state which is confusing when update is already running.

Based on the D11081 revision.

Test Plan

Works as expected

Diff Detail

Repository
R32 KDevelop
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
antonanikin requested review of this revision.Mar 21 2018, 11:37 AM
antonanikin created this revision.
antonanikin edited the summary of this revision. (Show Details)Mar 21 2018, 11:40 AM
kfunk requested changes to this revision.Mar 22 2018, 6:33 AM
kfunk added a subscriber: kfunk.

LGTM in general, but please do see my remark.

plugins/problemreporter/problemreportermodel.cpp
111

Kind of scary to have this regexp in this class here... What's the problem when .patch files are actually being updated? I guess we just get a runtime warning? If so, then I'd rather just remove this regexp here... Or find another way to detect these non-user documents more cleanly.

This revision now requires changes to proceed.Mar 22 2018, 6:33 AM
antonanikin added inline comments.Mar 22 2018, 9:12 AM
plugins/problemreporter/problemreportermodel.cpp
111

The main problem with .patch files is that the BackgroundParser does not emit parseJobFinished signal for them. Therefore m_fullUpdateDocuments will be not-empty at the end of parsing :(

Quick-and-dirty way to detect such filename without QRegularExpression may be somethig like:

static const QString vcsDiffFilePrefix(QLatin1String("kdevelop_"));
static const QString vcsDiffFileSuffix(QLatin1String(".patch"));

auto fileName = url.fileName();
if (fileName.size() == (vcsDiffFilePrefix.size() + vcsDiffFileSuffix.size() + 6) && 
    fileName.startsWith(vcsDiffFilePrefix) &&
    fileName.endsWith(vcsDiffFilePrefix)) {
    // our stuff ...
}

Also I don't know when such .patch files are created - sometimes they are exists, sometimes - not. Do you know some some step-to-reproduce actions for force .patch files creation? This can help me to make some tests and find more beautiful solution.

kfunk added inline comments.Mar 22 2018, 10:12 AM
plugins/problemreporter/problemreportermodel.cpp
111

The regex itself isn't the problem. The problem is that we need to have this check/filter here altogether.

m_fullUpdateDocuments should never contain these .patch files (or IOW the problem store should never contain it) to begin with. Do you agree? I don't have the full picture about how problem store gets filled, I'd need to look into that myself...