mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: replace KuitSemantics::escape() with Qt::escape()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
fe0af7c285
commit
48f25f1fb5
4 changed files with 3 additions and 36 deletions
|
@ -47,8 +47,6 @@
|
|||
#include "kglobal.h"
|
||||
#include "kurl.h"
|
||||
|
||||
#include "kuitsemantics_p.h" // for escaping arguments in i18n
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Design notes:
|
||||
//
|
||||
|
@ -951,7 +949,7 @@ KCmdLineArgsStatic::parseAllArgs()
|
|||
if (s->ignoreUnknown)
|
||||
continue;
|
||||
KCmdLineArgs::enable_i18n();
|
||||
KCmdLineArgs::usageError(i18n("Unexpected argument '%1'.", KuitSemantics::escape(s->decodeInput(s->all_argv[i]))));
|
||||
KCmdLineArgs::usageError(i18n("Unexpected argument '%1'.", Qt::escape(s->decodeInput(s->all_argv[i]))));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1126,7 +1124,7 @@ KCmdLineArgs::usage(const QByteArray &id)
|
|||
}
|
||||
}
|
||||
|
||||
s->printQ(i18n("Usage: %1 %2\n", QString::fromLocal8Bit(s->appName), KuitSemantics::escape(usage)));
|
||||
s->printQ(i18n("Usage: %1 %2\n", QString::fromLocal8Bit(s->appName), Qt::escape(usage)));
|
||||
s->printQ(QLatin1Char('\n')+s->about->shortDescription()+QLatin1Char('\n'));
|
||||
|
||||
s->printQ(i18n("\nGeneric options:\n"));
|
||||
|
|
|
@ -629,7 +629,7 @@ static QString wrapNum (const QString &tag, const QString &numstr,
|
|||
{
|
||||
QString optag;
|
||||
if (fieldWidth != 0) {
|
||||
QString fillString = KuitSemantics::escape(fillChar);
|
||||
QString fillString = Qt::escape(fillChar);
|
||||
optag = QString::fromLatin1("<%1 width='%2' fill='%3'>")
|
||||
.arg(tag, QString::number(fieldWidth), fillString);
|
||||
} else {
|
||||
|
|
|
@ -1599,28 +1599,3 @@ QString KuitSemantics::format (const QString &text, const QString &ctxt) const
|
|||
{
|
||||
return d->format(text, ctxt);
|
||||
}
|
||||
|
||||
QString KuitSemantics::escape (const QString &text)
|
||||
{
|
||||
int tlen = text.length();
|
||||
QString ntext;
|
||||
ntext.reserve(tlen);
|
||||
for (int i = 0; i < tlen; ++i) {
|
||||
QChar c = text[i];
|
||||
if (c == QLatin1Char('&')) {
|
||||
ntext += QLatin1String("&");
|
||||
} else if (c == QLatin1Char('<')) {
|
||||
ntext += QLatin1String("<");
|
||||
} else if (c == QLatin1Char('>')) {
|
||||
ntext += QLatin1String(">");
|
||||
} else if (c == QLatin1Char('\'')) {
|
||||
ntext += QLatin1String("'");
|
||||
} else if (c == QLatin1Char('"')) {
|
||||
ntext += QLatin1String(""");
|
||||
} else {
|
||||
ntext += c;
|
||||
}
|
||||
}
|
||||
|
||||
return ntext;
|
||||
}
|
||||
|
|
|
@ -64,12 +64,6 @@ class KuitSemantics
|
|||
*/
|
||||
~KuitSemantics ();
|
||||
|
||||
/**
|
||||
* Convert &, ", ', <, > characters into XML entities
|
||||
* &, <, >, ', ", respectively.
|
||||
*/
|
||||
static QString escape (const QString &text);
|
||||
|
||||
private:
|
||||
|
||||
KuitSemantics (const KuitSemantics &t);
|
||||
|
|
Loading…
Add table
Reference in a new issue