mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kdecore: pass the QByteArray objects size to QString constructors in KCmdLineOptions and KLocalizedString
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
a2530529a4
commit
7f628f95f6
2 changed files with 6 additions and 6 deletions
|
@ -135,7 +135,7 @@ KCmdLineOptions &KCmdLineOptions::add (const QByteArray &name,
|
|||
{
|
||||
d->names.append(name);
|
||||
d->descriptions.append(description);
|
||||
d->defaults.append(QString::fromUtf8(defaultValue));
|
||||
d->defaults.append(QString::fromUtf8(defaultValue.constData(), defaultValue.size()));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ QString KLocalizedStringPrivate::toString(const KLocale *locale) const
|
|||
// Check whether plural argument has been supplied, if message has plural.
|
||||
if (!plural.isEmpty() && !numberSet)
|
||||
kDebug(173) << QString::fromLatin1("Plural argument to message {%1} not supplied before conversion.")
|
||||
.arg(shortenMessage(QString::fromUtf8(msg)));
|
||||
.arg(shortenMessage(QString::fromUtf8(msg.constData(), msg.size())));
|
||||
|
||||
// Get raw translation.
|
||||
QString rawtrans, lang;
|
||||
|
@ -176,18 +176,18 @@ QString KLocalizedStringPrivate::toString(const KLocale *locale) const
|
|||
// Substitute placeholders in ordinary translation.
|
||||
QString finalstr = substituteSimple(rawtrans);
|
||||
// Post-format ordinary translation.
|
||||
return postFormat(finalstr, lang, QString::fromLatin1(ctxt));
|
||||
return postFormat(finalstr, lang, QString::fromLatin1(ctxt.constData(), ctxt.size()));
|
||||
}
|
||||
|
||||
QString KLocalizedStringPrivate::selectForEnglish () const
|
||||
{
|
||||
if (!plural.isEmpty()) {
|
||||
if (number == 1) {
|
||||
return QString::fromUtf8(msg);
|
||||
return QString::fromUtf8(msg.constData(), msg.size());
|
||||
}
|
||||
return QString::fromUtf8(plural);
|
||||
return QString::fromUtf8(plural.constData(), plural.size());
|
||||
}
|
||||
return QString::fromUtf8(msg);
|
||||
return QString::fromUtf8(msg.constData(), msg.size());
|
||||
}
|
||||
|
||||
QString KLocalizedStringPrivate::substituteSimple(const QString &trans,
|
||||
|
|
Loading…
Add table
Reference in a new issue