- I used Unsplash Source API (unlimited, public) instead of parsing HTML. It should be faster and more reliable. (Parsing HTML may break anytime they update their website...)
- Create UnsplashBaseProvider, which has collectionId in constructor. Extend it in children classes to support different collections. Now support all wallpaper collections.
- Group Reviewers
- R114:fe8c40dc3b9a: Attempt to support different collections of Unsplash
I also feel this is better. We can even provide preview thumbnails before users choose a wallpaper collection. The only disadvantage is that I have to write a new wallpaper plugin and its UI.
The new change try to add a new ComboBox "Category" and pass the value to PODT data engine. This also introduced a new configuration option. But now it makes plasmashell crash without useful error output.
Tried it out. My reaction is: "Wow, this is really nice."
One UI improvement I could see is to allow multi-selection of categories, so for example you could see images from all the nature-related categories but not Car or Sports.
The way I'd envision this working is that instead of a combo box, a label would display the currently selected categories. Next to it would be a button labeled "Change categories" that would use the multi-page KCM API to take the user to another page with a checkbox for each category. This page would allow selecting any assortment of categories, which would then be listed on the main page. It would be sort of like the corner selector UI in the new Notifications KCM.
Anyway, that's definitely a nice-to-have, and this seems fine from a functional and UI perspective already.
Multi-selection might be difficult to implement in back end. The Unsplash Source API I use only supports a single collection ID. Search API might support multiple keywords, but it is like "AND" logic, not "OR" logic. So for now, I cannot achieve this function.
The lack of error handling and else blocks for all the ifs in this new code makes me feel a bit nervous.
Since this is only used once, you don't need to make it a function; just put all of this stuff in the Component.onCompleted: directly
date is optional, so if it not found, just leave it as undefined. I can add some detection to toString() function, in case they passed some non-string args. mach() should be safe.