Development/Tutorials/K Hot New Stuff2: Difference between revisions

From KDE TechBase
(First part of first draft)
 
mNo edit summary
Line 7: Line 7:
There are a many good examples for how to use khotnewstuff2 in the KDE-Edu module.  Look at their source code for examples if needed, but it's basically a 2-part process to get download into your app.
There are a many good examples for how to use khotnewstuff2 in the KDE-Edu module.  Look at their source code for examples if needed, but it's basically a 2-part process to get download into your app.


1. First write a .knsrc file.  A .knsrc file is just a file telling the library which options to use for a given application.  It also lists where providers can be found, where uploads should be sent, etc. Anyway, the format of the file is an ini file with one group:
:1. First write a .knsrc file.  A .knsrc file is just a file telling the library which options to use for a given application.  It also lists where providers can be found, where uploads should be sent, etc. Anyway, the format of the file is an ini file with one group:
<nowiki>
<code>
 
[KNewStuff2]
[KNewStuff2]
ProvidersUrl=
ProvidersUrl=
InstallationCommand=
InstallationCommand=
Uncompress=
Uncompress=
</code>


</nowiki>
:'''NOTE''': InstallationCommand is optional, and if included will be invoked after each item is downloaded.
 
:'''NOTE''': Uncompress is optional, and if included will try to uncompress all downloads into the target folder according to the mime-type of the file.
NOTE: InstallationCommand is optional, and if included will be invoked after each item is downloaded.
NOTE: Uncompress is optional, and if included will try to uncompress all downloads into the target folder according to the mime-type of the file.


One of the following to tell where downloads should go:
One of the following to tell where downloads should go:
<nowiki>
<code>
TargetDir=
TargetDir=
InstallPath=
InstallPath=
StandardResource=
StandardResource=
</nowiki>
</code>


And the following values are currently read, though not used yet:
And the following values are currently read, though not used yet:
<nowiki>
<code>
CustomName=
CustomName=
CachePolicy=
CachePolicy=
Line 37: Line 32:
SignaturePolicy=
SignaturePolicy=
Scope=
Scope=
</nowiki>
</code>

Revision as of 03:25, 11 February 2008

The page that used to be here was all KDE3 specific information, so I figured it was about time to start a new one.

Terminology

First some basic terminology just to get us all on the same page. KHotNewStuff2 is the new library that implements the GHNS freedesktop.org specification for downloading and uploading user data. It will also support DXS (Desktop Exchange Service)

Use it in your application

There are a many good examples for how to use khotnewstuff2 in the KDE-Edu module. Look at their source code for examples if needed, but it's basically a 2-part process to get download into your app.

1. First write a .knsrc file. A .knsrc file is just a file telling the library which options to use for a given application. It also lists where providers can be found, where uploads should be sent, etc. Anyway, the format of the file is an ini file with one group:

[KNewStuff2] ProvidersUrl= InstallationCommand= Uncompress=

NOTE: InstallationCommand is optional, and if included will be invoked after each item is downloaded.
NOTE: Uncompress is optional, and if included will try to uncompress all downloads into the target folder according to the mime-type of the file.

One of the following to tell where downloads should go: TargetDir= InstallPath= StandardResource=

And the following values are currently read, though not used yet: CustomName= CachePolicy= ChecksumPolicy= SignaturePolicy= Scope=