2
* This file is part of the KDE Libraries
3
* Copyright (C) 2000 Espen Sand (espen@kde.org)
4
* Copyright (C) 2006 Nicolas GOUTTE <goutte@kde.org>
5
* Copyright (C) 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
6
* Copyright (C) 2010 Teo Mrnjavac <teo@kde.org>
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Library General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Library General Public License for more details.
18
* You should have received a copy of the GNU Library General Public License
19
* along with this library; see the file COPYING.LIB. If not, write to
20
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301, USA.
25
#include "kaboutdata.h"
27
#include "kstandarddirs.h"
28
#include "klocalizedstring.h"
30
#include <QtCore/QFile>
31
#include <QtCore/QTextIStream>
32
#include <QtCore/QSharedData>
33
#include <QtCore/QVariant>
34
#include <QtCore/QList>
37
// -----------------------------------------------------------------------------
40
// These classes deal with a lot of text, some of which needs to be
41
// marked for translation. Since at the time when these object and calls are
42
// made the translation catalogs are usually still not initialized, the
43
// translation has to be delayed. This is achieved by using KLocalizedString
44
// for translatable strings. KLocalizedStrings are produced by ki18n* calls,
45
// instead of the more usuall i18n* calls which produce QString by trying to
46
// translate immediately.
48
// All the non-translatable string arguments to methods are taken QByteArray,
49
// all the translatable are KLocalizedString. The getter methods always return
50
// proper QString: the non-translatable strings supplied by the code are
51
// treated with QString::fromUtf8(), those coming from the outside with
52
// QTextCodec::toUnicode(), and translatable strings are finalized to QStrings
53
// at the point of getter calls (i.e. delayed translation).
54
// -----------------------------------------------------------------------------
56
class KAboutPerson::Private
59
KLocalizedString _name;
60
KLocalizedString _task;
61
QString _emailAddress;
68
KAboutPerson::KAboutPerson( const KLocalizedString &_name,
69
const KLocalizedString &_task,
70
const QByteArray &_emailAddress,
71
const QByteArray &_webAddress )
76
d->_emailAddress = QString::fromUtf8(_emailAddress);
77
d->_webAddress = QString::fromUtf8(_webAddress);
80
KAboutPerson::KAboutPerson( const KLocalizedString &_name,
81
const KLocalizedString &_task,
82
const QByteArray &_emailAddress,
83
const QByteArray &_webAddress,
84
const QByteArray &_ocsUsername )
89
d->_emailAddress = QString::fromUtf8(_emailAddress);
90
d->_webAddress = QString::fromUtf8(_webAddress);
91
d->_ocsUsername = QString::fromUtf8( _ocsUsername );
94
KAboutPerson::KAboutPerson( const QString &_name, const QString &_email )
98
d->_emailAddress = _email;
101
KAboutPerson::KAboutPerson(const KAboutPerson& other): d(new Private)
106
KAboutPerson::~KAboutPerson()
111
QString KAboutPerson::name() const
113
if (!d->_nameNoop.isEmpty())
115
return d->_name.toString();
118
QString KAboutPerson::task() const
120
if (!d->_task.isEmpty())
121
return d->_task.toString();
125
QString KAboutPerson::emailAddress() const
127
return d->_emailAddress;
131
QString KAboutPerson::webAddress() const
133
return d->_webAddress;
136
QString KAboutPerson::ocsUsername() const
138
return d->_ocsUsername;
141
KAboutPerson &KAboutPerson::operator=(const KAboutPerson& other)
149
class KAboutLicense::Private : public QSharedData
152
Private( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData );
153
Private( const QString &pathToFile, const KAboutData *aboutData );
154
Private( const KLocalizedString &licenseText, const KAboutData *aboutData );
155
Private( const Private& other);
157
enum KAboutData::LicenseKey _licenseKey;
158
KLocalizedString _licenseText;
159
QString _pathToLicenseTextFile;
160
// needed for access to the possibly changing copyrightStatement()
161
const KAboutData * _aboutData;
164
KAboutLicense::Private::Private( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData )
166
_licenseKey( licenseType ),
167
_aboutData( aboutData )
171
KAboutLicense::Private::Private( const QString &pathToFile, const KAboutData *aboutData )
173
_licenseKey( KAboutData::License_File ),
174
_pathToLicenseTextFile( pathToFile ),
175
_aboutData( aboutData )
179
KAboutLicense::Private::Private( const KLocalizedString &licenseText, const KAboutData *aboutData )
181
_licenseKey( KAboutData::License_Custom ),
182
_licenseText( licenseText ),
183
_aboutData( aboutData )
187
KAboutLicense::Private::Private(const KAboutLicense::Private& other)
188
: QSharedData(other),
189
_licenseKey( other._licenseKey ),
190
_licenseText( other._licenseText ),
191
_pathToLicenseTextFile( other._pathToLicenseTextFile ),
192
_aboutData( other._aboutData )
196
KAboutLicense::KAboutLicense( enum KAboutData::LicenseKey licenseType, const KAboutData *aboutData )
197
: d(new Private(licenseType,aboutData))
201
KAboutLicense::KAboutLicense( const QString &pathToFile, const KAboutData *aboutData )
202
: d(new Private(pathToFile,aboutData))
206
KAboutLicense::KAboutLicense( const KLocalizedString &licenseText, const KAboutData *aboutData )
207
: d(new Private(licenseText,aboutData))
211
KAboutLicense::KAboutLicense(const KAboutLicense& other)
216
KAboutLicense::~KAboutLicense()
219
QString KAboutLicense::text() const
223
const QString lineFeed = QString::fromLatin1( "\n\n" );
225
if (d->_aboutData && !d->_aboutData->copyrightStatement().isEmpty()) {
226
result = d->_aboutData->copyrightStatement() + lineFeed;
229
bool knownLicense = false;
231
switch ( d->_licenseKey )
233
case KAboutData::License_File:
234
pathToFile = d->_pathToLicenseTextFile;
236
case KAboutData::License_GPL_V2:
238
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/GPL_V2"));
240
case KAboutData::License_LGPL_V2:
242
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/LGPL_V2"));
244
case KAboutData::License_BSD:
246
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/BSD"));
248
case KAboutData::License_Artistic:
250
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/ARTISTIC"));
252
case KAboutData::License_QPL_V1_0:
254
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/QPL_V1.0"));
256
case KAboutData::License_GPL_V3:
258
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/GPL_V3"));
260
case KAboutData::License_LGPL_V3:
262
pathToFile = KStandardDirs::locate("data", QString::fromLatin1("LICENSES/LGPL_V3"));
264
case KAboutData::License_Custom:
265
if (!d->_licenseText.isEmpty()) {
266
result = d->_licenseText.toString();
271
result += i18n("No licensing terms for this program have been specified.\n"
272
"Please check the documentation or the source for any\n"
273
"licensing terms.\n");
277
result += i18n("This program is distributed under the terms of the %1.", name(KAboutData::ShortName));
278
if (!pathToFile.isEmpty()) {
283
if (!pathToFile.isEmpty()) {
284
QFile file(pathToFile);
285
if (file.open(QIODevice::ReadOnly)) {
286
QTextStream str(&file);
287
result += str.readAll();
295
QString KAboutLicense::name(KAboutData::NameFormat formatName) const
297
QString licenseShort;
300
switch (d->_licenseKey) {
301
case KAboutData::License_GPL_V2:
302
licenseShort = i18nc("@item license (short name)","GPL v2");
303
licenseFull = i18nc("@item license","GNU General Public License Version 2");
305
case KAboutData::License_LGPL_V2:
306
licenseShort = i18nc("@item license (short name)","LGPL v2");
307
licenseFull = i18nc("@item license","GNU Lesser General Public License Version 2");
309
case KAboutData::License_BSD:
310
licenseShort = i18nc("@item license (short name)","BSD License");
311
licenseFull = i18nc("@item license","BSD License");
313
case KAboutData::License_Artistic:
314
licenseShort = i18nc("@item license (short name)","Artistic License");
315
licenseFull = i18nc("@item license","Artistic License");
317
case KAboutData::License_QPL_V1_0:
318
licenseShort = i18nc("@item license (short name)","QPL v1.0");
319
licenseFull = i18nc("@item license","Q Public License");
321
case KAboutData::License_GPL_V3:
322
licenseShort = i18nc("@item license (short name)","GPL v3");
323
licenseFull = i18nc("@item license","GNU General Public License Version 3");
325
case KAboutData::License_LGPL_V3:
326
licenseShort = i18nc("@item license (short name)","LGPL v3");
327
licenseFull = i18nc("@item license","GNU Lesser General Public License Version 3");
329
case KAboutData::License_Custom:
330
case KAboutData::License_File:
331
licenseShort = licenseFull = i18nc("@item license","Custom");
334
licenseShort = licenseFull = i18nc("@item license","Not specified");
337
const QString result =
338
(formatName == KAboutData::ShortName ) ? licenseShort :
339
(formatName == KAboutData::FullName ) ? licenseFull :
346
KAboutLicense &KAboutLicense::operator=(const KAboutLicense& other)
352
KAboutData::LicenseKey KAboutLicense::key() const
354
return d->_licenseKey;
357
KAboutLicense KAboutLicense::byKeyword(const QString &rawKeyword)
359
// Setup keyword->enum dictionary on first call.
360
// Use normalized keywords, by the algorithm below.
361
static QHash<QByteArray, KAboutData::LicenseKey> ldict;
362
if (ldict.isEmpty()) {
363
ldict.insert("gpl", KAboutData::License_GPL);
364
ldict.insert("gplv2", KAboutData::License_GPL_V2);
365
ldict.insert("gplv2+", KAboutData::License_GPL_V2);
366
ldict.insert("lgpl", KAboutData::License_LGPL);
367
ldict.insert("lgplv2", KAboutData::License_LGPL_V2);
368
ldict.insert("lgplv2+", KAboutData::License_LGPL_V2);
369
ldict.insert("bsd", KAboutData::License_BSD);
370
ldict.insert("artistic", KAboutData::License_Artistic);
371
ldict.insert("qpl", KAboutData::License_QPL);
372
ldict.insert("qplv1", KAboutData::License_QPL_V1_0);
373
ldict.insert("qplv10", KAboutData::License_QPL_V1_0);
374
ldict.insert("gplv3", KAboutData::License_GPL_V3);
375
ldict.insert("gplv3+", KAboutData::License_GPL_V3);
376
ldict.insert("lgplv3", KAboutData::License_LGPL_V3);
377
ldict.insert("lgplv3+", KAboutData::License_LGPL_V3);
380
// Normalize keyword.
381
QString keyword = rawKeyword;
382
keyword = keyword.toLower();
383
keyword.remove(QLatin1Char(' '));
384
keyword.remove(QLatin1Char('.'));
386
KAboutData::LicenseKey license = ldict.value(keyword.toLatin1(),
387
KAboutData::License_Custom);
388
return KAboutLicense(license, 0);
392
class KAboutData::Private
396
: customAuthorTextEnabled(false)
399
KLocalizedString _programName;
400
KLocalizedString _shortDescription;
401
QByteArray _catalogName;
402
KLocalizedString _copyrightStatement;
403
KLocalizedString _otherText;
404
QString _homepageAddress;
405
QList<KAboutPerson> _authorList;
406
QList<KAboutPerson> _creditList;
407
QList<KAboutLicense> _licenseList;
408
KLocalizedString translatorName;
409
KLocalizedString translatorEmail;
411
QString programIconName;
412
QVariant programLogo;
413
KLocalizedString customAuthorPlainText, customAuthorRichText;
414
bool customAuthorTextEnabled;
416
QString organizationDomain;
417
QByteArray _ocsProviderUrl;
419
// Everything dr.konqi needs, we store as utf-8, so we
420
// can just give it a pointer, w/o any allocations.
421
QByteArray _translatedProgramName; // ### I don't see it ever being translated, and I did not change that
423
QByteArray _bugEmailAddress;
427
KAboutData::KAboutData( const QByteArray &_appName,
428
const QByteArray &_catalogName,
429
const KLocalizedString &_programName,
430
const QByteArray &_version,
431
const KLocalizedString &_shortDescription,
432
enum LicenseKey licenseType,
433
const KLocalizedString &_copyrightStatement,
434
const KLocalizedString &text,
435
const QByteArray &homePageAddress,
436
const QByteArray &bugsEmailAddress
440
d->_appName = _appName;
441
int p = d->_appName.indexOf('/');
443
d->_appName = d->_appName.mid(p + 1);
446
d->_catalogName = _catalogName;
447
d->_programName = _programName;
448
if (!d->_programName.isEmpty()) // KComponentData("klauncher") gives empty program name
449
d->_translatedProgramName = _programName.toString(0).toUtf8();
450
d->_version = _version;
451
d->_shortDescription = _shortDescription;
452
d->_licenseList.append(KAboutLicense(licenseType,this));
453
d->_copyrightStatement = _copyrightStatement;
454
d->_otherText = text;
455
d->_homepageAddress = QString::fromLatin1(homePageAddress);
456
d->_bugEmailAddress = bugsEmailAddress;
458
if (d->_homepageAddress.contains(QLatin1String("http://"))) {
459
const int dot = d->_homepageAddress.indexOf(QLatin1Char('.'));
461
d->organizationDomain = d->_homepageAddress.mid(dot + 1);
462
const int slash = d->organizationDomain.indexOf(QLatin1Char('/'));
464
d->organizationDomain.truncate(slash);
467
d->organizationDomain = QString::fromLatin1("kde.org");
471
d->organizationDomain = QString::fromLatin1("kde.org");
475
KAboutData::~KAboutData()
480
KAboutData::KAboutData(const KAboutData& other): d(new Private)
483
QList<KAboutLicense>::iterator it = d->_licenseList.begin(), itEnd = d->_licenseList.end();
484
for ( ; it != itEnd; ++it) {
485
KAboutLicense& al = *it;
487
al.d->_aboutData = this;
491
KAboutData &KAboutData::operator=(const KAboutData& other)
493
if (this != &other) {
495
QList<KAboutLicense>::iterator it = d->_licenseList.begin(), itEnd = d->_licenseList.end();
496
for ( ; it != itEnd; ++it) {
497
KAboutLicense& al = *it;
499
al.d->_aboutData = this;
505
KAboutData &KAboutData::addAuthor( const KLocalizedString &name,
506
const KLocalizedString &task,
507
const QByteArray &emailAddress,
508
const QByteArray &webAddress )
510
d->_authorList.append(KAboutPerson(name,task,emailAddress,webAddress));
514
KAboutData &KAboutData::addAuthor( const KLocalizedString &name,
515
const KLocalizedString &task,
516
const QByteArray &emailAddress,
517
const QByteArray &webAddress,
518
const QByteArray &ocsUsername )
520
d->_authorList.append(KAboutPerson(name,task,emailAddress,webAddress,ocsUsername));
524
KAboutData &KAboutData::addCredit( const KLocalizedString &name,
525
const KLocalizedString &task,
526
const QByteArray &emailAddress,
527
const QByteArray &webAddress )
529
d->_creditList.append(KAboutPerson(name,task,emailAddress,webAddress));
533
KAboutData &KAboutData::addCredit( const KLocalizedString &name,
534
const KLocalizedString &task,
535
const QByteArray &emailAddress,
536
const QByteArray &webAddress,
537
const QByteArray &ocsUsername )
539
d->_creditList.append(KAboutPerson(name,task,emailAddress,webAddress,ocsUsername));
543
KAboutData &KAboutData::setTranslator( const KLocalizedString& name,
544
const KLocalizedString& emailAddress )
546
d->translatorName = name;
547
d->translatorEmail = emailAddress;
551
KAboutData &KAboutData::setLicenseText( const KLocalizedString &licenseText )
553
d->_licenseList[0] = KAboutLicense(licenseText,this);
557
KAboutData &KAboutData::addLicenseText( const KLocalizedString &licenseText )
559
// if the default license is unknown, overwrite instead of append
560
KAboutLicense &firstLicense = d->_licenseList[0];
561
if (d->_licenseList.count() == 1 && firstLicense.d->_licenseKey == License_Unknown) {
562
firstLicense = KAboutLicense(licenseText,this);
564
d->_licenseList.append(KAboutLicense(licenseText,this));
569
KAboutData &KAboutData::setLicenseTextFile( const QString &pathToFile )
571
d->_licenseList[0] = KAboutLicense(pathToFile,this);
575
KAboutData &KAboutData::addLicenseTextFile( const QString &pathToFile )
577
// if the default license is unknown, overwrite instead of append
578
KAboutLicense &firstLicense = d->_licenseList[0];
579
if (d->_licenseList.count() == 1 && firstLicense.d->_licenseKey == License_Unknown) {
580
firstLicense = KAboutLicense(pathToFile,this);
582
d->_licenseList.append(KAboutLicense(pathToFile,this));
587
KAboutData &KAboutData::setAppName( const QByteArray &_appName )
589
d->_appName = _appName;
593
KAboutData &KAboutData::setProgramName( const KLocalizedString &_programName )
595
d->_programName = _programName;
596
translateInternalProgramName();
600
KAboutData &KAboutData::setOcsProvider(const QByteArray &_ocsProviderUrl )
602
d->_ocsProviderUrl = _ocsProviderUrl;
606
KAboutData &KAboutData::setVersion( const QByteArray &_version )
608
d->_version = _version;
612
KAboutData &KAboutData::setShortDescription( const KLocalizedString &_shortDescription )
614
d->_shortDescription = _shortDescription;
618
KAboutData &KAboutData::setCatalogName( const QByteArray &_catalogName )
620
d->_catalogName = _catalogName;
624
KAboutData &KAboutData::setLicense( LicenseKey licenseKey)
626
d->_licenseList[0] = KAboutLicense(licenseKey,this);
630
KAboutData &KAboutData::addLicense( LicenseKey licenseKey)
632
// if the default license is unknown, overwrite instead of append
633
KAboutLicense &firstLicense = d->_licenseList[0];
634
if (d->_licenseList.count() == 1 && firstLicense.d->_licenseKey == License_Unknown) {
635
firstLicense = KAboutLicense(licenseKey,this);
637
d->_licenseList.append(KAboutLicense(licenseKey,this));
642
KAboutData &KAboutData::setCopyrightStatement( const KLocalizedString &_copyrightStatement )
644
d->_copyrightStatement = _copyrightStatement;
648
KAboutData &KAboutData::setOtherText( const KLocalizedString &_otherText )
650
d->_otherText = _otherText;
654
KAboutData &KAboutData::setHomepage( const QByteArray &_homepage )
656
d->_homepageAddress = QString::fromLatin1(_homepage);
660
KAboutData &KAboutData::setBugAddress( const QByteArray &_bugAddress )
662
d->_bugEmailAddress = _bugAddress;
666
KAboutData &KAboutData::setOrganizationDomain( const QByteArray &domain )
668
d->organizationDomain = QString::fromLatin1(domain);
672
KAboutData &KAboutData::setProductName( const QByteArray &_productName )
674
d->productName = QString::fromUtf8(_productName);
678
QString KAboutData::appName() const
680
return QString::fromUtf8(d->_appName);
683
QString KAboutData::productName() const
685
if (!d->productName.isEmpty())
686
return d->productName;
690
QString KAboutData::programName() const
692
if (!d->_programName.isEmpty())
693
return d->_programName.toString();
698
/// Return the program name. It is always pre-allocated.
699
/// Needed for KCrash in particular.
700
const char* KAboutData::internalProgramName() const
702
return d->_translatedProgramName.constData();
706
/// KCrash should call as few things as possible and should avoid e.g. malloc()
707
/// because it may deadlock. Since i18n() needs it, when KLocale is available
708
/// the i18n() call will be done here in advance.
709
void KAboutData::translateInternalProgramName() const
711
d->_translatedProgramName.clear();
712
if( KGlobal::locale())
713
d->_translatedProgramName = programName().toUtf8();
716
QString KAboutData::programIconName() const
718
return d->programIconName.isEmpty() ? appName() : d->programIconName;
721
KAboutData &KAboutData::setProgramIconName( const QString &iconName )
723
d->programIconName = iconName;
727
QVariant KAboutData::programLogo() const
729
return d->programLogo;
732
KAboutData &KAboutData::setProgramLogo(const QVariant& image)
734
d->programLogo = image ;
738
QString KAboutData::ocsProviderUrl() const
740
if( !d->_ocsProviderUrl.isEmpty() )
741
return QString::fromUtf8( d->_ocsProviderUrl );
745
QString KAboutData::version() const
747
return QString::fromUtf8(d->_version);
751
/// Return the untranslated and uninterpreted (to UTF8) string
752
/// for the version information. Used in particular for KCrash.
753
const char* KAboutData::internalVersion() const
755
return d->_version.constData();
758
QString KAboutData::shortDescription() const
760
if (!d->_shortDescription.isEmpty())
761
return d->_shortDescription.toString();
765
QString KAboutData::catalogName() const
767
if (!d->_catalogName.isEmpty())
768
return QString::fromUtf8(d->_catalogName);
769
// Fallback to appname for catalog name if empty.
770
return QString::fromUtf8(d->_appName);
773
QString KAboutData::homepage() const
775
return d->_homepageAddress;
778
QString KAboutData::bugAddress() const
780
return QString::fromUtf8(d->_bugEmailAddress);
783
QString KAboutData::organizationDomain() const
785
return d->organizationDomain;
790
/// Return the untranslated and uninterpreted (to UTF8) string
791
/// for the bug mail address. Used in particular for KCrash.
792
const char* KAboutData::internalBugAddress() const
794
if (d->_bugEmailAddress.isEmpty())
796
return d->_bugEmailAddress.constData();
799
QList<KAboutPerson> KAboutData::authors() const
801
return d->_authorList;
804
QList<KAboutPerson> KAboutData::credits() const
806
return d->_creditList;
809
#define NAME_OF_TRANSLATORS "Your names"
810
#define EMAIL_OF_TRANSLATORS "Your emails"
811
QList<KAboutPerson> KAboutData::translators() const
813
QList<KAboutPerson> personList;
815
KLocale *tmpLocale = NULL;
816
if (KGlobal::locale()) {
817
// There could be many catalogs loaded into the global locale,
818
// e.g. in systemsettings. The tmp locale is needed to make sure we
819
// use the translators name from this aboutdata's catalog, rather than
820
// from any other loaded catalog.
821
tmpLocale = new KLocale(*KGlobal::locale());
822
tmpLocale->setActiveCatalog(catalogName());
825
QString translatorName;
826
if (!d->translatorName.isEmpty()) {
827
translatorName = d->translatorName.toString();
830
translatorName = ki18nc("NAME OF TRANSLATORS", NAME_OF_TRANSLATORS).toString(tmpLocale);
833
QString translatorEmail;
834
if (!d->translatorEmail.isEmpty()) {
835
translatorEmail = d->translatorEmail.toString();
838
translatorEmail = ki18nc("EMAIL OF TRANSLATORS", EMAIL_OF_TRANSLATORS).toString(tmpLocale);
843
if ( translatorName.isEmpty() || translatorName == QString::fromUtf8( NAME_OF_TRANSLATORS ) )
846
const QStringList nameList(translatorName.split(QString(QLatin1Char(','))));
848
QStringList emailList;
849
if( !translatorEmail.isEmpty() && translatorEmail != QString::fromUtf8( EMAIL_OF_TRANSLATORS ) )
851
emailList = translatorEmail.split(QString(QLatin1Char(',')), QString::KeepEmptyParts);
854
QStringList::const_iterator nit;
855
QStringList::const_iterator eit = emailList.constBegin();
857
for( nit = nameList.constBegin(); nit != nameList.constEnd(); ++nit )
860
if ( eit != emailList.constEnd() )
866
personList.append( KAboutPerson( (*nit).trimmed(), email.trimmed() ) );
872
QString KAboutData::aboutTranslationTeam()
874
return i18nc("replace this with information about your translation team",
875
"<p>KDE is translated into many languages thanks to the work "
876
"of the translation teams all over the world.</p>"
877
"<p>For more information on KDE internationalization "
878
"visit <a href=\"http://l10n.kde.org\">http://l10n.kde.org</a></p>"
882
QString KAboutData::otherText() const
884
if (!d->_otherText.isEmpty())
885
return d->_otherText.toString();
889
QString KAboutData::license() const
891
return d->_licenseList.at(0).text();
894
QString KAboutData::licenseName( NameFormat formatName ) const
896
return d->_licenseList.at(0).name(formatName);
899
QList<KAboutLicense> KAboutData::licenses() const
901
return d->_licenseList;
904
QString KAboutData::copyrightStatement() const
906
if (!d->_copyrightStatement.isEmpty())
907
return d->_copyrightStatement.toString();
911
QString KAboutData::customAuthorPlainText() const
913
if (!d->customAuthorPlainText.isEmpty())
914
return d->customAuthorPlainText.toString();
918
QString KAboutData::customAuthorRichText() const
920
if (!d->customAuthorRichText.isEmpty())
921
return d->customAuthorRichText.toString();
925
bool KAboutData::customAuthorTextEnabled() const
927
return d->customAuthorTextEnabled;
930
KAboutData &KAboutData::setCustomAuthorText( const KLocalizedString &plainText,
931
const KLocalizedString &richText )
933
d->customAuthorPlainText = plainText;
934
d->customAuthorRichText = richText;
936
d->customAuthorTextEnabled = true;
941
KAboutData &KAboutData::unsetCustomAuthorText()
943
d->customAuthorPlainText = KLocalizedString();
944
d->customAuthorRichText = KLocalizedString();
946
d->customAuthorTextEnabled = false;