59 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
/*
 | 
						|
This file is part of Telegram Desktop,
 | 
						|
the official desktop application for the Telegram messaging service.
 | 
						|
 | 
						|
For license and copyright information please follow this link:
 | 
						|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 | 
						|
*/
 | 
						|
#include "platform/linux/info_linux.h"
 | 
						|
 | 
						|
#include <QLocale>
 | 
						|
 | 
						|
namespace Platform {
 | 
						|
 | 
						|
QString DeviceModelPretty() {
 | 
						|
#ifdef Q_OS_LINUX64
 | 
						|
	return "PC 64bit";
 | 
						|
#else // Q_OS_LINUX64
 | 
						|
	return "PC 32bit";
 | 
						|
#endif // Q_OS_LINUX64
 | 
						|
}
 | 
						|
 | 
						|
QString SystemVersionPretty() {
 | 
						|
	const auto result = getenv("XDG_CURRENT_DESKTOP");
 | 
						|
	const auto value = result ? QString::fromLatin1(result) : QString();
 | 
						|
	const auto list = value.split(':', QString::SkipEmptyParts);
 | 
						|
	return list.isEmpty() ? "Linux" : "Linux " + list[0];
 | 
						|
}
 | 
						|
 | 
						|
QString SystemCountry() {
 | 
						|
	return QLocale::system().name().split('_').last();
 | 
						|
}
 | 
						|
 | 
						|
QString SystemLanguage() {
 | 
						|
	const auto system = QLocale::system();
 | 
						|
	const auto languages = system.uiLanguages();
 | 
						|
	return languages.isEmpty()
 | 
						|
		? system.name().split('_').first()
 | 
						|
		: languages.front();
 | 
						|
}
 | 
						|
 | 
						|
QDate WhenSystemBecomesOutdated() {
 | 
						|
	return QDate();
 | 
						|
}
 | 
						|
 | 
						|
int AutoUpdateVersion() {
 | 
						|
	return 2;
 | 
						|
}
 | 
						|
 | 
						|
QString AutoUpdateKey() {
 | 
						|
	if (IsLinux32Bit()) {
 | 
						|
		return "linux32";
 | 
						|
	} else if (IsLinux64Bit()) {
 | 
						|
		return "linux";
 | 
						|
	} else {
 | 
						|
		Unexpected("Platform in AutoUpdateKey.");
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
} // namespace Platform
 |