temp commit: api fixes related to python 3 binding issues

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
fix/api-for-python
Michele Calgaro 2 years ago
parent 8d96e85f7d
commit af2ffa121e
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -34,10 +34,7 @@ TDEAboutPerson::name() const
TQString
TDEAboutPerson::task() const
{
if (mTask && *mTask)
return i18n(mTask);
else
return TQString::null;
}
TQString
@ -77,28 +74,21 @@ public:
TDEAboutDataPrivate()
: translatorName("_: NAME OF TRANSLATORS\nYour names")
, translatorEmail("_: EMAIL OF TRANSLATORS\nYour emails")
, productName(0)
, programLogo(0)
, customAuthorTextEnabled(false)
, mTranslatedProgramName( 0 )
{}
~TDEAboutDataPrivate()
{
delete programLogo;
delete[] mTranslatedProgramName;
}
const char *translatorName;
const char *translatorEmail;
const char *productName;
TQImage* programLogo;
TQCString translatorName;
TQCString translatorEmail;
TQCString productName;
TQImage programLogo;
TQString customAuthorPlainText, customAuthorRichText;
bool customAuthorTextEnabled;
const char *mTranslatedProgramName;
TQCString mTranslatedProgramName;
};
const char *TDEAboutData::defaultBugTracker = "http://bugs.trinitydesktop.org";
TQCString TDEAboutData::defaultBugTracker = "http://bugs.trinitydesktop.org";
TDEAboutData::TDEAboutData( const char *appName,
TDEAboutData::TDEAboutData(const char *appName,
const char *programName,
const char *version,
const char *shortDescription,
@ -106,17 +96,16 @@ TDEAboutData::TDEAboutData( const char *appName,
const char *copyrightStatement,
const char *text,
const char *homePageAddress,
const char *bugsEmailAddress
) :
mProgramName( programName ),
const char *bugsEmailAddress)
: mProgramName( programName ),
mVersion( version ),
mShortDescription( shortDescription ),
mLicenseKey( licenseType ),
mCopyrightStatement( copyrightStatement ),
mOtherText( text ),
mHomepageAddress( homePageAddress ),
mBugEmailAddress( (bugsEmailAddress!=0)?bugsEmailAddress:defaultBugTracker ),
mLicenseText (0)
mBugEmailAddress( (bugsEmailAddress != nullptr) ? TQCString(bugsEmailAddress) : TQCString(defaultBugTracker) ),
mLicenseText()
{
d = new TDEAboutDataPrivate;
@ -127,13 +116,11 @@ TDEAboutData::TDEAboutData( const char *appName,
else
mAppName = appName;
} else
mAppName = 0;
mAppName = TQCString();
}
TDEAboutData::~TDEAboutData()
{
if (mLicenseKey == License_File)
delete [] mLicenseText;
delete d;
}
@ -242,7 +229,7 @@ TDEAboutData::appName() const
const char *
TDEAboutData::productName() const
{
if (d->productName)
if (!d->productName.isEmpty())
return d->productName;
else
return appName();
@ -251,16 +238,13 @@ TDEAboutData::productName() const
TQString
TDEAboutData::programName() const
{
if (mProgramName && *mProgramName)
return i18n(mProgramName);
else
return TQString::null;
}
const char*
TDEAboutData::internalProgramName() const
{
if (d->mTranslatedProgramName)
if (!d->mTranslatedProgramName.isEmpty())
return d->mTranslatedProgramName;
else
return mProgramName;
@ -272,8 +256,7 @@ TDEAboutData::internalProgramName() const
void
TDEAboutData::translateInternalProgramName() const
{
delete[] d->mTranslatedProgramName;
d->mTranslatedProgramName = 0;
d->mTranslatedProgramName = TQCString();
if( TDEGlobal::locale() )
d->mTranslatedProgramName = tqstrdup( programName().utf8());
}
@ -281,16 +264,13 @@ TDEAboutData::translateInternalProgramName() const
TQImage
TDEAboutData::programLogo() const
{
return d->programLogo ? (*d->programLogo) : TQImage();
return d->programLogo;
}
void
TDEAboutData::setProgramLogo(const TQImage& image)
{
if (!d->programLogo)
d->programLogo = new TQImage( image );
else
*d->programLogo = image;
d->programLogo = image;
}
TQString
@ -302,10 +282,7 @@ TDEAboutData::version() const
TQString
TDEAboutData::shortDescription() const
{
if (mShortDescription && *mShortDescription)
return i18n(mShortDescription);
else
return TQString::null;
}
TQString
@ -337,7 +314,7 @@ TDEAboutData::translators() const
{
TQValueList<TDEAboutTranslator> personList;
if(d->translatorName == 0)
if(d->translatorName.isEmpty())
return personList;
TQStringList nameList;
@ -350,7 +327,7 @@ TDEAboutData::translators() const
}
if(d->translatorEmail)
if(!d->translatorEmail.isEmpty())
{
TQString emails = i18n(d->translatorEmail);
@ -397,10 +374,7 @@ TDEAboutData::aboutTranslationTeam()
TQString
TDEAboutData::otherText() const
{
if (mOtherText && *mOtherText)
return i18n(mOtherText);
else
return TQString::null;
}
@ -447,7 +421,7 @@ TDEAboutData::license() const
f = locate("data", "LICENSES/QPL_V1.0");
break;
case License_Custom:
if (mLicenseText && *mLicenseText)
if (!mLicenseText.isEmpty())
return( i18n(mLicenseText) );
// fall through
default:
@ -478,10 +452,7 @@ TDEAboutData::license() const
TQString
TDEAboutData::copyrightStatement() const
{
if (mCopyrightStatement && *mCopyrightStatement)
return i18n(mCopyrightStatement);
else
return TQString::null;
}
TQString

@ -27,7 +27,6 @@
#ifndef _TDEABOUTDATA_H_
#define _TDEABOUTDATA_H_
class TDEAboutPersonPrivate;
class TDEAboutDataPrivate;
/**
@ -67,19 +66,14 @@ public:
*
* @param webAddress Home page of the person.
*/
TDEAboutPerson( const char *name, const char *task,
const char *emailAddress, const char *webAddress )
TDEAboutPerson(const char *name = nullptr, const char *task = nullptr,
const char *emailAddress = nullptr, const char *webAddress = nullptr)
{
mName = name;
mTask = task;
mEmailAddress = emailAddress;
mWebAddress = webAddress;
}
/**
* @internal
* Don't use. Required by QValueList
*/
TDEAboutPerson() {}
/**
* The person's name
@ -109,16 +103,13 @@ public:
*/
TQString webAddress() const;
private:
const char *mName;
const char *mTask;
const char *mEmailAddress;
const char *mWebAddress;
TDEAboutPersonPrivate *d;
protected:
TQCString mName;
TQCString mTask;
TQCString mEmailAddress;
TQCString mWebAddress;
};
class TDEAboutTranslatorPrivate;
/**
* This structure is used to store information about a translator.
* It can store the translator's name and an email address.
@ -161,7 +152,6 @@ public:
private:
TQString mName;
TQString mEmail;
TDEAboutTranslatorPrivate* d;
};
@ -237,15 +227,15 @@ class TDECORE_EXPORT TDEAboutData
* This defaults to the trinitydesktop.org bug system.
*
*/
TDEAboutData( const char *appName,
TDEAboutData(const char *appName,
const char *programName,
const char *version,
const char *shortDescription = 0,
const char *shortDescription = nullptr,
int licenseType = License_Unknown,
const char *copyrightStatement = 0,
const char *text = 0,
const char *homePageAddress = 0,
const char *bugsEmailAddress = 0
const char *copyrightStatement = nullptr,
const char *text = nullptr,
const char *homePageAddress = nullptr,
const char *bugsEmailAddress = nullptr
);
~TDEAboutData();
@ -611,19 +601,19 @@ class TDECORE_EXPORT TDEAboutData
void unsetCustomAuthorText();
private:
const char *mAppName;
const char *mProgramName;
const char *mVersion;
const char *mShortDescription;
TQCString mAppName;
TQCString mProgramName;
TQCString mVersion;
TQCString mShortDescription;
int mLicenseKey;
const char *mCopyrightStatement;
const char *mOtherText;
const char *mHomepageAddress;
const char *mBugEmailAddress;
TQCString mCopyrightStatement;
TQCString mOtherText;
TQCString mHomepageAddress;
TQCString mBugEmailAddress;
TQValueList<TDEAboutPerson> mAuthorList;
TQValueList<TDEAboutPerson> mCreditList;
const char *mLicenseText;
static const char *defaultBugTracker;
TQCString mLicenseText;
static TQCString defaultBugTracker;
TDEAboutDataPrivate *d;
};

Loading…
Cancel
Save