Hello community, here is the log from the commit of package attica-qt5 for openSUSE:Factory checked in at 2020-01-14 20:58:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/attica-qt5 (Old) and /work/SRC/openSUSE:Factory/.attica-qt5.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "attica-qt5" Tue Jan 14 20:58:52 2020 rev:75 rq:763428 version:5.66.0 Changes: -------- --- /work/SRC/openSUSE:Factory/attica-qt5/attica-qt5.changes 2019-12-18 14:39:46.157703996 +0100 +++ /work/SRC/openSUSE:Factory/.attica-qt5.new.6675/attica-qt5.changes 2020-01-14 20:59:00.514533052 +0100 @@ -1,0 +2,15 @@ +Sun Jan 5 09:01:53 UTC 2020 - Christophe Giboudeaux <[email protected]> + +- Update to 5.66.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.66.0.php +- Changes since 5.65.0: + * [Attica] Port QRegExp to QRegularExpression + * qrand is deprecated. Port to QRandomGenerator + * Don't use a verified nullptr as a data source + * Support multiple children elements in comment elements + * Update the obsolete projects.kde.org URL + * Set a proper agent string for Attica requests + +------------------------------------------------------------------- Old: ---- attica-5.65.0.tar.xz attica-5.65.0.tar.xz.sig New: ---- attica-5.66.0.tar.xz attica-5.66.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ attica-qt5.spec ++++++ --- /var/tmp/diff_new_pack.OplzQj/_old 2020-01-14 20:59:07.222536156 +0100 +++ /var/tmp/diff_new_pack.OplzQj/_new 2020-01-14 20:59:07.230536160 +0100 @@ -1,7 +1,7 @@ # # spec file for package attica-qt5 # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define sonum 5 %define rname attica %define _libname KF5Attica -%define _tar_path 5.65 +%define _tar_path 5.66 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) @@ -27,7 +27,7 @@ # Only needed for the package signature condition %bcond_without lang Name: attica-qt5 -Version: 5.65.0 +Version: 5.66.0 Release: 0 Summary: Open Collaboration Service client library License: LGPL-2.1-or-later ++++++ attica-5.65.0.tar.xz -> attica-5.66.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/CMakeLists.txt new/attica-5.66.0/CMakeLists.txt --- old/attica-5.65.0/CMakeLists.txt 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/CMakeLists.txt 2020-01-04 00:09:00.000000000 +0100 @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.5) -set(KF5_VERSION "5.65.0") # handled by release scripts +set(KF5_VERSION "5.66.0") # handled by release scripts project(Attica VERSION ${KF5_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 5.65.0 NO_MODULE) -set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") +find_package(ECM 5.66.0 NO_MODULE) +set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) @@ -34,7 +34,7 @@ SOVERSION 5) # Dependencies -set(REQUIRED_QT_VERSION 5.11.0) +set(REQUIRED_QT_VERSION 5.12.0) # Required Qt5 components to build this framework find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Core Network) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/autotests/configtest.cpp new/attica-5.66.0/autotests/configtest.cpp --- old/attica-5.65.0/autotests/configtest.cpp 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/autotests/configtest.cpp 2020-01-04 00:09:00.000000000 +0100 @@ -21,7 +21,7 @@ */ -#include <QtTest> +#include <QTest> #include <configparser.h> using namespace Attica; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/autotests/persontest.cpp new/attica-5.66.0/autotests/persontest.cpp --- old/attica-5.65.0/autotests/persontest.cpp 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/autotests/persontest.cpp 2020-01-04 00:09:00.000000000 +0100 @@ -21,7 +21,7 @@ */ -#include <QtTest> +#include <QTest> #include <personparser.h> using namespace Attica; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/autotests/privatedatatest.cpp new/attica-5.66.0/autotests/privatedatatest.cpp --- old/attica-5.65.0/autotests/privatedatatest.cpp 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/autotests/privatedatatest.cpp 2020-01-04 00:09:00.000000000 +0100 @@ -21,7 +21,7 @@ */ -#include <QtTest> +#include <QTest> #include "../privatedata.h" #include "../privatedataparser.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/autotests/providertest.cpp new/attica-5.66.0/autotests/providertest.cpp --- old/attica-5.65.0/autotests/providertest.cpp 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/autotests/providertest.cpp 2020-01-04 00:09:00.000000000 +0100 @@ -21,7 +21,8 @@ */ -#include <QtTest> +#include <QTest> +#include <QTimer> #include <QEventLoop> #include <QLoggingCategory> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/src/activityparser.cpp new/attica-5.66.0/src/activityparser.cpp --- old/attica-5.65.0/src/activityparser.cpp 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/src/activityparser.cpp 2020-01-04 00:09:00.000000000 +0100 @@ -24,7 +24,7 @@ #include "activityparser.h" #include <QDateTime> -#include <QRegExp> +#include <QRegularExpression> using namespace Attica; @@ -49,7 +49,7 @@ person.setLastName(xml.readElementText()); } else if (xml.name() == QLatin1String("timestamp")) { QString timestampString = xml.readElementText(); - timestampString.remove(QRegExp(QLatin1String("\\+.*$"))); + timestampString.remove(QRegularExpression(QStringLiteral("\\+.*$"))); QDateTime timestamp = QDateTime::fromString(timestampString, Qt::ISODate); activity.setTimestamp(timestamp); } else if (xml.name() == QLatin1String("message")) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/src/commentparser.cpp new/attica-5.66.0/src/commentparser.cpp --- old/attica-5.65.0/src/commentparser.cpp 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/src/commentparser.cpp 2020-01-04 00:09:00.000000000 +0100 @@ -51,7 +51,11 @@ } else if (xml.name() == QLatin1String("score")) { comment.setScore(xml.readElementText().toInt()); } else if (xml.name() == QLatin1String("children")) { - QList<Comment> children = parseXmlChildren(xml); + // This may seem strange, however we are dealing with a situation where we may + // receive multiple children subsections (the standard accepts this, and certain + // server implementations do do this) + QList<Comment> children = comment.children(); + children += parseXmlChildren(xml); comment.setChildren(children); } } else if (xml.isEndElement() && xml.name() == QLatin1String("comment")) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/src/eventparser.cpp new/attica-5.66.0/src/eventparser.cpp --- old/attica-5.65.0/src/eventparser.cpp 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/src/eventparser.cpp 2020-01-04 00:09:00.000000000 +0100 @@ -23,7 +23,7 @@ #include "eventparser.h" -#include <QRegExp> +#include <QRegularExpression> using namespace Attica; @@ -44,10 +44,10 @@ } else if (xml.name() == QLatin1String("user")) { event.setUser(xml.readElementText()); } else if (xml.name() == QLatin1String("startdate")) { - QString date = xml.readElementText().remove(QRegExp(QLatin1String("\\+.*$"))); + QString date = xml.readElementText().remove(QRegularExpression(QStringLiteral("\\+.*$"))); event.setStartDate(QDate::fromString(date, Qt::ISODate)); } else if (xml.name() == QLatin1String("enddate")) { - QString date = xml.readElementText().remove(QRegExp(QLatin1String("\\+.*$"))); + QString date = xml.readElementText().remove(QRegularExpression(QStringLiteral("\\+.*$"))); event.setEndDate(QDate::fromString(date, Qt::ISODate)); } else if (xml.name() == QLatin1String("latitude")) { event.setLatitude(xml.readElementText().toFloat()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/src/postfiledata.cpp new/attica-5.66.0/src/postfiledata.cpp --- old/attica-5.65.0/src/postfiledata.cpp 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/src/postfiledata.cpp 2020-01-04 00:09:00.000000000 +0100 @@ -26,6 +26,7 @@ #include "postfiledata.h" +#include <QRandomGenerator> #include <QDebug> #include <QDateTime> @@ -49,7 +50,6 @@ : d(new PostFileDataPrivate) { d->url = url; - qsrand(QTime::currentTime().secsTo(QTime(0, 0, 0))); d->boundary = "----------" + randomString(42 + 13).toLatin1(); } @@ -66,8 +66,9 @@ QString str; str.resize(length); int i = 0; + auto *generator = QRandomGenerator::global(); while (length--) { - int r = qrand() % 62; + int r = generator->bounded(62); r += 48; if (r > 57) { r += 7; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/src/provider.cpp new/attica-5.66.0/src/provider.cpp --- old/attica-5.65.0/src/provider.cpp 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/src/provider.cpp 2020-01-04 00:09:00.000000000 +0100 @@ -81,6 +81,7 @@ #include "topicparser.h" #include "itemjob.h" #include "listjob.h" +#include "version.h" #include <QStringList> #include <QNetworkAccessManager> @@ -89,6 +90,7 @@ #include <QUrlQuery> #include <QNetworkReply> #include <QFile> +#include <QCoreApplication> using namespace Attica; @@ -122,6 +124,7 @@ QString m_commentVersion; QString m_registerUrl; PlatformDependent *m_internals; + QString m_additionalAgentInformation; Private() : m_internals(nullptr) @@ -144,13 +147,15 @@ , m_commentVersion(other.m_commentVersion) , m_registerUrl(other.m_registerUrl) , m_internals(other.m_internals) + , m_additionalAgentInformation(other.m_additionalAgentInformation) { } Private(PlatformDependent *internals, const QUrl &baseUrl, const QString &name, const QUrl &icon, const QString &person, const QString &friendV, const QString &message, const QString &achievement, const QString &activity, const QString &content, const QString &fan, const QString &forum, - const QString &knowledgebase, const QString &event, const QString &comment, const QString ®isterUrl) + const QString &knowledgebase, const QString &event, const QString &comment, const QString ®isterUrl, + const QString &additionalAgentInformation) : m_baseUrl(baseUrl), m_icon(icon), m_name(name) , m_personVersion(person) , m_friendVersion(friendV) @@ -165,6 +170,7 @@ , m_commentVersion(comment) , m_registerUrl(registerUrl) , m_internals(internals) + , m_additionalAgentInformation(additionalAgentInformation) { if (m_baseUrl.isEmpty()) { return; @@ -197,7 +203,7 @@ const QString &activity, const QString &content, const QString &fan, const QString &forum, const QString &knowledgebase, const QString &event, const QString &comment) : d(new Private(internals, baseUrl, name, icon, person, friendV, message, achievement, activity, content, - fan, forum, knowledgebase, event, comment, QString())) + fan, forum, knowledgebase, event, comment, QString(), QString())) { } @@ -206,7 +212,17 @@ const QString &activity, const QString &content, const QString &fan, const QString &forum, const QString &knowledgebase, const QString &event, const QString &comment, const QString ®isterUrl) : d(new Private(internals, baseUrl, name, icon, person, friendV, message, achievement, activity, content, - fan, forum, knowledgebase, event, comment, registerUrl)) + fan, forum, knowledgebase, event, comment, registerUrl, QString())) +{ +} + +Provider::Provider(PlatformDependent *internals, const QUrl &baseUrl, const QString &name, const QUrl &icon, + const QString &person, const QString &friendV, const QString &message, const QString &achievement, + const QString &activity, const QString &content, const QString &fan, const QString &forum, + const QString &knowledgebase, const QString &event, const QString &comment, const QString ®isterUrl, + const QString &additionalAgentInformation) + : d(new Private(internals, baseUrl, name, icon, person, friendV, message, achievement, activity, content, + fan, forum, knowledgebase, event, comment, registerUrl, additionalAgentInformation)) { } @@ -248,6 +264,14 @@ d->m_internals->enableProvider(d->m_baseUrl, enabled); } +void Provider::setAdditionalAgentInformation(const QString& additionalInformation) { + d->m_additionalAgentInformation = additionalInformation; +} + +QString Provider::additionalAgentInformation() const { + return d->m_additionalAgentInformation; +} + QString Provider::name() const { return d->m_name; @@ -1603,6 +1627,18 @@ { QNetworkRequest request(url); request.setHeader(QNetworkRequest::ContentTypeHeader,QStringLiteral("application/x-www-form-urlencoded")); + + QString agentHeader; + if (QCoreApplication::instance()) { + agentHeader = QString::fromLocal8Bit("%1/%2").arg(QCoreApplication::instance()->applicationName(), QCoreApplication::instance()->applicationVersion()); + } else { + agentHeader = QString::fromLocal8Bit("Attica/%1").arg(QLatin1String(LIBATTICA_VERSION_STRING)); + } + if (!d->m_additionalAgentInformation.isEmpty()) { + agentHeader = QString::fromLocal8Bit("%1 (+%2)").arg(agentHeader, d->m_additionalAgentInformation); + } + request.setHeader(QNetworkRequest::UserAgentHeader, agentHeader); + if (!d->m_credentialsUserName.isEmpty()) { request.setAttribute((QNetworkRequest::Attribute) BaseJob::UserAttribute, QVariant(d->m_credentialsUserName)); request.setAttribute((QNetworkRequest::Attribute) BaseJob::PasswordAttribute, QVariant(d->m_credentialsPassword)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/src/provider.h new/attica-5.66.0/src/provider.h --- old/attica-5.65.0/src/provider.h 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/src/provider.h 2020-01-04 00:09:00.000000000 +0100 @@ -128,6 +128,33 @@ void setEnabled(bool enabled); /** + * Set a custom identifier for your application (sent along with the requests as + * the http agent header in addition to the applicaiton name and version). + * + * For example, you might have an application named SomeApplication, version 23, + * and wish to send along the data "lookandfeel.knsrc". Call this function, and + * the resulting agent header would be: + * + * SomeApplication/23 (+lookandfeel.knsrc) + * + * If you do not set this (or set it to an empty string), the agent string becomes + * + * SomeApplication/23 + * + * @param additionalAgentInformation The extra string + * @since 5.66 + */ + void setAdditionalAgentInformation(const QString& additionalInformation); + /** + * The custom identifier sent along with requests + * + * @return The custom identifier + * @see setAdditionalAgentInformation(const QString&) + * @since 5.66 + */ + QString additionalAgentInformation() const; + + /** A url that identifies this provider. This should be used as identifier when referring to this provider but you don't want to use the full provider object. */ @@ -706,6 +733,12 @@ const QString &person, const QString &friendV, const QString &message, const QString &achievements, const QString &activity, const QString &content, const QString &fan, const QString &forum, const QString &knowledgebase, const QString &event, const QString &comment, const QString ®isterUrl); + // TODO KF6: merge with the constructor above (i.e. remove the above one - and actually do it this time :P ) + Provider(PlatformDependent *internals, const QUrl &baseUrl, const QString &name, const QUrl &icon, + const QString &person, const QString &friendV, const QString &message, const QString &achievements, + const QString &activity, const QString &content, const QString &fan, const QString &forum, + const QString &knowledgebase, const QString &event, const QString &comment, const QString ®isterUrl, + const QString &additionalAgentInformation); friend class ProviderManager; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-5.65.0/src/version.h.cmake new/attica-5.66.0/src/version.h.cmake --- old/attica-5.65.0/src/version.h.cmake 2019-12-07 20:40:29.000000000 +0100 +++ new/attica-5.66.0/src/version.h.cmake 2020-01-04 00:09:00.000000000 +0100 @@ -24,16 +24,16 @@ #include "attica_export.h" /// @brief Attica version as string at compile time. -#define LIBATTICA_VERSION_STRING "${CMAKE_LIBATTICA_VERSION_STRING}" +#define LIBATTICA_VERSION_STRING "${ATTICA_VERSION_STRING}" /// @brief The major Attica version number at compile time -#define LIBATTICA_VERSION_MAJOR ${CMAKE_LIBATTICA_VERSION_MAJOR} +#define LIBATTICA_VERSION_MAJOR ${ATTICA_VERSION_MAJOR} /// @brief The minor Attica version number at compile time -#define LIBATTICA_VERSION_MINOR ${CMAKE_LIBATTICA_VERSION_MINOR} +#define LIBATTICA_VERSION_MINOR ${ATTICA_VERSION_MINOR} /// @brief The Attica release version number at compile time -#define LIBATTICA_VERSION_RELEASE ${CMAKE_LIBATTICA_VERSION_PATCH} +#define LIBATTICA_VERSION_RELEASE ${ATTICA_VERSION_PATCH} /** * \brief Create a unique number from the major, minor and release number of a %Attica version
