mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
moved to VS2015, Qt 5.5.1, now Qt, ffmpeg and openssl are built from source from git
This commit is contained in:
@@ -262,7 +262,7 @@ void readKeyValue(const char *&from, const char *end) {
|
||||
}
|
||||
}
|
||||
|
||||
QString escapeCpp(const QByteArray &key, QString value, bool wideChar) {
|
||||
QString escapeCpp(const QByteArray &key, QString value) {
|
||||
if (value.isEmpty()) return "QString()";
|
||||
|
||||
QString res;
|
||||
@@ -274,22 +274,10 @@ QString escapeCpp(const QByteArray &key, QString value, bool wideChar) {
|
||||
res.append('"');
|
||||
instr = false;
|
||||
}
|
||||
res.append(' ');
|
||||
if (wideChar) {
|
||||
res.append('L').append('"').append('\\').append('x').append(QString("%1").arg(ch->unicode(), 4, 16, QChar('0'))).append('"');
|
||||
} else {
|
||||
res.append('"');
|
||||
QByteArray utf(QString(*ch).toUtf8());
|
||||
for (const unsigned char *uch = (const unsigned char *)utf.constData(), *ue = (const unsigned char *)utf.constData() + utf.size(); uch != ue; ++uch) {
|
||||
res.append('\\').append('x').append(QString("%1").arg(ushort(*uch), 2, 16, QChar('0')));
|
||||
}
|
||||
res.append('"');
|
||||
}
|
||||
res.append(' ').append('u').append('"').append('\\').append('x').append(QString("%1").arg(ch->unicode(), 4, 16, QChar('0'))).append('"');
|
||||
} else {
|
||||
if (!instr) {
|
||||
res.append(' ');
|
||||
if (wideChar) res.append('L');
|
||||
res.append('"');
|
||||
res.append(' ').append('u').append('"');
|
||||
instr = true;
|
||||
}
|
||||
if (ch->unicode() == '\\' || ch->unicode() == '\n' || ch->unicode() == '\r' || ch->unicode() == '"') {
|
||||
@@ -321,20 +309,11 @@ QString escapeCpp(const QByteArray &key, QString value, bool wideChar) {
|
||||
}
|
||||
}
|
||||
if (instr) res.append('"');
|
||||
return (wideChar ? "qsl(" : "QString::fromUtf8(") + res.mid(wideChar ? 2 : 1) + ")";
|
||||
return "qsl(" + res.mid(1) + ")";
|
||||
}
|
||||
|
||||
void writeCppKey(QTextStream &tcpp, const QByteArray &key, const QString &val) {
|
||||
QString wide = escapeCpp(key, val, true), utf = escapeCpp(key, val, false);
|
||||
if (wide.indexOf(" L\"") < 0) {
|
||||
tcpp << "\t\t\tset(" << key << ", " << wide << ");\n";
|
||||
} else {
|
||||
tcpp << "#ifdef Q_OS_WIN\n";
|
||||
tcpp << "\t\t\tset(" << key << ", " << wide << ");\n";
|
||||
tcpp << "#else\n";
|
||||
tcpp << "\t\t\tset(" << key << ", " << utf << ");\n";
|
||||
tcpp << "#endif\n";
|
||||
}
|
||||
tcpp << "\t\t\tset(" << key << ", " << escapeCpp(key, val) << ");\n";
|
||||
}
|
||||
|
||||
bool genLang(const QString &lang_in, const QString &lang_out) {
|
||||
|
@@ -368,7 +368,8 @@ static const mtpTypeId mtpLayers[] = {
|
||||
mtpc_invokeWithLayer16,
|
||||
mtpc_invokeWithLayer17,
|
||||
mtpc_invokeWithLayer18,
|
||||
}, mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]);
|
||||
};
|
||||
static const uint32 mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]);
|
||||
static const mtpPrime mtpCurrentLayer = 38;
|
||||
|
||||
template <typename bareT>
|
||||
|
Reference in New Issue
Block a user