Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build without QT_IMPLICIT_QCHAR_CONSTRUCTION #28514

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
K900 marked this conversation as resolved.
Show resolved Hide resolved
_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
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/storage/storage_account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2709,7 +2709,7 @@ std::optional<RecentHashtagPack> Account::saveRecentHashtags(
auto found = false;
auto m = QRegularExpressionMatch();
auto recent = getPack();
for (auto i = 0, next = 0; (m = TextUtilities::RegExpHashtag().match(text, i)).hasMatch(); i = next) {
for (auto i = 0, next = 0; (m = TextUtilities::RegExpHashtag(false).match(text, i)).hasMatch(); i = next) {
i = m.capturedStart();
next = m.capturedEnd();
if (m.hasMatch()) {
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
Loading