Changeset View
Changeset View
Standalone View
Standalone View
README.md
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | |||||
72 | When building Qt Quick (and in particular Kirigami) based applications, you can | 72 | When building Qt Quick (and in particular Kirigami) based applications, you can | ||
73 | use the NewStuffList item from the org.kde.newstuff import to achieve a similar | 73 | use the NewStuffList item from the org.kde.newstuff import to achieve a similar | ||
74 | functionality to KNS3::DownloadDialog. You can also use the ItemsModel directly, | 74 | functionality to KNS3::DownloadDialog. You can also use the ItemsModel directly, | ||
75 | if this is not featureful enough. Uploading is currently not exposed in KNewStuffQuick. | 75 | if this is not featureful enough. Uploading is currently not exposed in KNewStuffQuick. | ||
76 | 76 | | |||
77 | If neither of these options are powerful enough for your needs, you can access | 77 | If neither of these options are powerful enough for your needs, you can access | ||
78 | the functionality directly through the classes in the KNSCore namespace. | 78 | the functionality directly through the classes in the KNSCore namespace. | ||
79 | 79 | | |||
80 | Related information such as creation of <b>*.knsrc</b> files can be found on | 80 | Related information can be found on techbase in the [Get Hot New Stuff | ||
81 | techbase in the [Get Hot New Stuff | | |||
82 | tutorials](https://techbase.kde.org/Development/Tutorials#Get_Hot_New_Stuff). | 81 | tutorials](https://techbase.kde.org/Development/Tutorials#Get_Hot_New_Stuff). | ||
82 | | ||||
83 | ## Creating knsrc Files | ||||
84 | | ||||
85 | KNewStuff's engine is configured by a .knsrc file containing the KHotNewStuff configuration. | ||||
86 | The following is not an exhaustive list of options, as there are many tweaks which can | ||||
87 | be found in the KNSCore::Engine documentation (such as installation and adoption commands, and | ||||
88 | tag filters). | ||||
89 | | ||||
90 | Your application should install a file called: `$KDEDIR/share/config/appname.knsrc` | ||||
91 | The file could look like this for wallpapers: | ||||
92 | | ||||
93 | [KNewStuff3] | ||||
94 | Categories=KDE Wallpaper 1920x1200,KDE Wallpaper 1600x1200 | ||||
95 | StandardResource=wallpaper | ||||
96 | Uncompress=archive | ||||
97 | | ||||
98 | Uncompress can be one of: always, never, archive, or subdir: | ||||
99 | | ||||
100 | * *always* - assume all downloaded files are archives and need to be extracted | ||||
101 | * *never* - never try to extract the file | ||||
102 | * *archive* - if the file is an archive, uncompress it, otherwise just pass it on | ||||
103 | * *subdir* - logic as archive, but decompress into a subdirectory named after the payload filename | ||||
104 | | ||||
105 | You have different options to set the target install directory: | ||||
106 | | ||||
107 | * *StandardResource* - not available in KF5, use XdgTargetDir instead. | ||||
108 | * *TargetDir* - since KF5, this is equivalent to XdgTargetDir. | ||||
109 | * *XdgTargetDir* - a directory in the $XDG_DATA_HOME directory such as `.local/share/wallpapers`. | ||||
110 | This is what `QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + name` will return. | ||||
111 | | ||||
112 | If you expect to be using a service other than the KDE Store (such as for example if you wish to use | ||||
113 | a static XML feed), you will also need to specify a ProvidersUrl entry. As an example, the one implied | ||||
114 | when using the KDE Store is: | ||||
115 | | ||||
116 | ProvidersUrl=https://autoconfig.kde.org/ocs/providers.xml | ||||
117 | | ||||
118 | However, again, this should only be done in the case you do not want to use the KDE Store. | ||||
119 | | ||||
120 | *Note* - If you are targeting old versions of the KNewStuff and Attica frameworks, prior to | ||||
121 | version 5.67 and expect to be able to run on systems without Plasma Desktop installed, you | ||||
122 | should set a ProvidersUrl, since the code responsible for providing this default did not | ||||
123 | exist before then outside of the attica-kde plugin. |