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

KDECore

Public Member Functions | Static Public Member Functions | List of all members
KAboutLicense Class Reference

#include <kaboutdata.h>

Public Member Functions

 KAboutLicense (const KAboutLicense &other)
 
 ~KAboutLicense ()
 
KAboutData::LicenseKey key () const
 
QString name (KAboutData::NameFormat formatName) const
 
KAboutLicense & operator= (const KAboutLicense &other)
 
QString text () const
 

Static Public Member Functions

static KAboutLicense byKeyword (const QString &keyword)
 

Detailed Description

This class is used to store information about a license.

The license can be one of some predefined, one given as text or one that can be loaded from a file. This class is used in the KAboutData class. Explicitly creating a KAboutLicense object is not possible. If the license is wanted for a KDE component having KAboutData object, use KAboutData::licenses() to get the licenses for that component. If the license is for a non-code resource and given by a keyword (e.g. in .desktop files), try using KAboutLicense::byKeyword().

Note
Instead of the more usual i18n calls, for translatable text the ki18n calls are used to produce KLocalizedStrings, which can delay the translation lookup. This is necessary because the translation catalogs are usually not yet initialized at the point where KAboutData is constructed.

Definition at line 894 of file kaboutdata.h.

Constructor & Destructor Documentation

KAboutLicense::KAboutLicense ( const KAboutLicense &  other)

Copy constructor.

Performs a deep copy.

Parameters
otherobject to copy

Definition at line 211 of file kaboutdata.cpp.

KAboutLicense::~KAboutLicense ( )

Definition at line 216 of file kaboutdata.cpp.

Member Function Documentation

KAboutLicense KAboutLicense::byKeyword ( const QString &  keyword)
static

Fetch a known license by a keyword.

Frequently the license data is provided by a terse keyword-like string, e.g. by a field in a .desktop file. Using this method, an application can get hold of a proper KAboutLicense object, providing that the license is one of the several known to KDE, and use it to present more human-readable information to the user.

Keywords are matched by stripping all whitespace and lowercasing. The known keywords correspond to the KAboutData::LicenseKey enumeration, e.g. any of "LGPLV3", "LGPLv3", "LGPL v3" would match License_LGPL_V3. If there is no match for the keyword, a valid license object is still returned, with its name and text informing about a custom license, and its key equal to KAboutData::License_Custom.

Parameters
keywordThe license keyword.
Returns
The license object.
See also
KAboutData::LicenseKey
Since
4.1

Definition at line 357 of file kaboutdata.cpp.

KAboutData::LicenseKey KAboutLicense::key ( ) const

Returns the license key.

Returns
The license key as element of KAboutData::LicenseKey enum.
Since
4.1

Definition at line 352 of file kaboutdata.cpp.

QString KAboutLicense::name ( KAboutData::NameFormat  formatName) const

Returns the license name.

Returns
The license name as a string.

Definition at line 295 of file kaboutdata.cpp.

KAboutLicense & KAboutLicense::operator= ( const KAboutLicense &  other)

Assignment operator.

Performs a deep copy.

Parameters
otherobject to copy

Definition at line 346 of file kaboutdata.cpp.

QString KAboutLicense::text ( ) const

Returns the full license text.

If the licenseType argument of the constructor has been used, any text defined by setLicenseText is ignored, and the standard text for the chosen license will be returned.

Returns
The license text.

Definition at line 219 of file kaboutdata.cpp.


The documentation for this class was generated from the following files:
  • kaboutdata.h
  • kaboutdata.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • 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