The commit adds some new functions:
* getThumbnailDir()
Returns the path to the thumbnail directory which is a sub-directory of the Cache 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.
* createThumbnailDir()
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.
The changes in detail are:
1. 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.
2. For the system icon to a given file format it is only checked if the icon already exists.
If yes, it will be used.
Example Error :
File "/home/john/freecad-daily-build/Mod/Start/StartPage/StartPage.py", line 422, in handle
ALTCSS = f.read()
^^^^^^^^
File "/usr/lib/python3.11/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 421: ordinal not in range(128)
* Make StartPage new file template buttons use if instead of match
* Make StartPage Part design new file template not create a sketch
* Remove StartPage Part new file template and rename Part Design template based on community feedback
* StartPage LoadNew.py fix indentation
When starting FreeCAD for the first time, it load the HTML content of
src/Mod/Start/StartPage/StartPage.html and show it as a friendly startup page.
Unfortunately, one of the tabs in the startup page is an iframe loading the content of
https://blog.freecadorg/. The effect is that every time one start FreeCAD, it dial
home over the Internet with a HTTP request to the mentioned URL. This is a privacy
problem. At the moment the blog page in turn will connect to https//i0.wp.com/ and
https//s0.wp.com/, in effect also reporting the startup to Wordpress. Please do not
dial out without the expressed approval and on request of the user of the program.
This patch change the startup page to instead of putting the blog posts in a tab, it
will link to the blog and the connection is only established when the user click on
'BLOG' in the start page. It include a link tooltop to make it easier to understand
that this will bring the user to a new page.