Fix project model issues on file changes
ClosedPublic

Authored by sdepiets on Aug 24 2018, 4:07 AM.

Details

Summary

This revision fixes some issues with the Project Model refreshes

It mostly fixes behaviors which are applied to directories while they shouldn't (like cache requests for directories that return empty values, or unnecessary full regeneration).

BUG: 348757
BUG: 343371

Test Plan

I've tested the following test matrix :

  • Move/Add/Remove/Save x File or Folder
  • Within the root folder, within subfolders (same or different), between the root and a subfolder

This is for a .po project architecture, I would be interested to know if the behavior doesn't create regressions with a .po/.pot or other architecture (which might be more buggy to begin with).

Diff Detail

Repository
R456 Lokalize
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sdepiets requested review of this revision.Aug 24 2018, 4:07 AM
sdepiets created this revision.
sdepiets edited the summary of this revision. (Show Details)Aug 24 2018, 4:17 AM
sdepiets edited the test plan for this revision. (Show Details)
sdepiets added a project: Localization.

If there are no comments I will move forward with this change tomorrow

aacid added inline comments.Aug 28 2018, 8:47 PM
src/project/projectmodel.cpp
1027

i've no idea about this, but maybe use isFile instead of !isDir?

Also make fileItem const

1109

since you're moving it and causing a diff, make it const, makes reading the rest of the code easier not having to worry if it's going to change or not.

sdepiets marked 2 inline comments as done.Aug 29 2018, 2:06 AM
sdepiets added inline comments.
src/project/projectmodel.cpp
1109

understood, I'll try to remember to do that going forward

sdepiets updated this revision to Diff 40594.Aug 29 2018, 2:08 AM
sdepiets marked an inline comment as done.

Replace isNotDir by isFile + add const

This revision was not accepted when it landed; it landed in state Needs Review.Aug 29 2018, 2:10 AM
This revision was automatically updated to reflect the committed changes.