2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Add Qt 6 support

Tested only on Linux so far
This commit is contained in:
Ilya Fedin
2021-10-19 17:00:21 +04:00
committed by John Preston
parent ea10cf5758
commit 847c01d605
154 changed files with 382 additions and 339 deletions

View File

@@ -988,7 +988,7 @@ QByteArray documentWaveformEncode5bit(const VoiceWaveform &waveform) {
// Write each 0-31 unsigned char as 5 bit to result.
// We reserve one extra byte to be able to dereference any of required bytes
// as a uint16 without overflowing, even the byte with index "bytesCount - 1".
for (auto i = 0, l = waveform.size(); i < l; ++i) {
for (auto i = 0, l = int(waveform.size()); i < l; ++i) {
auto byteIndex = (i * 5) / 8;
auto bitShift = (i * 5) % 8;
auto value = (static_cast<uint16>(waveform[i]) & 0x1F) << bitShift;
@@ -1337,7 +1337,7 @@ bool DocumentData::isAudioFile() const {
}
return false;
}
const auto left = _mimeString.midRef(prefix.size()).toString();
const auto left = _mimeString.mid(prefix.size());
const auto types = { qstr("x-wav"), qstr("wav"), qstr("mp4") };
return ranges::contains(types, left);
}