mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix Subsurface build with Qt 5.4.1 and later
The intention had been all along to use the 5.4 QSysInfo API, but due to a silly mistake in the QT_VERSION check, it never got enabled for 5.4.0. On 5.4.1 it does get enabled and, unfortunately, causes compilation errors because the API changed between the time we backported to Subsurface and the final version. This commit backports the final QSysInfo API from Qt 5.4 into Subsurface, which includes the renaming of a few functions. Since the prettyOsName function no longer exists in the Qt API in that form, I've reimplemented it using the API that does exist. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ea143e9668
commit
39ffb0fced
3 changed files with 255 additions and 144 deletions
|
@ -24,10 +24,10 @@ UserSurvey::UserSurvey(QWidget *parent) : QDialog(parent),
|
|||
|
||||
os = QString("ssrfVers=%1").arg(VERSION_STRING);
|
||||
os.append(QString("&prettyOsName=%1").arg(SubsurfaceSysInfo::prettyOsName()));
|
||||
QString arch = SubsurfaceSysInfo::cpuArchitecture();
|
||||
QString arch = SubsurfaceSysInfo::buildCpuArchitecture();
|
||||
os.append(QString("&appCpuArch=%1").arg(arch));
|
||||
if (arch == "i386") {
|
||||
QString osArch = SubsurfaceSysInfo::osArch();
|
||||
QString osArch = SubsurfaceSysInfo::currentCpuArchitecture();
|
||||
os.append(QString("&osCpuArch=%1").arg(osArch));
|
||||
}
|
||||
os.append(QString("&uiLang=%1").arg(uiLanguage(NULL)));
|
||||
|
@ -41,10 +41,10 @@ QString UserSurvey::getVersion()
|
|||
// fill in the system data
|
||||
QString sysInfo = QString("Subsurface %1").arg(VERSION_STRING);
|
||||
sysInfo.append(tr("\nOperating system: %1").arg(SubsurfaceSysInfo::prettyOsName()));
|
||||
arch = SubsurfaceSysInfo::cpuArchitecture();
|
||||
arch = SubsurfaceSysInfo::buildCpuArchitecture();
|
||||
sysInfo.append(tr("\nCPU architecture: %1").arg(arch));
|
||||
if (arch == "i386")
|
||||
sysInfo.append(tr("\nOS CPU architecture: %1").arg(SubsurfaceSysInfo::osArch()));
|
||||
sysInfo.append(tr("\nOS CPU architecture: %1").arg(SubsurfaceSysInfo::currentCpuArchitecture()));
|
||||
sysInfo.append(tr("\nLanguage: %1").arg(uiLanguage(NULL)));
|
||||
return sysInfo;
|
||||
}
|
||||
|
@ -56,10 +56,10 @@ QString UserSurvey::getUserAgent()
|
|||
// replace all other ':' with ' ' so that this is easy to parse
|
||||
QString userAgent = QString("Subsurface:%1:").arg(VERSION_STRING);
|
||||
userAgent.append(SubsurfaceSysInfo::prettyOsName().replace(':', ' ') + ":");
|
||||
arch = SubsurfaceSysInfo::cpuArchitecture().replace(':', ' ');
|
||||
arch = SubsurfaceSysInfo::buildCpuArchitecture().replace(':', ' ');
|
||||
userAgent.append(arch);
|
||||
if (arch == "i386")
|
||||
userAgent.append("/" + SubsurfaceSysInfo::osArch());
|
||||
userAgent.append("/" + SubsurfaceSysInfo::currentCpuArchitecture());
|
||||
userAgent.append(":" + uiLanguage(NULL));
|
||||
return userAgent;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue