kdecore: remove custom license support leftovers

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-08-10 20:08:54 +03:00
parent fa51ecdfaf
commit d55f6589fb
3 changed files with 10 additions and 66 deletions

View file

@ -130,13 +130,9 @@ class KAboutLicense::Private : public QSharedData
{
public:
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);
public:
enum KAboutData::LicenseKey _licenseKey;
KLocalizedString _licenseText;
QString _pathToLicenseTextFile;
// needed for access to the possibly changing copyrightStatement()
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)
: QSharedData(other),
_licenseKey( other._licenseKey ),
_licenseText( other._licenseText ),
_pathToLicenseTextFile( other._pathToLicenseTextFile ),
_aboutData( other._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)
: d(other.d)
{
}
KAboutLicense::~KAboutLicense()
{}
{
}
QString KAboutLicense::text() const
{
@ -210,9 +180,6 @@ QString KAboutLicense::text() const
QString pathToFile;
switch ( d->_licenseKey )
{
case KAboutData::License_File:
pathToFile = d->_pathToLicenseTextFile;
break;
case KAboutData::License_GPL_V2:
knownLicense = true;
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/GPL_V2"));
@ -237,16 +204,11 @@ QString KAboutLicense::text() const
knownLicense = true;
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/LGPL_V3"));
break;
case KAboutData::License_Custom:
if (!d->_licenseText.isEmpty()) {
result = d->_licenseText.toString();
break;
}
// fall through
default:
result += i18n("No licensing terms for this program have been specified.\n"
"Please check the documentation or the source for any\n"
"licensing terms.\n");
break;
}
if (knownLicense) {
@ -298,12 +260,9 @@ QString KAboutLicense::name(KAboutData::NameFormat formatName) const
licenseShort = i18nc("@item license (short name)","LGPL v3");
licenseFull = i18nc("@item license","GNU Lesser General Public License Version 3");
break;
case KAboutData::License_Custom:
case KAboutData::License_File:
licenseShort = licenseFull = i18nc("@item license","Custom");
break;
default:
licenseShort = licenseFull = i18nc("@item license","Not specified");
break;
}
const QString result =
@ -353,7 +312,7 @@ KAboutLicense KAboutLicense::byKeyword(const QString &rawKeyword)
keyword.remove(QLatin1Char('.'));
KAboutData::LicenseKey license = ldict.value(keyword.toLatin1(),
KAboutData::License_Custom);
KAboutData::License_Unknown);
return KAboutLicense(license, 0);
}

View file

@ -166,8 +166,6 @@ class KDECORE_EXPORT KAboutData
*/
enum LicenseKey // KDE5: move to KAboutLicense, cut License_ prefix
{
License_Custom = -2,
License_File = -1,
License_Unknown = 0,
License_GPL = 1,
License_GPL_V2 = 1,
@ -630,9 +628,8 @@ public:
* 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.
* If there is no match for the keyword, an invalid license object is
* returned (KAboutData::License_Unknown).
*
* @param keyword The license keyword.
* @return The license object.
@ -647,14 +644,6 @@ private:
* @internal Used by KAboutData to construct a predefined license.
*/
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;
QSharedDataPointer<Private> d;

View file

@ -230,11 +230,7 @@ class KDECORE_EXPORT KPluginInfo
/**
* @return The full license object, according to the license keyword.
* It can be used to present friendlier and more detailed
* license info to the user, when the license is one of the
* 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).
* license info to the user.
*
* @see KAboutLicense::byKeyword()
* @since 4.1