• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • Plasma
  • Package
Public Member Functions | Static Public Member Functions | List of all members
Plasma::Package Class Reference

#include <Plasma/Package>

Public Member Functions

 Package ()
 
 Package (const QString &packageRoot, const QString &package, PackageStructure::Ptr structure)
 
 Package (const QString &packagePath, PackageStructure::Ptr structure)
 
 Package (const Package &other)
 
 ~Package ()
 
QString contentsHash () const
 
QStringList entryList (const char *fileType) const
 
QString filePath (const char *fileType, const QString &filename) const
 
QString filePath (const char *fileType) const
 
bool isPublished () const
 
bool isValid () const
 
PackageMetadata metadata () const
 
Package & operator= (const Package &rhs)
 
const QString path () const
 
void publish (AnnouncementMethods methods, const QString &name)
 
void setPath (const QString &path)
 
const PackageStructure::Ptr structure () const
 
void unpublish (const QString &name=QString())
 

Static Public Member Functions

static bool createPackage (const PackageMetadata &metadata, const QString &source, const QString &destination, const QString &icon=QString())
 
static bool installPackage (const QString &package, const QString &packageRoot, const QString &servicePrefix)
 
static QStringList listInstalled (const QString &packageRoot)
 
static QStringList listInstalledPaths (const QString &packageRoot)
 
static bool registerPackage (const PackageMetadata &data, const QString &iconPath)
 
static bool uninstallPackage (const QString &package, const QString &packageRoot, const QString &servicePrefix)
 

Detailed Description

object representing an installed Plasmagik package

Definition at line 42 of file package.h.

Constructor & Destructor Documentation

Plasma::Package::Package ( )
explicit

Default constructor that creates an invalid Package.

Since
4.6

Definition at line 113 of file package.cpp.

Plasma::Package::Package ( const QString &  packageRoot,
const QString &  package,
PackageStructure::Ptr  structure 
)

Construct a Package object.

Parameters
packageRootpath to the package installation root
packagethe name of the package
structurethe package structure describing this package

Definition at line 118 of file package.cpp.

Plasma::Package::Package ( const QString &  packagePath,
PackageStructure::Ptr  structure 
)

Construct a Package object.

Parameters
packagePathfull path to the package directory
structurethe package structure describing this package

Definition at line 124 of file package.cpp.

Plasma::Package::Package ( const Package &  other)

Copy constructore.

Since
4.6

Definition at line 129 of file package.cpp.

Plasma::Package::~Package ( )

Definition at line 134 of file package.cpp.

Member Function Documentation

QString Plasma::Package::contentsHash ( ) const
Returns
a SHA1 hash digest of the contents of the package in hexadecimal form
Since
4.4

Definition at line 368 of file package.cpp.

bool Plasma::Package::createPackage ( const PackageMetadata &  metadata,
const QString &  source,
const QString &  destination,
const QString &  icon = QString() 
)
static

Creates a package based on the metadata from the files contained in the source directory.

Parameters
metadatadescription of the package to create
sourcepath to local directory containing the individual files to be added to the package
destinationpath to the package that should be created
iconpath to the package icon

Definition at line 693 of file package.cpp.

QStringList Plasma::Package::entryList ( const char *  fileType) const

Get the list of files of a given type.

Parameters
fileTypethe type of file to look for, as defined in the package structure.
Returns
list of files by name, suitable for passing to filePath

Definition at line 281 of file package.cpp.

QString Plasma::Package::filePath ( const char *  fileType,
const QString &  filename 
) const

Get the path to a given file.

Parameters
fileTypethe type of file to look for, as defined in the package structure
filenamethe name of the file
Returns
path to the file on disk. QString() if not found.

Definition at line 213 of file package.cpp.

QString Plasma::Package::filePath ( const char *  fileType) const

Get the path to a given file.

Parameters
fileTypethe type of file to look for, as defined in the package structure. The type must refer to a file in the package structure and not a directory.
Returns
path to the file on disk. QString() if not found

Definition at line 276 of file package.cpp.

bool Plasma::Package::installPackage ( const QString &  package,
const QString &  packageRoot,
const QString &  servicePrefix 
)
static

Installs a package.

Parameters
packagepath to the Plasmagik package
packageRootpath to the directory where the package should be installed to
servicePrefixthe prefix for the desktop file, so as not to interfere with unrelated services (eg: "plasma-applet-"). If no prefix is set (e.g. a QString() is passed in), then the package will NOT be registered as a service
Returns
true on successful installation, false otherwise

Definition at line 464 of file package.cpp.

bool Plasma::Package::isPublished ( ) const
Returns
whether or not this service is currently published on the network.
bool Plasma::Package::isValid ( ) const
Returns
true if all the required components as defined in the PackageStructure exist

Definition at line 148 of file package.cpp.

QStringList Plasma::Package::listInstalled ( const QString &  packageRoot)
static

Returns a list of all installed packages by name.

Parameters
packageRootpath to the directory where Plasmagik packages have been installed to
Returns
a list of installed Plasmagik packages

Definition at line 423 of file package.cpp.

QStringList Plasma::Package::listInstalledPaths ( const QString &  packageRoot)
static

Returns a list of all paths of installed packages in the given root.

Parameters
packageRootpath to the directory where Plasmagik packages have been installed to
Returns
a list of installed Plasmagik packages by path

Definition at line 444 of file package.cpp.

PackageMetadata Plasma::Package::metadata ( ) const
Returns
the package metadata object.

Definition at line 290 of file package.cpp.

Package & Plasma::Package::operator= ( const Package &  rhs)

Assignment operator.

Since
4.6

Definition at line 139 of file package.cpp.

const QString Plasma::Package::path ( ) const
Returns
the path to the root of this particular package

Definition at line 304 of file package.cpp.

void Plasma::Package::publish ( AnnouncementMethods  methods,
const QString &  name 
)

Publish this package on the network.

Parameters
methodsthe ways to announce this package on the network.
bool Plasma::Package::registerPackage ( const PackageMetadata &  data,
const QString &  iconPath 
)
static

Registers a package described by the given desktop file.

Parameters
thefull path to the desktop file (must be KPluginInfo compatible)
Returns
true on success, false on failure

Definition at line 661 of file package.cpp.

void Plasma::Package::setPath ( const QString &  path)

Sets the path to the root of this package.

Parameters
pathand absolute path
Since
4.3

Definition at line 299 of file package.cpp.

const PackageStructure::Ptr Plasma::Package::structure ( ) const
Returns
the PackageStructure use in this Package

Definition at line 309 of file package.cpp.

bool Plasma::Package::uninstallPackage ( const QString &  package,
const QString &  packageRoot,
const QString &  servicePrefix 
)
static

Uninstalls a package.

Parameters
packagepath to the Plasmagik package
packageRootpath to the directory where the package should be installed to
servicePrefixthe prefix for the desktop file, so as not to interfere with unrelated services (eg: "plasma-applet-")
Returns
true on successful uninstallation, false otherwise

Definition at line 628 of file package.cpp.

void Plasma::Package::unpublish ( const QString &  name = QString())

Remove this package from the network.


The documentation for this class was generated from the following files:
  • package.h
  • package.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal