When installing to a temporary dir, there could be file name clashes
as the plain temporary dir path was used, with no further namespacing.
So if e.g. some other user on the same system had downloaded the same
resource before, that existing file due to its file rights would even
prevent the installation.
Details
- Reviewers
leinir apol - Group Reviewers
Frameworks
Installing, updating, deleting and reinstalling widget themes, window
themes, color themes as different users works.
Diff Detail
- Repository
- R304 KNewStuff
- Branch
- avoidtmpinstallclashes
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 9935 Build 9953: arc lint + arc unit
Found a flaw: this will result in a different path on every call of the method for the same object, which can happen. Needs more thought.
So the solution would be to cache the calculated result. Which would also allow to have this as flag for some proper post-install cleanup once that is sorted out and defined.
Problem is: KNSCore::Installation is an exported class, with an installed header. So it would need to stay binary compatible.
Unless we give the comment "@internal" in the class documentation more emphasis. Not sure though if people have been aware of that, given the resulting API dox page does not carry that information bit: https://api.kde.org/frameworks/knewstuff/html/classKNSCore_1_1Installation.html
Now does the class not have a pimpl implementation, so we could simply add another data item.
Another option would be to reuse the existing set of directory/path members for the different installation dir types, where only one of is used. By the cost of a bit more fragile logic due to the abuse, but what else could be done?
Not having looked more at this for some months, and will not do in foreseeable future, so abandoning to clean up stack.