[Improvement] Use QSysInfo for system info in session

This commit is contained in:
Eric Kotato 2022-09-11 05:10:49 +03:00 committed by Eric Kotato
parent 732c9d10d0
commit d679f121a9
4 changed files with 7 additions and 7 deletions

View file

@ -32,7 +32,7 @@ I'm trying to use my mobile phone number: ") + phone + qsl("\n\
But Telegram says it's banned. Please help.\n\ But Telegram says it's banned. Please help.\n\
\n\ \n\
App version: ") + version + qsl("\n\ App version: ") + version + qsl("\n\
OS version: ") + ::Platform::SystemVersionPretty() + qsl("\n\ OS version: ") + QSysInfo::prettyProductName() + qsl("\n\
Locale: ") + ::Platform::SystemLanguage(); Locale: ") + ::Platform::SystemLanguage();
const auto url = "mailto:?to=" const auto url = "mailto:?to="

View file

@ -127,7 +127,7 @@ void RenameBox(not_null<Ui::GenericBox*> box) {
object_ptr<Ui::InputField>( object_ptr<Ui::InputField>(
box, box,
st::settingsDeviceName, st::settingsDeviceName,
rpl::single(Platform::DeviceModelPretty()), rpl::single(QSysInfo::machineHostName()),
Core::App().settings().customDeviceModel()), Core::App().settings().customDeviceModel()),
st::boxRowPadding - style::margins( st::boxRowPadding - style::margins(
st::settingsDeviceName.textMargins.left(), st::settingsDeviceName.textMargins.left(),

View file

@ -1089,7 +1089,7 @@ void Settings::setThirdColumnWidth(int width) {
QString Settings::deviceModel() const { QString Settings::deviceModel() const {
const auto custom = customDeviceModel(); const auto custom = customDeviceModel();
return custom.isEmpty() ? Platform::DeviceModelPretty() : custom; return custom.isEmpty() ? QSysInfo::machineHostName() : custom;
} }
rpl::producer<QString> Settings::deviceModelChanges() const { rpl::producer<QString> Settings::deviceModelChanges() const {

View file

@ -419,8 +419,8 @@ void Account::startMtp(std::unique_ptr<MTP::Config> config) {
auto fields = base::take(_mtpFields); auto fields = base::take(_mtpFields);
fields.config = std::move(config); fields.config = std::move(config);
fields.deviceModel = Platform::DeviceModelPretty(); fields.deviceModel = QSysInfo::machineHostName();
fields.systemVersion = Platform::SystemVersionPretty(); fields.systemVersion = QSysInfo::prettyProductName();
_mtp = std::make_unique<MTP::Instance>( _mtp = std::make_unique<MTP::Instance>(
MTP::Instance::Mode::Normal, MTP::Instance::Mode::Normal,
std::move(fields)); std::move(fields));
@ -565,8 +565,8 @@ void Account::destroyMtpKeys(MTP::AuthKeysList &&keys) {
destroyFields.mainDcId = MTP::Instance::Fields::kNoneMainDc; destroyFields.mainDcId = MTP::Instance::Fields::kNoneMainDc;
destroyFields.config = std::make_unique<MTP::Config>(_mtp->config()); destroyFields.config = std::make_unique<MTP::Config>(_mtp->config());
destroyFields.keys = std::move(keys); destroyFields.keys = std::move(keys);
destroyFields.deviceModel = Platform::DeviceModelPretty(); destroyFields.deviceModel = QSysInfo::machineHostName();
destroyFields.systemVersion = Platform::SystemVersionPretty(); destroyFields.systemVersion = QSysInfo::prettyProductName();
_mtpForKeysDestroy = std::make_unique<MTP::Instance>( _mtpForKeysDestroy = std::make_unique<MTP::Instance>(
MTP::Instance::Mode::KeysDestroyer, MTP::Instance::Mode::KeysDestroyer,
std::move(destroyFields)); std::move(destroyFields));