(Created page with '==Abstract== PackageStructure defines what is in a Package. This information is used to create packages and provides a way to programatically refer to the contents. It's also use...') |
m |
||
| Line 39: | Line 39: | ||
===The Header File=== | ===The Header File=== | ||
| − | + | '''testpackage.h''' | |
<code cppqt> | <code cppqt> | ||
#ifndef TESTPACKAGE_H | #ifndef TESTPACKAGE_H | ||
Contents |
PackageStructure defines what is in a Package. This information is used to create packages and provides a way to programatically refer to the contents. It's also used to provide an installation profile for you Packages.
This tool is used to get information about Packages and install, remove or upgrade them. Run
plasmapkg --help
to get a list of available options.
Every PackageStructure needs a desktop file to tell plasma what package it's defining:
plasma-packagestructure-test.desktop
[Desktop Entry]
Name=Test
Comment=Test Package Structure
Type=Service
X-KDE-ServiceTypes=Plasma/PackageStructure X-KDE-PluginInfo-Name=Plasma/Test X-KDE-Library=plasma_packagestructure_test
X-KDE-PluginInfo-Author=Farhad Hedayati Fard X-KDE-PluginInfo-Email=hf.farhad@gmail.com X-KDE-PluginInfo-Name=test X-KDE-PluginInfo-Version=0.1 X-KDE-PluginInfo-Website=http://plasma.kde.org/ X-KDE-PluginInfo-License=GPLv3+ X-KDE-PluginInfo-EnabledByDefault=true X-Plasma-PackageFileFilter=*.test X-Plasma-PackageFileMimetypes=application/zip The most important fields are:
testpackage.h
// We need this header since we are inheriting it
/**
This PackageStructe provides an structure for packages used by the test DataEngine.
class TestPackage : public Plasma::PackageStructure { public:
// Every PackageStructure needs an explicit constructor with these arguments explicit TestPackage( QObject *parent = 0, const QVariantList& args = QVariantList() );
};