From d2caca92373dfff212310d484ce32bbeb6b887f6 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 14 Jun 2016 10:24:56 +0200 Subject: [PATCH 1/4] Add *.stash to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 274f82116..104ab24c6 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ hunspell callgrind.out.* tests/autotests/autotests .ycm_extra_conf.py* +*.stash From e5de2a240356252384d0f610edebbc99715ab027 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 14 Jun 2016 10:38:49 +0200 Subject: [PATCH 2/4] Update UA strings + add architecture to OS string --- src/lib/preferences/useragentdialog.cpp | 16 ++++++++----- src/lib/tools/qztools.cpp | 31 ++++++++++++++++++++++++- src/lib/tools/qztools.h | 3 ++- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/lib/preferences/useragentdialog.cpp b/src/lib/preferences/useragentdialog.cpp index b4fc20b01..ee38c453d 100644 --- a/src/lib/preferences/useragentdialog.cpp +++ b/src/lib/preferences/useragentdialog.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2014 David Rosca +* Copyright (C) 2010-2016 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 @@ -37,11 +37,15 @@ UserAgentDialog::UserAgentDialog(QWidget* parent) ui->globalComboBox->setLayoutDirection(Qt::LeftToRight); ui->table->setLayoutDirection(Qt::LeftToRight); - const QString os = QzTools::operatingSystem(); - m_knownUserAgents << QString("Opera/9.80 (%1) Presto/2.12.388 Version/12.16").arg(os) - << QString("Mozilla/5.0 (%1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36").arg(os) - << QString("Mozilla/5.0 (%1) AppleWebKit/537.51.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A").arg(os) - << QString("Mozilla/5.0 (%1; rv:42.0) Gecko/20100101 Firefox/42.0").arg(os); + const QString arch = QzTools::cpuArchitecture(); + QString platform = QzTools::operatingSystem(); + if (!arch.isEmpty()) + platform.append(QL1S(" ") + arch); + + m_knownUserAgents << QString("Opera/9.80 (%1) Presto/2.12.388 Version/12.16").arg(platform) + << QString("Mozilla/5.0 (%1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36").arg(platform) + << QString("Mozilla/5.0 (%1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7").arg(platform) + << QString("Mozilla/5.0 (%1; rv:47.0) Gecko/20100101 Firefox/47.0").arg(platform); ui->globalComboBox->addItems(m_knownUserAgents); diff --git a/src/lib/tools/qztools.cpp b/src/lib/tools/qztools.cpp index bc3940b86..0b5b3ec5e 100644 --- a/src/lib/tools/qztools.cpp +++ b/src/lib/tools/qztools.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2014 David Rosca +* Copyright (C) 2010-2016 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 @@ -936,3 +936,32 @@ QString QzTools::operatingSystem() #endif } +QString QzTools::cpuArchitecture() +{ +#if defined(__x86_64__) || defined(_M_X64) + return QSL("x86_64"); +#endif +#if defined(_M_IX86) + return QSL("x86"); +#endif +#if defined(__i686__) + return QSL("i686"); +#endif +#if defined(__i586__) + return QSL("i586"); +#endif +#if defined(__i486__) + return QSL("i486"); +#endif +#if defined(__i386__) + return QSL("i386"); +#endif +#if defined(__aarch64__) + return QSL("arm64"); +#endif +#if defined(__arm__) || defined(_M_ARM) + return QSL("arm"); +#endif + return QString(); +} + diff --git a/src/lib/tools/qztools.h b/src/lib/tools/qztools.h index 57ed1d7a9..595d3aa88 100644 --- a/src/lib/tools/qztools.h +++ b/src/lib/tools/qztools.h @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2014 David Rosca +* Copyright (C) 2010-2016 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 @@ -84,6 +84,7 @@ public: static QKeySequence actionShortcut(QKeySequence shortcut, QKeySequence fallBack, QKeySequence shortcutRtl = QKeySequence(), QKeySequence fallbackRtl = QKeySequence()); static QString operatingSystem(); + static QString cpuArchitecture(); static void setWmClass(const QString &name, const QWidget* widget); From 766a661bfe92b823e985eb9c3a693d99dc526028 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 14 Jun 2016 11:01:22 +0200 Subject: [PATCH 3/4] Use cpu architecture with os name everywhere --- .../schemehandlers/qupzillaschemehandler.cpp | 4 ++-- src/lib/preferences/useragentdialog.cpp | 13 +++++-------- src/lib/tools/qztools.cpp | 8 ++++++++ src/lib/tools/qztools.h | 1 + 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp index 470433217..ea5610147 100644 --- a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp +++ b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp @@ -144,7 +144,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::operatingSystem()); + bPage.replace(QLatin1String("%INFO_OS%"), QzTools::operatingSystemLong()); bPage.replace(QLatin1String("%INFO_APP%"), #ifdef GIT_REVISION QString("%1 (%2)").arg(Qz::VERSION, GIT_REVISION) @@ -383,7 +383,7 @@ QString QupZillaSchemeReply::configPage() #endif ) + QString("
%1
%2
").arg(tr("Qt version"), QT_VERSION_STR) + - QString("
%1
%2
").arg(tr("Platform"), QzTools::operatingSystem())); + QString("
%1
%2
").arg(tr("Platform"), QzTools::operatingSystemLong())); cPage.replace(QLatin1String("%PATHS-TEXT%"), QString("
%1
%2
").arg(tr("Profile"), DataPaths::currentProfilePath()) + diff --git a/src/lib/preferences/useragentdialog.cpp b/src/lib/preferences/useragentdialog.cpp index ee38c453d..00038d0fc 100644 --- a/src/lib/preferences/useragentdialog.cpp +++ b/src/lib/preferences/useragentdialog.cpp @@ -37,15 +37,12 @@ UserAgentDialog::UserAgentDialog(QWidget* parent) ui->globalComboBox->setLayoutDirection(Qt::LeftToRight); ui->table->setLayoutDirection(Qt::LeftToRight); - const QString arch = QzTools::cpuArchitecture(); - QString platform = QzTools::operatingSystem(); - if (!arch.isEmpty()) - platform.append(QL1S(" ") + arch); + const QString os = QzTools::operatingSystemLong(); - m_knownUserAgents << QString("Opera/9.80 (%1) Presto/2.12.388 Version/12.16").arg(platform) - << QString("Mozilla/5.0 (%1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36").arg(platform) - << QString("Mozilla/5.0 (%1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7").arg(platform) - << QString("Mozilla/5.0 (%1; rv:47.0) Gecko/20100101 Firefox/47.0").arg(platform); + m_knownUserAgents << QString("Opera/9.80 (%1) Presto/2.12.388 Version/12.16").arg(os) + << QString("Mozilla/5.0 (%1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36").arg(os) + << QString("Mozilla/5.0 (%1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7").arg(os) + << QString("Mozilla/5.0 (%1; rv:47.0) Gecko/20100101 Firefox/47.0").arg(os); ui->globalComboBox->addItems(m_knownUserAgents); diff --git a/src/lib/tools/qztools.cpp b/src/lib/tools/qztools.cpp index 0b5b3ec5e..60aa3fddf 100644 --- a/src/lib/tools/qztools.cpp +++ b/src/lib/tools/qztools.cpp @@ -965,3 +965,11 @@ QString QzTools::cpuArchitecture() return QString(); } +QString QzTools::operatingSystemLong() +{ + const QString arch = cpuArchitecture(); + if (arch.isEmpty()) + return QzTools::operatingSystem(); + return QzTools::operatingSystem() + QSL(" ") + arch; +} + diff --git a/src/lib/tools/qztools.h b/src/lib/tools/qztools.h index 595d3aa88..6e015c58c 100644 --- a/src/lib/tools/qztools.h +++ b/src/lib/tools/qztools.h @@ -85,6 +85,7 @@ public: static QString operatingSystem(); static QString cpuArchitecture(); + static QString operatingSystemLong(); static void setWmClass(const QString &name, const QWidget* widget); From 2c0f96c52709c56ca7f5bccf3cade4d19b2e6cbe Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 14 Jun 2016 11:12:28 +0200 Subject: [PATCH 4/4] Report Bug: Change email input type to "email" --- src/lib/data/html/reportbug.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/data/html/reportbug.html b/src/lib/data/html/reportbug.html index 4175aa291..0b633453c 100644 --- a/src/lib/data/html/reportbug.html +++ b/src/lib/data/html/reportbug.html @@ -38,7 +38,7 @@ function checkFields()

- +
%EMAIL%*:
%EMAIL%*:
%TYPE%:
%DESCRIPTION%: