Difference between revisions of "Projects/KNS2/Handler"

< Projects‎ | KNS2
Jump to: navigation, search
 
(Proposed API)
 
(13 intermediate revisions by one user not shown)
Line 1: Line 1:
{{note|Names are just temporary. Infos can be as well. Please don't trust this page as probably most of the things are going to heavily change during this 1 month developement marathone.}}
+
{{warning|Names are just temporary. Infos can be as well. Please don't trust this page as probably most of the things are going to heavily change during this 1 month developement marathone.}}
  
= The Bundler =
+
= The Handler =
This class is meant to provide a non-GUI and non-user-input-requiring class to manage KNS packages.
+
This class is meant to provide a non-GUI and class to manage KNS packages. It's meant to be used from application themselves.
  
 
It will be able to:
 
It will be able to:
Line 8: Line 8:
 
* Map package files to standard QFiles
 
* Map package files to standard QFiles
 
* more...
 
* more...
 +
 +
=== Proposed API ===
 +
 +
* '''Handler(QString filename)''' Creates a bundler that operates on the given package. Note that the package needs to be unpacked somewhere first, so operating on a dir is much faster
 +
* '''Handler(KUrl dir)''' Creates a bundler that operates on the given directory.
 +
* '''Handler(QString packageName, QString packageVersion)''' Creates a bundler that operates on the package already installed in the standard way.
 +
* '''install()''' Extracts (installs) the package, and puts the .desktop file in $KDEHOME/services/. See [[../Layout|here]] for more informations.
 +
 +
 +
* '''initLayout()''' Initializes the layout app-wise. It should be called only once. It will use KStandardDirs::saveLocation() to create needed dirs. See [[../Layout|the layout section]] for more informations.
 +
* '''installDesktopFile()''' ''Obsoleted by install()?''
 +
* '''bool isInstalled()''' True if the package is already installed, false otherwise
 +
* '''QFile packageFile()''' Returns a QFile pointing to the zipped package.
 +
* '''QDir packageDir()''' Returns an (absolute) QDir pointing to the folder of the installed package.
 +
* ...

Latest revision as of 19:05, 24 March 2007

noframe
 
Warning
Names are just temporary. Infos can be as well. Please don't trust this page as probably most of the things are going to heavily change during this 1 month developement marathone.


[edit] The Handler

This class is meant to provide a non-GUI and class to manage KNS packages. It's meant to be used from application themselves.

It will be able to:

  • Unpack packages
  • Map package files to standard QFiles
  • more...

[edit] Proposed API

  • Handler(QString filename) Creates a bundler that operates on the given package. Note that the package needs to be unpacked somewhere first, so operating on a dir is much faster
  • Handler(KUrl dir) Creates a bundler that operates on the given directory.
  • Handler(QString packageName, QString packageVersion) Creates a bundler that operates on the package already installed in the standard way.
  • install() Extracts (installs) the package, and puts the .desktop file in $KDEHOME/services/. See here for more informations.


  • initLayout() Initializes the layout app-wise. It should be called only once. It will use KStandardDirs::saveLocation() to create needed dirs. See the layout section for more informations.
  • installDesktopFile() Obsoleted by install()?
  • bool isInstalled() True if the package is already installed, false otherwise
  • QFile packageFile() Returns a QFile pointing to the zipped package.
  • QDir packageDir() Returns an (absolute) QDir pointing to the folder of the installed package.
  • ...

This page was last modified on 24 March 2007, at 19:05. This page has been accessed 8,628 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal