Finalize port of Locale bindings
Small, likely irrelevant API changes: * removed: bool useTranscript(...) * removed: QString translateQt(...) has been removed in kdelibs as well, and is removeAccelerator now uses KLocalizedString, and is expected to fully work, so is isApplicationTranslatedInto(). Another module fully ported. :)
This commit is contained in:
parent
19d9a2b88b
commit
69dbc5a202
@ -30,7 +30,7 @@
|
||||
CalendarSystem::CalendarSystem(QObject* parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
m_calendarSystem = KCalendarSystem::create(KGlobal::locale()->calendarSystem());
|
||||
m_calendarSystem = KCalendarSystem::create(KLocale::global()->calendarSystem());
|
||||
}
|
||||
|
||||
QList<int> CalendarSystem::calendarSystemsList()
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
//KDE
|
||||
#include <KLocale>
|
||||
#include <QLocale>
|
||||
#include <KLocalizedString>
|
||||
|
||||
//Qt
|
||||
#include <QDebug>
|
||||
@ -31,7 +31,6 @@
|
||||
Locale::Locale(QObject* parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
//m_locale = KGlobal::locale();
|
||||
m_locale = KLocale::global();
|
||||
}
|
||||
|
||||
@ -50,10 +49,7 @@ void Locale::setCurrencyCode(const QString &newCurrencyCode)
|
||||
|
||||
bool Locale::isApplicationTranslatedInto(const QString &lang)
|
||||
{
|
||||
#warning "Locale::isApplicationTranslatedInto needs porting"
|
||||
qWarning() << " has not been ported";
|
||||
//return m_locale->isApplicationTranslatedInto(lang);
|
||||
return true;
|
||||
return KLocalizedString::isApplicationTranslatedInto(lang);
|
||||
}
|
||||
|
||||
void Locale::splitLocale(const QString &locale, QString &language, QString &country, QString &modifier,
|
||||
@ -82,14 +78,6 @@ QString Locale::currencyCode() const
|
||||
return m_locale->currencyCode();
|
||||
}
|
||||
|
||||
QString Locale::translateQt(const char *context, const char *sourceText, const char *comment) const
|
||||
{
|
||||
#warning "Locale::translateQt needs porting"
|
||||
//return m_locale->translateQt(context, sourceText, comment);
|
||||
qWarning() << " has not been ported";
|
||||
return sourceText;
|
||||
}
|
||||
|
||||
QList<int> Locale::allDigitSetsList() const
|
||||
{
|
||||
QList<int> digitList;
|
||||
@ -492,14 +480,6 @@ QString Locale::defaultCurrencyCode()
|
||||
return KLocale::defaultCurrencyCode();
|
||||
}
|
||||
|
||||
bool Locale::useTranscript() const
|
||||
{
|
||||
#warning "Locale::useTranscript needs porting"
|
||||
qWarning() << " has not been ported";
|
||||
return true;
|
||||
//return m_locale->useTranscript();
|
||||
}
|
||||
|
||||
int Locale::fileEncodingMib() const
|
||||
{
|
||||
return m_locale->fileEncodingMib();
|
||||
@ -554,9 +534,7 @@ Locale::WeekNumberSystem Locale::weekNumberSystem() const
|
||||
|
||||
QString Locale::removeAcceleratorMarker(const QString &label) const
|
||||
{
|
||||
QString _l(label);
|
||||
return _l.replace("&", "");
|
||||
//return m_locale->removeAcceleratorMarker(label);
|
||||
return KLocalizedString::removeAcceleratorMarker(label);
|
||||
}
|
||||
|
||||
void Locale::setDigitSet(Locale::DigitSet digitSet)
|
||||
|
@ -116,7 +116,6 @@ Q_PROPERTY(bool use12Clock READ use12Clock CONSTANT)
|
||||
Q_PROPERTY(QString defaultLanguage READ defaultLanguage CONSTANT)//read-only
|
||||
Q_PROPERTY(QString defaultCountry READ defaultCountry CONSTANT)//read-only
|
||||
Q_PROPERTY(QString defaultCurrencyCode READ defaultCurrencyCode CONSTANT)//read-only
|
||||
Q_PROPERTY(bool useTranscript READ useTranscript CONSTANT) //read-only
|
||||
Q_PROPERTY(int fileEncodingMib READ fileEncodingMib CONSTANT) //read-only
|
||||
Q_PROPERTY(QStringList languageList READ languageList CONSTANT) //read-only
|
||||
Q_PROPERTY(QStringList currencyCodeList READ currencyCodeList CONSTANT) //read-only
|
||||
@ -1353,13 +1352,6 @@ public:
|
||||
*/
|
||||
void setMeasureSystem(MeasureSystem value);
|
||||
|
||||
/**
|
||||
* Translates a message as a QTranslator is supposed to.
|
||||
* The parameters are similar to i18n(), but the result
|
||||
* value has other semantics (it can be QString())
|
||||
*/
|
||||
Q_INVOKABLE QString translateQt(const char *context, const char *sourceText, const char *comment) const;
|
||||
|
||||
/**
|
||||
* Provides list of all known language codes.
|
||||
*
|
||||
@ -1472,13 +1464,6 @@ public:
|
||||
*/
|
||||
QString defaultCurrencyCode();
|
||||
|
||||
/**
|
||||
* Reports whether evaluation of translation scripts is enabled.
|
||||
*
|
||||
* @return true if script evaluation is enabled, false otherwise.
|
||||
*/
|
||||
bool useTranscript() const;
|
||||
|
||||
/**
|
||||
* Checks whether or not the active catalog is found for the given language.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user