Skip to content

Several little fixes

Rastersoft requested to merge more_fixes into master

These patches fix five little bugs and corrects code alignment in a call:

First bug: In the current code, when the attributes or the content of a .desktop files change, it is reloaded. But if the file now contains a syntax error, it will be marked as non-desktop file. The problem is that, from now until a desktop refresh is performed, the contents won't be checked again. This means that if the user edits a .desktop file and stores it with a bug (which will render it not-launchable), fixes the error and saves it again, the .desktop file will remain as non-launchable until a desktop refresh is performed and the contents are re-read. This patch fixes this by triggering an attribute reload when the file type is .desktop.

Second bug: when a file have to create a thumbnail, it creates a watch to detect when the thumbnail has been created. In case that there is already a thumbnail being created, it removes the watch and creates a new one. Unfortunately, once the thumbnail has been created, the watch ID isn't removed, so if a new thumbnail has to be created, or when the fileItem is destroyed, the code will try to remove the old watch, and producing an error.

Third, fourth and fifth patches just nullify Cancellable objects after their associated asynchronous task has ended. This allows to free them, and also avoid calling their cancel method unnecessarily during object destruction.

Finally, the sixth patch just fixes the code alignment in one call.

Edited by Rastersoft

Merge request reports