Hi all,
I have a large project with 200+ resource files (mostly pixmaps) and need to do refactoring/directory structure changes.
Now my pixmaps are used all over the code base with typical qrc reference paths: ":/master/arrow_16x16/right/background/arrow_right_middle.png", both in cpps and ui-files.
When I now modify my qrc file and move the referenced pixmaps in the directory structure, I have several situations:
- pixmap is referenced in qrc and correctly used in the source code
- source code contains invalid qrc-path (not detected at compile time, and difficult to find through testing)
- pixmap is referenced in qrc but nowhere used (i.e. unused and could be deleted)
- pixmap is in directory structure but not (yet) referenced in qrc (i.e. unused and could be deleted)
Obviously, cases 2 to 4 are suboptimal, yet, it is very time consuming to detect such problems and clean out the code base and directory structure.
Does anyone know of a tool/script that:
- scans a base directory of resources
- reads a project's qrc file (or files)
- scans the source code (cpp and ui) for string constants with pattern ":/*.png" or any other suitable extension
and then prints out a nice summary of all resources used and unused and files, i.e. the 4 categories above?
Thanks for any suggestions,
Andreas
Bookmarks