Fix build on macOS.

This commit is contained in:
John Preston 2022-06-10 17:38:52 +04:00
parent 0e90092d59
commit bcfbdcd6ed
6 changed files with 13 additions and 13 deletions

View File

@ -422,7 +422,7 @@ void PreloadSticker(const std::shared_ptr<Data::DocumentMedia> &media) {
}
const auto width = st::premiumVideoWidth;
const auto height = state->blurred.height()
? state->blurred.height()
? (state->blurred.height() / state->blurred.devicePixelRatio())
: width;
const auto left = (st::boxWideWidth - width) / 2;
const auto top = st::premiumPreviewHeight - height;

View File

@ -373,16 +373,16 @@ bool PeerMatchesTypes(
return (types & PeerType::Group);
}
PeerTypes ParseChooseTypes(const QString &choose) {
PeerTypes ParseChooseTypes(QStringView choose) {
auto result = PeerTypes();
for (const auto &entry : choose.split(QChar(' '))) {
if (entry == "users") {
if (entry == u"users"_q) {
result |= PeerType::User;
} else if (entry == "bots") {
} else if (entry == u"bots"_q) {
result |= PeerType::Bot;
} else if (entry == "groups") {
} else if (entry == u"groups"_q) {
result |= PeerType::Group;
} else if (entry == "channels") {
} else if (entry == u"channels"_q) {
result |= PeerType::Broadcast;
}
}

View File

@ -47,7 +47,7 @@ using PeerTypes = base::flags<PeerType>;
not_null<PeerData*> peer,
not_null<UserData*> bot,
PeerTypes types);
[[nodiscard]] PeerTypes ParseChooseTypes(const QString &choose);
[[nodiscard]] PeerTypes ParseChooseTypes(QStringView choose);
struct AttachWebViewBot {
not_null<UserData*> user;

View File

@ -843,7 +843,7 @@ void SessionController::setupPremiumToast() {
Ui::Toast::Show(
Window::Show(this).toastParent(),
{
.text = tr::lng_premium_success(tr::now),
.text = { tr::lng_premium_success(tr::now) },
.st = &st::defaultToast,
});
}, _lifetime);

View File

@ -106,7 +106,7 @@ if building:
finish(1, 'Adding tdesktop to archive.')
print('Beginning notarization process.')
lines = subprocess.check_output('xcrun altool --notarize-app --primary-bundle-id "com.tdesktop.TelegramDebug" --username "' + username + '" --password "@keychain:AC_PASSWORD" --file "' + archive + '"', stderr=subprocess.STDOUT, shell=True)
lines = subprocess.check_output('xcrun altool --notarize-app --primary-bundle-id "com.tdesktop.TelegramDebug" --username "' + username + '" --password "@keychain:AC_PASSWORD" --file "' + archive + '"', stderr=subprocess.STDOUT, shell=True).decode('utf-8')
print('Response received.')
uuid = ''
for line in lines.split('\n'):
@ -124,7 +124,7 @@ if building:
while requestStatus == '':
time.sleep(5)
print('Checking...')
lines = subprocess.check_output('xcrun altool --notarization-info "' + uuid + '" --username "' + username + '" --password "@keychain:AC_PASSWORD"', stderr=subprocess.STDOUT, shell=True)
lines = subprocess.check_output('xcrun altool --notarization-info "' + uuid + '" --username "' + username + '" --password "@keychain:AC_PASSWORD"', stderr=subprocess.STDOUT, shell=True).decode('utf-8')
statusFound = False
for line in lines.split('\n'):
parts = line.strip().split(' ')
@ -152,7 +152,7 @@ if building:
logLines = ''
if logUrl != '':
print('Requesting log...')
logLines = subprocess.check_output('curl ' + logUrl, shell=True)
logLines = subprocess.check_output('curl ' + logUrl, shell=True).decode('utf-8')
result = subprocess.call('xcrun stapler staple Telegram.app', shell=True)
if result != 0:
finish(1, 'Error calling stapler')
@ -203,7 +203,7 @@ if composing:
if not re.match(r'^[a-f0-9]{9,40}$', lastCommit):
finish(1, 'Wrong last commit: ' + lastCommit)
log = subprocess.check_output(['git', 'log', lastCommit+'..HEAD'])
log = subprocess.check_output(['git', 'log', lastCommit+'..HEAD']).decode('utf-8')
logLines = log.split('\n')
firstCommit = ''
commits = []

View File

@ -17,6 +17,6 @@ pushd `dirname $0` > /dev/null
FullScriptPath=`pwd`
popd > /dev/null
python $FullScriptPath/updates.py $1 $2 $3 $4 $5 $6
python3 $FullScriptPath/updates.py $1 $2 $3 $4 $5 $6
exit