Skip to content

Commit

Permalink
Fix build without QT_IMPLICIT_QCHAR_CONSTRUCTION
Browse files Browse the repository at this point in the history
  • Loading branch information
K900 committed Oct 11, 2024
1 parent 2d20e7a commit e3de8b2
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 26 deletions.
16 changes: 8 additions & 8 deletions Telegram/SourceFiles/data/data_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,14 +936,14 @@ void DocumentData::setFileName(const QString &remoteFileName) {
// in filenames, because they introduce a security issue, when
// an executable "Fil[x]gepj.exe" may look like "Filexe.jpeg".
QChar controls[] = {
0x200E, // LTR Mark
0x200F, // RTL Mark
0x202A, // LTR Embedding
0x202B, // RTL Embedding
0x202D, // LTR Override
0x202E, // RTL Override
0x2066, // LTR Isolate
0x2067, // RTL Isolate
QChar(0x200E), // LTR Mark
QChar(0x200F), // RTL Mark
QChar(0x202A), // LTR Embedding
QChar(0x202B), // RTL Embedding
QChar(0x202D), // LTR Override
QChar(0x202E), // RTL Override
QChar(0x2066), // LTR Isolate
QChar(0x2067), // RTL Isolate
};
for (const auto &ch : controls) {
_filename = std::move(_filename).replace(ch, "_");
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/data/data_wall_paper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ using Ui::MaybeColorFromSerialized;
const auto hex = [](int value) {
value = std::clamp(value, 0, 15);
return (value > 9)
? ('a' + (value - 10))
: ('0' + value);
? QChar('a' + (value - 10))
: QChar('0' + value);
};
return QString() + hex(value / 16) + hex(value % 16);
};
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/lang/lang_cloud_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ void CloudManager::requestLanguageAndSwitch(

void CloudManager::sendSwitchingToLanguageRequest() {
if (!_api) {
_switchingToLanguageId = -1;
_switchingToLanguageRequest = -1;
return;
}
_api->request(_switchingToLanguageRequest).cancel();
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/passport/ui/passport_details_row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,9 @@ void DateInput::correctValue(
if (accumulated > _maxValue
|| (limit == _maxDigits && oldLength > _maxDigits)) {
if (oldCursor > limit) {
_putNext.fire('0' + (accumulated % 10));
_putNext.fire(QChar('0' + (accumulated % 10)));
} else {
_putNext.fire(0);
_putNext.fire(QChar(0));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ void QuickReplies::setupContent(
}
for (const auto &ch : name) {
if (!ch.isLetterOrNumber()
&& (ch != '_')
&& (ch != 0x200c)
&& (ch != 0x00b7)
&& (ch < 0x0d80 || ch > 0x0dff)) {
&& (ch != QChar('_'))
&& (ch.unicode() != 0x200c)
&& (ch.unicode() != 0x00b7)
&& (ch.unicode() < 0x0d80 || ch.unicode() > 0x0dff)) {
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ QString ToFilePart(FileKey val) {
result.reserve(0x10);
for (int32 i = 0; i < 0x10; ++i) {
uchar v = (val & 0x0F);
result.push_back((v < 0x0A) ? ('0' + v) : ('A' + (v - 0x0A)));
result.push_back((v < 0x0A) ? QChar('0' + v) : QChar('A' + (v - 0x0A)));
val >>= 4;
}
return result;
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/ui/widgets/color_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,9 +997,9 @@ void ColorEditor::updateResultField() {
auto text = QString();
const auto addHex = [&text](int value) {
if (value >= 0 && value <= 9) {
text.append('0' + value);
text.append(QChar('0' + value));
} else if (value >= 10 && value <= 15) {
text.append('a' + (value - 10));
text.append(QChar('a' + (value - 10)));
}
};
const auto addValue = [&](int value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ void EditorBlock::Row::setValue(QColor value) {
void EditorBlock::Row::fillValueString() {
auto addHex = [=](int code) {
if (code >= 0 && code < 10) {
_valueString.append('0' + code);
_valueString.append(QChar('0' + code));
} else if (code >= 10 && code < 16) {
_valueString.append('a' + (code - 10));
_valueString.append(QChar('a' + (code - 10)));
}
};
auto addCode = [=](int code) {
Expand Down
2 changes: 1 addition & 1 deletion Telegram/codegen
2 changes: 1 addition & 1 deletion Telegram/lib_base
2 changes: 1 addition & 1 deletion cmake
Submodule cmake updated 1 files
+0 −1 options.cmake

0 comments on commit e3de8b2

Please sign in to comment.