Skip to content

Rework UploadDialog, add QML version, and a new ProvidersModel

Since there are no longer any services available that actually provide the upload functionality used by UploadDialog, and because that functionality is essentially conceptually broken (the method used is highly susceptible to being employed as a spam vector), any replacement system would not use the existing methodology anyway, and consequently we might as well replace the dialog with something that is actually helpful and useful. This patch, then, replaces the old dialog with a QML based one (so we can implement it there when the time comes, and end up with full functionality in both locations rather than duplicating functionality).

This introduces a few new things, such as a ProvidersModel which can be used to display information about providers the Engine is aware of, in a fashion that is reasonably pleasant. It also introduces a new component to KNewStuffQuick, the UploadPage, which is a Kirigami.ScrollablePage which shows the user how to add content on each provider (with specific attention to make the KDE Store instructions explicit). It further changes the old KNS3::UploadDialog so that it uses the QtQuick version instead, which is intended to be transparent to the API users. Finally, it introduces a default-enabled Upload... action to NewStuff.Page, which helps us expose users to the ability to add their own stuff if they've got anything hot and new to show the world.

While updating the information (in case it has not already been done):

image

When the loading has been completed and the engine is idle:

image

What it looks like when there's an icon set for the provider

image

Running the upload dialog tester with the multi-provider test config

The following command, when run from your build dir in knewstuff, should yield a similar result to the screenshot below:

QT_LOGGING_RULES="kf.newstuff*=true" ./bin/khotnewstuff_upload ../tests/testdata/testconfig.knsrc

image

The Upload... action on NewStuff.Page in desktop mode:

image

The button when using a Dialog, rather than pushing a Page onto a "normal" page stack

image

Edited by Dan Leinir Turthra Jensen

Merge request reports