mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
kdecore: remove custom license support leftovers
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
fa51ecdfaf
commit
d55f6589fb
3 changed files with 10 additions and 66 deletions
|
@ -130,13 +130,9 @@ class KAboutLicense::Private : public QSharedData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Private( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData );
|
Private( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData );
|
||||||
Private( const QString &pathToFile, const KAboutData *aboutData );
|
|
||||||
Private( const KLocalizedString &licenseText, const KAboutData *aboutData );
|
|
||||||
Private( const Private& other);
|
Private( const Private& other);
|
||||||
public:
|
public:
|
||||||
enum KAboutData::LicenseKey _licenseKey;
|
enum KAboutData::LicenseKey _licenseKey;
|
||||||
KLocalizedString _licenseText;
|
|
||||||
QString _pathToLicenseTextFile;
|
|
||||||
// needed for access to the possibly changing copyrightStatement()
|
// needed for access to the possibly changing copyrightStatement()
|
||||||
const KAboutData * _aboutData;
|
const KAboutData * _aboutData;
|
||||||
};
|
};
|
||||||
|
@ -148,29 +144,12 @@ KAboutLicense::Private::Private( enum KAboutData::LicenseKey licenseType, const
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
KAboutLicense::Private::Private( const QString &pathToFile, const KAboutData *aboutData )
|
|
||||||
: QSharedData(),
|
|
||||||
_licenseKey( KAboutData::License_File ),
|
|
||||||
_pathToLicenseTextFile( pathToFile ),
|
|
||||||
_aboutData( aboutData )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
KAboutLicense::Private::Private( const KLocalizedString &licenseText, const KAboutData *aboutData )
|
|
||||||
: QSharedData(),
|
|
||||||
_licenseKey( KAboutData::License_Custom ),
|
|
||||||
_licenseText( licenseText ),
|
|
||||||
_aboutData( aboutData )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
KAboutLicense::Private::Private(const KAboutLicense::Private& other)
|
KAboutLicense::Private::Private(const KAboutLicense::Private& other)
|
||||||
: QSharedData(other),
|
: QSharedData(other),
|
||||||
_licenseKey( other._licenseKey ),
|
_licenseKey( other._licenseKey ),
|
||||||
_licenseText( other._licenseText ),
|
|
||||||
_pathToLicenseTextFile( other._pathToLicenseTextFile ),
|
|
||||||
_aboutData( other._aboutData )
|
_aboutData( other._aboutData )
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
KAboutLicense::KAboutLicense( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData )
|
KAboutLicense::KAboutLicense( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData )
|
||||||
|
@ -178,23 +157,14 @@ KAboutLicense::KAboutLicense( enum KAboutData::LicenseKey licenseType, const KAb
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
KAboutLicense::KAboutLicense( const QString &pathToFile, const KAboutData *aboutData )
|
|
||||||
: d(new Private(pathToFile,aboutData))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
KAboutLicense::KAboutLicense( const KLocalizedString &licenseText, const KAboutData *aboutData )
|
|
||||||
: d(new Private(licenseText,aboutData))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
KAboutLicense::KAboutLicense(const KAboutLicense& other)
|
KAboutLicense::KAboutLicense(const KAboutLicense& other)
|
||||||
: d(other.d)
|
: d(other.d)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
KAboutLicense::~KAboutLicense()
|
KAboutLicense::~KAboutLicense()
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
QString KAboutLicense::text() const
|
QString KAboutLicense::text() const
|
||||||
{
|
{
|
||||||
|
@ -210,9 +180,6 @@ QString KAboutLicense::text() const
|
||||||
QString pathToFile;
|
QString pathToFile;
|
||||||
switch ( d->_licenseKey )
|
switch ( d->_licenseKey )
|
||||||
{
|
{
|
||||||
case KAboutData::License_File:
|
|
||||||
pathToFile = d->_pathToLicenseTextFile;
|
|
||||||
break;
|
|
||||||
case KAboutData::License_GPL_V2:
|
case KAboutData::License_GPL_V2:
|
||||||
knownLicense = true;
|
knownLicense = true;
|
||||||
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/GPL_V2"));
|
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/GPL_V2"));
|
||||||
|
@ -237,16 +204,11 @@ QString KAboutLicense::text() const
|
||||||
knownLicense = true;
|
knownLicense = true;
|
||||||
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/LGPL_V3"));
|
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/LGPL_V3"));
|
||||||
break;
|
break;
|
||||||
case KAboutData::License_Custom:
|
|
||||||
if (!d->_licenseText.isEmpty()) {
|
|
||||||
result = d->_licenseText.toString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// fall through
|
|
||||||
default:
|
default:
|
||||||
result += i18n("No licensing terms for this program have been specified.\n"
|
result += i18n("No licensing terms for this program have been specified.\n"
|
||||||
"Please check the documentation or the source for any\n"
|
"Please check the documentation or the source for any\n"
|
||||||
"licensing terms.\n");
|
"licensing terms.\n");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (knownLicense) {
|
if (knownLicense) {
|
||||||
|
@ -298,12 +260,9 @@ QString KAboutLicense::name(KAboutData::NameFormat formatName) const
|
||||||
licenseShort = i18nc("@item license (short name)","LGPL v3");
|
licenseShort = i18nc("@item license (short name)","LGPL v3");
|
||||||
licenseFull = i18nc("@item license","GNU Lesser General Public License Version 3");
|
licenseFull = i18nc("@item license","GNU Lesser General Public License Version 3");
|
||||||
break;
|
break;
|
||||||
case KAboutData::License_Custom:
|
|
||||||
case KAboutData::License_File:
|
|
||||||
licenseShort = licenseFull = i18nc("@item license","Custom");
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
licenseShort = licenseFull = i18nc("@item license","Not specified");
|
licenseShort = licenseFull = i18nc("@item license","Not specified");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString result =
|
const QString result =
|
||||||
|
@ -353,7 +312,7 @@ KAboutLicense KAboutLicense::byKeyword(const QString &rawKeyword)
|
||||||
keyword.remove(QLatin1Char('.'));
|
keyword.remove(QLatin1Char('.'));
|
||||||
|
|
||||||
KAboutData::LicenseKey license = ldict.value(keyword.toLatin1(),
|
KAboutData::LicenseKey license = ldict.value(keyword.toLatin1(),
|
||||||
KAboutData::License_Custom);
|
KAboutData::License_Unknown);
|
||||||
return KAboutLicense(license, 0);
|
return KAboutLicense(license, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,8 +166,6 @@ class KDECORE_EXPORT KAboutData
|
||||||
*/
|
*/
|
||||||
enum LicenseKey // KDE5: move to KAboutLicense, cut License_ prefix
|
enum LicenseKey // KDE5: move to KAboutLicense, cut License_ prefix
|
||||||
{
|
{
|
||||||
License_Custom = -2,
|
|
||||||
License_File = -1,
|
|
||||||
License_Unknown = 0,
|
License_Unknown = 0,
|
||||||
License_GPL = 1,
|
License_GPL = 1,
|
||||||
License_GPL_V2 = 1,
|
License_GPL_V2 = 1,
|
||||||
|
@ -630,9 +628,8 @@ public:
|
||||||
* Keywords are matched by stripping all whitespace and lowercasing.
|
* Keywords are matched by stripping all whitespace and lowercasing.
|
||||||
* The known keywords correspond to the KAboutData::LicenseKey enumeration,
|
* The known keywords correspond to the KAboutData::LicenseKey enumeration,
|
||||||
* e.g. any of "LGPLV3", "LGPLv3", "LGPL v3" would match License_LGPL_V3.
|
* 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
|
* If there is no match for the keyword, an invalid license object is
|
||||||
* returned, with its name and text informing about a custom license,
|
* returned (KAboutData::License_Unknown).
|
||||||
* and its key equal to KAboutData::License_Custom.
|
|
||||||
*
|
*
|
||||||
* @param keyword The license keyword.
|
* @param keyword The license keyword.
|
||||||
* @return The license object.
|
* @return The license object.
|
||||||
|
@ -647,14 +644,6 @@ private:
|
||||||
* @internal Used by KAboutData to construct a predefined license.
|
* @internal Used by KAboutData to construct a predefined license.
|
||||||
*/
|
*/
|
||||||
explicit KAboutLicense( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData );
|
explicit KAboutLicense( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData );
|
||||||
/**
|
|
||||||
* @internal Used by KAboutData to construct license by given text
|
|
||||||
*/
|
|
||||||
explicit KAboutLicense( const QString &pathToFile, const KAboutData *aboutData );
|
|
||||||
/**
|
|
||||||
* @internal Used by KAboutData to construct license by given text
|
|
||||||
*/
|
|
||||||
explicit KAboutLicense( const KLocalizedString &licenseText, const KAboutData *aboutData );
|
|
||||||
|
|
||||||
class Private;
|
class Private;
|
||||||
QSharedDataPointer<Private> d;
|
QSharedDataPointer<Private> d;
|
||||||
|
|
|
@ -230,11 +230,7 @@ class KDECORE_EXPORT KPluginInfo
|
||||||
/**
|
/**
|
||||||
* @return The full license object, according to the license keyword.
|
* @return The full license object, according to the license keyword.
|
||||||
* It can be used to present friendlier and more detailed
|
* It can be used to present friendlier and more detailed
|
||||||
* license info to the user, when the license is one of the
|
* license info to the user.
|
||||||
* widespread within KDE. For other licenses, the license
|
|
||||||
* object will state not very useful, "custom license" info
|
|
||||||
* (this can be identified by KAboutLicense::key() returning
|
|
||||||
* KAboutData::License_Custom).
|
|
||||||
*
|
*
|
||||||
* @see KAboutLicense::byKeyword()
|
* @see KAboutLicense::byKeyword()
|
||||||
* @since 4.1
|
* @since 4.1
|
||||||
|
|
Loading…
Add table
Reference in a new issue