It's basically a port of #10951 to the new start page implementation.
Note: Icon files are not removed but re-used instead.
The commit adds some new functions:
* getThumbnailsImage()
Returns the name of the PNG inside a project file
* getThumbnailsName()
Returns the directory name containing the image files
* getThumnailsParentDir()
Returns the parent directory of the directory containing the image files
* getThumbnailsDir()
Returns the path to the thumbnail directory. There is no need to always create a unique directory
after each restart because it doesn't harm if the thumbnail directoy contains deprecated files.
* createThumbnailsDir()
Creates the thumbnail directoy if it doesn't exist yet.
* getSha1Hash
Helper function to compute a SHA-1 hash of a given path. If the same path is passed
then the hash value will be the same.
This way it can be avoided to create a different image file from a project file
after each restart.
* getUniquePNG
Computes the path of a PNG image file for a given project file. It's also possible
to pass an arbitrary string as argument.
* useCachedPNG
If the PNG image exists and if it's newer than the project file True is returned
and False otherwise.
For a given project file it is checked if the thumbnail directory already contains
a cached image. If it's newer than the project file it will used, otherwise it will
be re-created.
Fix freecadCanOpen() abd DisplayedFilesModel::addFile() to also check for lower-case
file extensions.
* Fix syntax warnings about invalid escape sequences
Backspaces in regular expressions were not escaped properly leading to warnings on every invocation of the program.
* Improve formatting of fcinfo output
* Printing of part BREP file properties (hash and size) has been made optional since these values often change without explicit user action making git diffs almost unreadable by hiding actual changes behind a flood of changed hashes because a base feature further up the history was changed. There is a new option (-p) to re-enable the printing of these file properties.
* Unformatted float outputs have been replaced with proper formatting using f-strings which round the values to a sensible number of places.
* Colors are printed in their native 0-255 range. Printing them as float brings no benefit here.
* Most string concatenation for output has been replaced with f-strings
* Fix printing of color properties
The old CAD model created by the development version of FreeCAD
(in which the Assembly workbench was used) contained joints that,
for some reason, had an empty Joint Connector 1 reference (Reference1).
This was causing an exception and a crash of the Python function
called migrationScript4. The FreeCAD Report view contained:
23:28:29 pyException: Traceback (most recent call last):
File "/FreeCAD/Mod/Assembly/JointObject.py", line 175, in onDocumentRestored
self.createProperties(joint)
File "/FreeCAD/Mod/Assembly/JointObject.py", line 181, in createProperties
self.migrationScript4(joint)
File "/FreeCAD/Mod/Assembly/JointObject.py", line 514, in migrationScript4
if hasattr(joint, "Reference1") and joint.Reference1[0] is not None:
~~~~~~~~~~~~~~~~^^^
<class 'TypeError'>: 'NoneType' object is not subscriptable
This patch attempts to avoid such exceptions by validating the type of
the property variable before accessing it.
Qt handles resize to content on double clicking the separator in the header, by default.
However this does not work in FreeCAD.
There are no comments on why this was done and is therefore treated as bug instead of feature.
Manual testing has been performed after the change and:
* Scaling by double clicking separator in header works
* Sizes are correctly stored in sheet when resizing to content
Remove implementation details of the Document class from the XMLReader class.
Instead keep an array of failed files and check them in the calling instance.
* BIM: Optimized leader UI - fixes#17284
* Correct task panel icon for BIM Leader.
* Make BIM Leader task panel title translatable.
* Use a single mode parameter for the Line class.
---------
Co-authored-by: Roy-043 <info@b-k-g.nl>