diff --git a/src/lib/lib.pro b/src/lib/lib.pro index 8d85dfcae..fbe27f58b 100644 --- a/src/lib/lib.pro +++ b/src/lib/lib.pro @@ -461,6 +461,8 @@ win32 { mac { HEADERS += other/macmenureceiver.h SOURCES += other/macmenureceiver.cpp + + LIBS +=- framework CoreServices } message(===========================================) diff --git a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp index bf2a0551f..38ad357fc 100644 --- a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp +++ b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp @@ -157,7 +157,7 @@ QString QupZillaSchemeReply::reportbugPage() "bug report here first.").arg("https://github.com/QupZilla/qupzilla/wiki/Bug-Reports target=_blank")); bPage.replace(QLatin1String("%FIELDS-ARE-REQUIRED%"), tr("Please fill out all required fields!")); - bPage.replace(QLatin1String("%INFO_OS%"), QzTools::buildSystem()); + bPage.replace(QLatin1String("%INFO_OS%"), QzTools::operatingSystem()); bPage.replace(QLatin1String("%INFO_APP%"), QupZilla::VERSION #ifdef GIT_REVISION + " (" + GIT_REVISION + ")" @@ -382,7 +382,7 @@ QString QupZillaSchemeReply::configPage() QString("
%1
%2
").arg(tr("Qt version"), QT_VERSION_STR) + QString("
%1
%2
").arg(tr("WebKit version"), QupZilla::WEBKITVERSION) + QString("
%1
%2
").arg(tr("Build time"), QupZilla::BUILDTIME) + - QString("
%1
%2
").arg(tr("Platform"), QzTools::buildSystem())); + QString("
%1
%2
").arg(tr("Platform"), QzTools::operatingSystem())); cPage.replace(QLatin1String("%PATHS-TEXT%"), QString("
%1
%2
").arg(tr("Profile"), mApp->currentProfilePath()) + diff --git a/src/lib/other/updater.cpp b/src/lib/other/updater.cpp index 8f12be86f..e21c0e94f 100644 --- a/src/lib/other/updater.cpp +++ b/src/lib/other/updater.cpp @@ -96,7 +96,7 @@ void Updater::start() { QUrl url = QUrl(QString("%1/update.php?v=%2&os=%3").arg(QupZilla::WWWADDRESS, QupZilla::VERSION, - QzTools::buildSystem())); + QzTools::operatingSystem())); startDownloadingUpdateInfo(url); } diff --git a/src/lib/other/useragentmanager.cpp b/src/lib/other/useragentmanager.cpp index 9c9cec329..e5ada058f 100644 --- a/src/lib/other/useragentmanager.cpp +++ b/src/lib/other/useragentmanager.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ UserAgentManager::UserAgentManager() { - m_fakeUserAgent = QString("Mozilla/5.0 (%1) AppleWebKit/%2 (KHTML, like Gecko) Chrome/10.0 Safari/%2").arg(QzTools::buildSystem(), QupZilla::WEBKITVERSION); + m_fakeUserAgent = QString("Mozilla/5.0 (%1) AppleWebKit/%2 (KHTML, like Gecko) Chrome/10.0 Safari/%2").arg(QzTools::operatingSystem(), QupZilla::WEBKITVERSION); } void UserAgentManager::loadSettings() diff --git a/src/lib/preferences/useragentdialog.cpp b/src/lib/preferences/useragentdialog.cpp index 3354d122e..885eb991a 100644 --- a/src/lib/preferences/useragentdialog.cpp +++ b/src/lib/preferences/useragentdialog.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ UserAgentDialog::UserAgentDialog(QWidget* parent) { ui->setupUi(this); - const QString &os = QzTools::buildSystem(); + const QString &os = QzTools::operatingSystem(); m_knownUserAgents << QString("Opera/9.80 (%1) Presto/2.10.229 Version/11.61").arg(os) << QString("Mozilla/5.0 (%1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7").arg(os) << QString("Mozilla/5.0 (%1) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1").arg(os) diff --git a/src/lib/tools/qztools.cpp b/src/lib/tools/qztools.cpp index c824473f4..f5f5d8635 100644 --- a/src/lib/tools/qztools.cpp +++ b/src/lib/tools/qztools.cpp @@ -46,6 +46,14 @@ #include #endif +#ifdef Q_OS_WIN +#include +#endif + +#ifdef Q_OS_MAC +#include +#endif + QByteArray QzTools::pixmapToByteArray(const QPixmap &pix) { QByteArray bytes; @@ -603,7 +611,7 @@ void* QzTools::X11Display(const QWidget* widget) } #endif -QString QzTools::buildSystem() +QString QzTools::operatingSystem() { #ifdef Q_OS_LINUX return "Linux"; @@ -626,9 +634,6 @@ QString QzTools::buildSystem() #ifdef Q_OS_LYNX return "LynxOS"; #endif -#ifdef Q_OS_MAC - return "MAC OS"; -#endif #ifdef Q_OS_NETBSD return "NetBSD"; #endif @@ -647,6 +652,12 @@ QString QzTools::buildSystem() #ifdef Q_OS_UNIXWARE return "UnixWare 7 / Open UNIX 8"; #endif +#ifdef Q_OS_UNIX + return "Unix"; +#endif +#ifdef Q_OS_HAIKU + return "Haiku"; +#endif #ifdef Q_OS_WIN32 QString str = "Windows"; @@ -675,15 +686,29 @@ QString QzTools::buildSystem() break; default: + OSVERSIONINFO osvi; + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osvi); + + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2) { + str.append(" 8"); + } break; } return str; #endif -#ifdef Q_OS_UNIX - return "Unix"; -#endif -#ifdef Q_OS_HAIKU - return "Haiku"; +#ifdef Q_OS_MAC + QString str = "Mac OS X"; + + SInt32 majorVersion; + SInt32 minorVersion; + + if (Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr && Gestalt(gestaltSystemVersionMinor, &minorVersion) == noErr) { + str.append(QString(" %1.%2").arg(majorVersion, minorVersion)); + } + + return str; #endif } diff --git a/src/lib/tools/qztools.h b/src/lib/tools/qztools.h index e63891867..fcdc79122 100644 --- a/src/lib/tools/qztools.h +++ b/src/lib/tools/qztools.h @@ -63,7 +63,7 @@ bool QT_QUPZILLA_EXPORT startExternalProcess(const QString &executable, const QS QIcon QT_QUPZILLA_EXPORT iconFromFileName(const QString &fileName); bool QT_QUPZILLA_EXPORT isUtf8(const char* string); -QString QT_QUPZILLA_EXPORT buildSystem(); +QString QT_QUPZILLA_EXPORT operatingSystem(); // Qt5 migration help functions bool QT_QUPZILLA_EXPORT isCertificateValid(const QSslCertificate &cert);