Hello community, here is the log from the commit of package attica for openSUSE:Factory checked in at 2013-06-14 15:43:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/attica (Old) and /work/SRC/openSUSE:Factory/.attica.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "attica" Changes: -------- --- /work/SRC/openSUSE:Factory/attica/attica.changes 2012-11-20 20:12:39.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.attica.new/attica.changes 2013-06-14 15:43:01.000000000 +0200 @@ -1,0 +2,9 @@ +Thu Jun 13 00:28:45 UTC 2013 - [email protected] + +- Update to version 0.4.2 + * Do HTTP basic authentication the right way + * Add API to get the URL for registering an account from the + providers file + * Qt5 build fixes + +------------------------------------------------------------------- Old: ---- attica-0.4.1.tar.bz2 New: ---- attica-0.4.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ attica.spec ++++++ --- /var/tmp/diff_new_pack.TEpICI/_old 2013-06-14 15:43:02.000000000 +0200 +++ /var/tmp/diff_new_pack.TEpICI/_new 2013-06-14 15:43:02.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package attica # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,13 +19,13 @@ %define _soversion 0_4 Name: attica -Version: 0.4.1 +Version: 0.4.2 Release: 0 Summary: Open Collaboration Service client library License: LGPL-2.1+ Group: System/GUI/KDE Url: https://projects.kde.org/attica -Source: ftp://ftp.kde.org/pub/kde/stable/attica/attica-%{version}.tar.bz2 +Source: ftp://ftp.kde.org/pub/kde/stable/%{name}/%{name}-%{version}.tar.bz2 Source99: baselibs.conf BuildRequires: cmake >= 2.8 BuildRequires: kde4-filesystem @@ -54,7 +54,7 @@ Development files for attica, Attica a library to access Open Collaboration Service servers. %prep -%setup -q -n attica-%{version} +%setup -q %build export RPM_OPT_FLAGS="%optflags -fvisibility-inlines-hidden" ++++++ attica-0.4.1.tar.bz2 -> attica-0.4.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/CMakeLists.txt new/attica-0.4.2/CMakeLists.txt --- old/attica-0.4.1/CMakeLists.txt 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/CMakeLists.txt 2013-05-01 00:45:43.000000000 +0200 @@ -1,9 +1,33 @@ project(attica) cmake_minimum_required(VERSION 2.8) -set(CMAKE_LIBATTICA_VERSION_MAJOR 0) -set(CMAKE_LIBATTICA_VERSION_MINOR 4) -set(CMAKE_LIBATTICA_VERSION_PATCH 1) +option(QT4_BUILD "Force building with Qt4 even if Qt5 is found") +if (NOT QT4_BUILD) + find_package(Qt5Core QUIET) +endif() +if (Qt5Core_FOUND) + message(STATUS "Building with Qt5 support") + find_package(ECM 0.0.6 REQUIRED NO_MODULE) + set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH}) + find_package(Qt5Transitional REQUIRED Core Network) + include(GNUInstallDirs) + set(LIB_DESTINATION "${CMAKE_INSTALL_LIBDIR}") +else() + set(QT_MIN_VERSION "4.7.0") + find_package(Qt4 REQUIRED) + set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) + set(LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Library directory name" FORCE) +endif() + +if (Qt5Core_FOUND) + set(CMAKE_LIBATTICA_VERSION_MAJOR 1) + set(CMAKE_LIBATTICA_VERSION_MINOR 0) + set(CMAKE_LIBATTICA_VERSION_PATCH 0) +else() + set(CMAKE_LIBATTICA_VERSION_MAJOR 0) + set(CMAKE_LIBATTICA_VERSION_MINOR 4) + set(CMAKE_LIBATTICA_VERSION_PATCH 2) +endif() set(CMAKE_LIBATTICA_VERSION_STRING "${CMAKE_LIBATTICA_VERSION_MAJOR}.${CMAKE_LIBATTICA_VERSION_MINOR}.${CMAKE_LIBATTICA_VERSION_PATCH}") if(NOT MSVC) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/CMakeLists.txt new/attica-0.4.2/lib/CMakeLists.txt --- old/attica-0.4.1/lib/CMakeLists.txt 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/CMakeLists.txt 2013-05-01 00:45:43.000000000 +0200 @@ -1,29 +1,10 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) -set(LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Library directory name" FORCE) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ ${CMAKE_MODULE_PATH}) -set(QT_MIN_VERSION "4.7.0") -find_package(Qt5Transitional REQUIRED - Core - Network - Test -) - -# TODO: Remove me once fixed in ECM module -if(Qt5Core_FOUND) - # Avoid errors and build in PIC mode: - # qt5/qtbase/include/QtCore/qglobal.h:1765:4: error: - # #error "You must build your code with position independent code if Qt was - # built with -reduce-relocations. " "Compile your code with -fPIC or -fPIE." - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") -endif() - include_directories( ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ) # mingw can't handle exported explicit template instantiations in a DLL @@ -122,6 +103,11 @@ DEFINE_SYMBOL ATTICA_LIB_MAKEDLL ) endif(ATTICA_STATIC_BUILD) + +if(Qt5Core_FOUND) + set_property(TARGET attica APPEND PROPERTY COMPILE_DEFINITIONS QT_DISABLE_DEPRECATED_BEFORE=0) +endif() + target_link_libraries(attica ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY}) @@ -189,6 +175,11 @@ # Add the optional subdirectory with unit tests if (ATTICA_ENABLE_TESTS) + if(Qt5Core_FOUND) + find_package(Qt5Transitional REQUIRED + Test + ) + endif() add_subdirectory(tests) endif (ATTICA_ENABLE_TESTS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/atticabasejob.cpp new/attica-0.4.2/lib/atticabasejob.cpp --- old/attica-0.4.1/lib/atticabasejob.cpp 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/atticabasejob.cpp 2013-05-01 00:45:43.000000000 +0200 @@ -26,6 +26,7 @@ #include <QtCore/QDebug> #include <QtCore/QTimer> #include <QtNetwork/QNetworkReply> +#include <QAuthenticator> #include "platformdependent.h" @@ -132,7 +133,14 @@ { d->m_reply = executeRequest(); connect(d->m_reply, SIGNAL(finished()), SLOT(dataFinished())); - //qDebug() << d->m_reply->url().toString(); + connect(d->m_reply->manager(), SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), + this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*))); +} + +void BaseJob::authenticationRequired(QNetworkReply* reply, QAuthenticator* auth) +{ + auth->setUser(reply->request().attribute((QNetworkRequest::Attribute) BaseJob::UserAttribute).toString()); + auth->setPassword(reply->request().attribute((QNetworkRequest::Attribute) BaseJob::PasswordAttribute).toString()); } void BaseJob::abort() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/atticabasejob.h new/attica-0.4.2/lib/atticabasejob.h --- old/attica-0.4.1/lib/atticabasejob.h 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/atticabasejob.h 2013-05-01 00:45:43.000000000 +0200 @@ -27,6 +27,7 @@ #include <QtCore/QSharedPointer> #include <QtCore/QUrl> #include <QtNetwork/QNetworkAccessManager> +#include <QtNetwork/QNetworkRequest> #include "atticaclient_export.h" #include "metadata.h" @@ -45,6 +46,11 @@ Metadata metadata() const; + enum NetworkRequestCustomAttributes { + UserAttribute = QNetworkRequest::User + 1, + PasswordAttribute + }; + public Q_SLOTS: void start(); void abort(); @@ -68,6 +74,7 @@ private Q_SLOTS: void doWork(); + void authenticationRequired(QNetworkReply*, QAuthenticator*); private: BaseJob(const BaseJob& other); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/cloud.cpp new/attica-0.4.2/lib/cloud.cpp --- old/attica-0.4.1/lib/cloud.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/attica-0.4.2/lib/cloud.cpp 2013-05-01 00:45:43.000000000 +0200 @@ -0,0 +1,137 @@ +/* + This file is part of KDE. + + Copyright (c) 2012 Laszlo Papp <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "cloud.h" + +using namespace Attica; + +class Cloud::Private : public QSharedData { + public: + QString m_name; + QString m_url; + QUrl m_icon; + qulonglong m_quota; + qulonglong m_free; + qulonglong m_used; + float m_relative; + QString m_key; +}; + +Cloud::Cloud() + : d(new Private) +{ +} + +Cloud::Cloud(const Attica::Cloud& other) + : d(other.d) +{ +} + +Cloud& Cloud::operator=(const Attica::Cloud& other) +{ + d = other.d; + return *this; +} + +Cloud::~Cloud() +{ +} + +void Cloud::setName(const QString& name) +{ + d->m_name = name; +} + +QString Cloud::name() const +{ + return d->m_name; +} + +void Cloud::setUrl(const QString& url) +{ + d->m_url = url; +} + +QString Cloud::url() const +{ + return d->m_url; +} + +void Cloud::setIcon(const QUrl& icon) +{ + d->m_icon = icon; +} + +QUrl Cloud::icon() const +{ + return d->m_icon; +} + +void Cloud::setQuota(qulonglong quota) +{ + d->m_quota = quota; +} + +qulonglong Cloud::quota() const +{ + return d->m_quota; +} + +void Cloud::setFree(qulonglong free) +{ + d->m_free = free; +} + +qulonglong Cloud::free() const +{ + return d->m_free; +} + +void Cloud::setUsed(qulonglong used) +{ + d->m_used = used; +} + +qulonglong Cloud::used() const +{ + return d->m_used; +} + +void Cloud::setRelative(float relative) +{ + d->m_relative = relative; +} + +float Cloud::relative() const +{ + return d->m_relative; +} + +void Cloud::setKey(const QString& key) +{ + d->m_key = key; +} + +QString Cloud::key() const +{ + return d->m_key; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/cloud.h new/attica-0.4.2/lib/cloud.h --- old/attica-0.4.1/lib/cloud.h 1970-01-01 01:00:00.000000000 +0100 +++ new/attica-0.4.2/lib/cloud.h 2013-05-01 00:45:43.000000000 +0200 @@ -0,0 +1,203 @@ +/* + This file is part of KDE. + + Copyright (c) 2012 Laszlo Papp <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef ATTICA_CLOUD_H +#define ATTICA_CLOUD_H + +#include "atticaclient_export.h" + +#include <QtCore/QList> +#include <QtCore/QSharedDataPointer> +#include <QtCore/QUrl> + +namespace Attica +{ + +class ATTICA_EXPORT Cloud +{ + public: + typedef QList<Cloud> List; + class Parser; + + /** + * Creates an empty Cloud + */ + + Cloud(); + + /** + * Copy constructor. + * @param other the Cloud to copy from + */ + + Cloud(const Cloud& other); + + /** + * Assignment operator. + * @param other the Cloud to assign from + * @return pointer to this Activity + */ + + Cloud& operator=(const Cloud& other); + + /** + * Destructor. + */ + + ~Cloud(); + + /** + * Sets the name of the Cloud service + * + * @param name the new name + */ + + void setName(const QString& name); + + /** + * Gets the name of the Cloud service. + * + * @return the name + */ + + QString name() const; + + /** + * Sets the url of the Cloud service + * + * @param url the new url + */ + + void setUrl(const QString& url); + + /** + * Gets the url of the Cloud service. + * + * @return the url + */ + + QString url() const; + + /** + * Sets the icon of the Cloud service + * + * @param icon the new icon + */ + + void setIcon(const QUrl& icon); + + /** + * Gets the icon of the Cloud service. + * + * @return the icon + */ + + QUrl icon() const; + + /** + * Sets the quota of the Cloud service + * + * @param quota the new quota + */ + + void setQuota(qulonglong quota); + + /** + * Gets the quota of the Cloud service. + * + * @return the quota + */ + + qulonglong quota() const; + + /** + * Sets the free amount of the Cloud service + * + * @param free the new free amount + */ + + void setFree(qulonglong free); + + /** + * Gets the free amount of the Cloud service. + * + * @return the free amount + */ + + qulonglong free() const; + + /** + * Sets the used amount of the Cloud service + * + * @param used the new used amount + */ + + void setUsed(qulonglong used); + + /** + * Gets the used amount of the Cloud service. + * + * @return the used amount + */ + + qulonglong used() const; + + /** + * Sets the relative of the Cloud service + * + * @param relative the new relative + */ + + void setRelative(float relative); + + /** + * Gets the relative of the Cloud service. + * + * @return the relative + */ + + float relative() const; + + /** + * Sets the private key of the Cloud service + * + * @param privateKey the new privateKey + */ + + void setKey(const QString& privateKey); + + /** + * Gets the private key of the Cloud service. + * + * @return the private key + */ + + QString key() const; + + private: + class Private; + QSharedDataPointer<Private> d; +}; + +} + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/cloudparser.cpp new/attica-0.4.2/lib/cloudparser.cpp --- old/attica-0.4.1/lib/cloudparser.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/attica-0.4.2/lib/cloudparser.cpp 2013-05-01 00:45:43.000000000 +0200 @@ -0,0 +1,66 @@ +/* + This file is part of KDE. + + Copyright (c) 2012 Laszlo Papp <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see <http://www.gnu.org/licenses/>. + +*/ + +#include "cloudparser.h" +#include "atticautils.h" + +using namespace Attica; + +Cloud Cloud::Parser::parseXml(QXmlStreamReader& xml) +{ + Cloud cloud; + + while (!xml.atEnd()) { + xml.readNext(); + + if (xml.isStartElement()) { + if (xml.name() == QLatin1String("name")) { + cloud.setName(xml.readElementText()); + } else if (xml.name() == QLatin1String("url")) { + cloud.setUrl(xml.readElementText()); + // TODO: there should be usage for the attica icon class + } else if (xml.name() == QLatin1String("icon")) { + cloud.setIcon(QUrl(xml.readElementText())); + } else if (xml.name() == QLatin1String("quota")) { + cloud.setQuota(xml.readElementText().toULongLong()); + } else if (xml.name() == QLatin1String("free")) { + cloud.setFree(xml.readElementText().toULongLong()); + } else if (xml.name() == QLatin1String("used")) { + cloud.setUsed(xml.readElementText().toULongLong()); + } else if (xml.name() == QLatin1String("relative")) { + cloud.setRelative(xml.readElementText().toFloat()); + } else if (xml.name() == QLatin1String("key")) { + cloud.setKey(xml.readElementText()); + } + } else if (xml.isEndElement() && xml.name() == QLatin1String("cloud")) { + break; + } + } + + return cloud; +} + +QStringList Cloud::Parser::xmlElement() const +{ + return QStringList(QLatin1String( "cloud" )); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/cloudparser.h new/attica-0.4.2/lib/cloudparser.h --- old/attica-0.4.1/lib/cloudparser.h 1970-01-01 01:00:00.000000000 +0100 +++ new/attica-0.4.2/lib/cloudparser.h 2013-05-01 00:45:43.000000000 +0200 @@ -0,0 +1,43 @@ +/* + This file is part of KDE. + + Copyright (c) 2012 Laszlo Papp <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see <http://www.gnu.org/licenses/>. + +*/ + +#ifndef ATTICA_CLOUDPARSER_H +#define ATTICA_CLOUDPARSER_H + +#include "cloud.h" +#include "parser.h" + + +namespace Attica { + +class Cloud::Parser : public Attica::Parser<Cloud> +{ +private: + Cloud parseXml(QXmlStreamReader& xml); + QStringList xmlElement() const; +}; + +} + + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/cmake/ECMQt4To5Porting.cmake new/attica-0.4.2/lib/cmake/ECMQt4To5Porting.cmake --- old/attica-0.4.1/lib/cmake/ECMQt4To5Porting.cmake 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/cmake/ECMQt4To5Porting.cmake 1970-01-01 01:00:00.000000000 +0100 @@ -1,216 +0,0 @@ -#============================================================================= -# Copyright 2005-2011 Kitware, Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the name of Kitware, Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#============================================================================= - -# The automoc_qt4 macro is superceded by CMAKE_AUTOMOC from CMake 2.8.6 -# A Qt 5 version is not provided by CMake or Qt. - -include(MacroAddFileDependencies) - -MACRO (QT4_GET_MOC_FLAGS _moc_flags) - SET(${_moc_flags}) - GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES) - - FOREACH(_current ${_inc_DIRS}) - IF("${_current}" MATCHES "\\.framework/?$") - STRING(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}") - SET(${_moc_flags} ${${_moc_flags}} "-F${framework_path}") - ELSE("${_current}" MATCHES "\\.framework/?$") - SET(${_moc_flags} ${${_moc_flags}} "-I${_current}") - ENDIF("${_current}" MATCHES "\\.framework/?$") - ENDFOREACH(_current ${_inc_DIRS}) - - GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS) - FOREACH(_current ${_defines}) - SET(${_moc_flags} ${${_moc_flags}} "-D${_current}") - ENDFOREACH(_current ${_defines}) - - IF(Q_WS_WIN) - SET(${_moc_flags} ${${_moc_flags}} -DWIN32) - ENDIF(Q_WS_WIN) - -ENDMACRO(QT4_GET_MOC_FLAGS) - -# helper macro to set up a moc rule -MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options) - # For Windows, create a parameters file to work around command line length limit - IF (WIN32) - # Pass the parameters in a file. Set the working directory to - # be that containing the parameters file and reference it by - # just the file name. This is necessary because the moc tool on - # MinGW builds does not seem to handle spaces in the path to the - # file given with the @ syntax. - GET_FILENAME_COMPONENT(_moc_outfile_name "${outfile}" NAME) - GET_FILENAME_COMPONENT(_moc_outfile_dir "${outfile}" PATH) - IF(_moc_outfile_dir) - SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir}) - ENDIF(_moc_outfile_dir) - SET (_moc_parameters_file ${outfile}_parameters) - SET (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}") - STRING (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}") - FILE (WRITE ${_moc_parameters_file} "${_moc_parameters}") - ADD_CUSTOM_COMMAND(OUTPUT ${outfile} - COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters - DEPENDS ${infile} - ${_moc_working_dir} - VERBATIM) - ELSE (WIN32) - ADD_CUSTOM_COMMAND(OUTPUT ${outfile} - COMMAND ${QT_MOC_EXECUTABLE} - ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile} - DEPENDS ${infile} VERBATIM) - ENDIF (WIN32) -ENDMACRO (QT4_CREATE_MOC_COMMAND) - - -MACRO(QT4_AUTOMOC) - QT4_GET_MOC_FLAGS(_moc_INCS) - - SET(_matching_FILES ) - FOREACH (_current_FILE ${ARGN}) - - GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE) - # if "SKIP_AUTOMOC" is set to true, we will not handle this file here. - # This is required to make uic work correctly: - # we need to add generated .cpp files to the sources (to compile them), - # but we cannot let automoc handle them, as the .cpp files don't exist yet when - # cmake is run for the very first time on them -> however the .cpp files might - # exist at a later run. at that time we need to skip them, so that we don't add two - # different rules for the same moc file - GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC) - - IF ( NOT _skip AND EXISTS ${_abs_FILE} ) - - FILE(READ ${_abs_FILE} _contents) - - GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH) - - STRING(REGEX MATCHALL "# *include +[^ ]+\\.moc[\">]" _match "${_contents}") - IF(_match) - FOREACH (_current_MOC_INC ${_match}) - STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}") - - GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE) - IF(EXISTS ${_abs_PATH}/${_basename}.hpp) - SET(_header ${_abs_PATH}/${_basename}.hpp) - ELSE(EXISTS ${_abs_PATH}/${_basename}.hpp) - SET(_header ${_abs_PATH}/${_basename}.h) - ENDIF(EXISTS ${_abs_PATH}/${_basename}.hpp) - SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) - QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "") - MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) - ENDFOREACH (_current_MOC_INC) - ENDIF(_match) - ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} ) - ENDFOREACH (_current_FILE) -ENDMACRO(QT4_AUTOMOC) - - -# Portability helpers. - -set(QT_QTGUI_LIBRARIES - ${Qt5Gui_LIBRARIES} - ${Qt5Widgets_LIBRARIES} - ${Qt5PrintSupport_LIBRARIES} - ${Qt5Svg_LIBRARIES} -) - -set(QT_INCLUDES - ${Qt5Gui_INCLUDE_DIRS} - ${Qt5Widgets_INCLUDE_DIRS} - ${Qt5PrintSupport_INCLUDE_DIRS} - ${Qt5Svg_INCLUDE_DIRS} -) -set(QT_QTGUI_LIBRARY ${QT_QTGUI_LIBRARIES}) - -set(_qt_modules - Core - Widgets - Script - ScriptTools - DBus - Network - Test - Designer - Concurrent - Xml - UiTools - Quick1 - WebKit - Sql - OpenGL -) - -foreach(_module ${_qt_modules}) - string(TOUPPER ${_module} _module_upper) - set(QT_QT${_module_upper}_LIBRARIES ${Qt5${_module}_LIBRARIES}) - set(QT_QT${_module_upper}_LIBRARY ${QT_QT${_module_upper}_LIBRARIES}) - list(APPEND QT_INCLUDES ${Qt5${_module}_INCLUDE_DIRS}) - set(QT_QT${_module_upper}_FOUND ${Qt5${_module}_FOUND}) -endforeach() - -list(APPEND QT_QTCORE_LIBRARIES ${Qt5Concurrent_LIBRARIES}) -list(APPEND QT_QTCORE_LIBRARY ${Qt5Concurrent_LIBRARIES}) - -set(QT_QTDECLARATIVE_LIBRARIES ${Qt5Quick1_LIBRARIES}) -set(QT_QTDECLARATIVE_LIBRARY ${Qt5Quick1_LIBRARIES}) - -macro(qt4_wrap_ui) - qt5_wrap_ui(${ARGN}) -endmacro() - -macro(qt4_wrap_cpp) - qt5_wrap_cpp(${ARGN}) -endmacro() - -macro(qt4_generate_moc) - qt5_generate_moc(${ARGN}) -endmacro() - -macro(qt4_add_dbus_adaptor) - qt5_add_dbus_adaptor(${ARGN}) -endmacro() - -macro(qt4_add_dbus_interfaces) - qt5_add_dbus_interfaces(${ARGN}) -endmacro() - -macro(qt4_add_dbus_interface) - qt5_add_dbus_interface(${ARGN}) -endmacro() - -macro(qt4_generate_dbus_interface) - qt5_generate_dbus_interface(${ARGN}) -endmacro() - -macro(qt4_add_resources) - qt5_add_resources(${ARGN}) -endmacro() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/cmake/FindQt5Transitional.cmake new/attica-0.4.2/lib/cmake/FindQt5Transitional.cmake --- old/attica-0.4.1/lib/cmake/FindQt5Transitional.cmake 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/cmake/FindQt5Transitional.cmake 1970-01-01 01:00:00.000000000 +0100 @@ -1,66 +0,0 @@ - -find_package(Qt5Core QUIET) - -if (Qt5Core_FOUND) - if (NOT Qt5Transitional_FIND_COMPONENTS) - foreach(_component - Core - Gui - DBus - Designer - Script - ScriptTools - Network - Test - Xml - Svg - Sql - Widgets - PrintSupport - Concurrent - UiTools - Quick1 - WebKit - OpenGL - ) - find_package(Qt5${_component}) - endforeach() - else() - foreach(_component ${Qt5Transitional_FIND_COMPONENTS}) - if ("${_component}" STREQUAL "Declarative") - set(_component Quick1) - endif() - find_package(Qt5${_component} REQUIRED) - if ("${_component}" STREQUAL "Gui") - find_package(Qt5Widgets REQUIRED) - find_package(Qt5PrintSupport REQUIRED) - find_package(Qt5Svg REQUIRED) - endif() - if ("${_component}" STREQUAL "Core") - find_package(Qt5Concurrent REQUIRED) - endif() - endforeach() - endif() - - set(Qt5Transitional_FOUND TRUE) - set(QT5_BUILD TRUE) - - get_filename_component(_modules_dir "${CMAKE_CURRENT_LIST_DIR}/../modules" ABSOLUTE) - include("${CMAKE_CURRENT_LIST_DIR}/ECMQt4To5Porting.cmake") # TODO: Port away from this. - include_directories(${QT_INCLUDES}) # TODO: Port away from this. -else() - foreach(_component ${Qt5Transitional_FIND_COMPONENTS}) - if("${_component}" STREQUAL "Widgets") # new in Qt5 - set(_component Gui) - elseif("${_component}" STREQUAL "Concurrent") # new in Qt5 - set(_component Core) - endif() - list(APPEND _components Qt${_component}) - endforeach() - find_package(Qt4 REQUIRED ${_components}) - include_directories(${QT_INCLUDES}) - - if(QT4_FOUND) - set(Qt5Transitional_FOUND TRUE) - endif() -endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/postfiledata.cpp new/attica-0.4.2/lib/postfiledata.cpp --- old/attica-0.4.1/lib/postfiledata.cpp 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/postfiledata.cpp 2013-05-01 00:45:43.000000000 +0200 @@ -49,7 +49,7 @@ { d->url = url; qsrand(QTime::currentTime().secsTo(QTime(0,0,0))); - d->boundary = "----------" + randomString(42 + 13).toAscii(); + d->boundary = "----------" + randomString(42 + 13).toLatin1(); } PostFileData::~PostFileData() @@ -81,7 +81,7 @@ } QByteArray data( "--" + d->boundary + "\r\n" - "Content-Disposition: form-data; name=\"" + key.toAscii() + + "Content-Disposition: form-data; name=\"" + key.toLatin1() + "\"\r\n\r\n" + value.toUtf8() + "\r\n"); d->buffer.append(data); @@ -107,9 +107,9 @@ QByteArray data( "--" + d->boundary + "\r\n" "Content-Disposition: form-data; name=\""); - data.append(fieldName.toAscii()); + data.append(fieldName.toLatin1()); data.append("\"; filename=\"" + fileName.toUtf8() - + "\"\r\nContent-Type: " + mimeType.toAscii() + "\r\n\r\n"); + + "\"\r\nContent-Type: " + mimeType.toLatin1() + "\r\n\r\n"); d->buffer.append(data); d->buffer.append(file + QByteArray("\r\n")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/postfiledata.h new/attica-0.4.2/lib/postfiledata.h --- old/attica-0.4.1/lib/postfiledata.h 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/postfiledata.h 2013-05-01 00:45:43.000000000 +0200 @@ -25,6 +25,7 @@ #define POSTFILEDATA_H #include <QtCore/QByteArray> +#include <QtCore/QIODevice> #include <QtNetwork/QNetworkRequest> namespace Attica { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/provider.cpp new/attica-0.4.2/lib/provider.cpp --- old/attica-0.4.1/lib/provider.cpp 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/provider.cpp 2013-05-01 00:45:43.000000000 +0200 @@ -110,6 +110,7 @@ QString m_knowledgebaseVersion; QString m_eventVersion; QString m_commentVersion; + QString m_registerUrl; PlatformDependent* m_internals; Private() @@ -131,6 +132,7 @@ , m_knowledgebaseVersion(other.m_knowledgebaseVersion) , m_eventVersion(other.m_eventVersion) , m_commentVersion(other.m_commentVersion) + , m_registerUrl(other.m_registerUrl) , m_internals(other.m_internals) { } @@ -138,7 +140,7 @@ 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& knowledgebase, const QString& event, const QString& comment, const QString& registerUrl) : m_baseUrl(baseUrl), m_icon(icon), m_name(name) , m_personVersion(person) , m_friendVersion(friendV) @@ -151,6 +153,7 @@ , m_knowledgebaseVersion(knowledgebase) , m_eventVersion(event) , m_commentVersion(comment) + , m_registerUrl(registerUrl) , m_internals(internals) { if (m_baseUrl.isEmpty()) { @@ -184,7 +187,17 @@ 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) - : d(new Private(internals, baseUrl, name, icon, person, friendV, message, achievement, activity, content, fan, forum, knowledgebase, event, comment)) + : d(new Private(internals, baseUrl, name, icon, person, friendV, message, achievement, activity, content, + fan, forum, knowledgebase, event, comment, 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& registerUrl) + : d(new Private(internals, baseUrl, name, icon, person, friendV, message, achievement, activity, content, + fan, forum, knowledgebase, event, comment, registerUrl)) { } @@ -306,6 +319,10 @@ return new PostJob(d->m_internals, createRequest(QLatin1String( "person/add" )), postParameters); } +const QString& Provider::getRegisterAccountUrl() const +{ + return d->m_registerUrl; +} ItemJob<Person>* Provider::requestPerson(const QString& id) { @@ -1532,24 +1549,16 @@ QUrl Provider::createUrl(const QString& path) { QUrl url(d->m_baseUrl.toString() + path); - if (!d->m_credentialsUserName.isEmpty()) { - url.setUserName(d->m_credentialsUserName); - url.setPassword(d->m_credentialsPassword); - } return url; } QNetworkRequest Provider::createRequest(const QUrl& url) { QNetworkRequest request(url); - //qDebug() << "OCS Request:" << url; if (!d->m_credentialsUserName.isEmpty()) { - QString concatenated = d->m_credentialsUserName + QLatin1Char( ':' ) + d->m_credentialsPassword; - QByteArray data = concatenated.toLocal8Bit().toBase64(); - QString headerData = QLatin1String( "Basic " ) +QLatin1String( data ); - request.setRawHeader("Authorization" ,headerData.toLocal8Bit() ); + request.setAttribute((QNetworkRequest::Attribute) BaseJob::UserAttribute, QVariant(d->m_credentialsUserName)); + request.setAttribute((QNetworkRequest::Attribute) BaseJob::PasswordAttribute, QVariant(d->m_credentialsPassword)); } - return request; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/provider.h new/attica-0.4.2/lib/provider.h --- old/attica-0.4.1/lib/provider.h 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/provider.h 2013-05-01 00:45:43.000000000 +0200 @@ -660,6 +660,8 @@ ListJob<Topic>* requestTopics(const QString& forum, const QString& search, const QString& description, SortMode mode, int page, int pageSize); PostJob* postTopic(const QString& forumId, const QString& subject, const QString& content); + const QString& getRegisterAccountUrl() const; + protected: QUrl createUrl(const QString& path); QNetworkRequest createRequest(const QUrl& url); @@ -685,6 +687,11 @@ 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); + // kde-SC5: merge with the constructor above (i.e. remove the above one) + 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& registerUrl); friend class ProviderManager; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/providermanager.cpp new/attica-0.4.2/lib/providermanager.cpp --- old/attica-0.4.1/lib/providermanager.cpp 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/providermanager.cpp 2013-05-01 00:45:43.000000000 +0200 @@ -236,6 +236,7 @@ QString knowledgebase; QString event; QString comment; + QString registerUrl; while (!xml.atEnd() && xml.readNext()) { if (xml.isStartElement()) @@ -268,6 +269,8 @@ event = xml.attributes().value(QLatin1String( "ocsversion" )).toString(); } else if (xml.name() == QLatin1String("comment")) { comment = xml.attributes().value(QLatin1String( "ocsversion" )).toString(); + } else if (xml.name() == QLatin1String("register")) { + registerUrl = xml.readElementText(); } } else if (xml.isEndElement() && xml.name() == QLatin1String("provider")) { break; @@ -276,7 +279,8 @@ if (!baseUrl.isEmpty()) { //qDebug() << "Adding provider" << baseUrl; d->m_providers.insert(baseUrl, Provider(d->m_internals, QUrl(baseUrl), name, icon, - person, friendV, message, achievement, activity, content, fan, forum, knowledgebase, event, comment)); + person, friendV, message, achievement, activity, content, fan, forum, knowledgebase, + event, comment, registerUrl)); emit providerAdded(d->m_providers.value(baseUrl)); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/tests/persontest.cpp new/attica-0.4.2/lib/tests/persontest.cpp --- old/attica-0.4.1/lib/tests/persontest.cpp 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/tests/persontest.cpp 2013-05-01 00:45:43.000000000 +0200 @@ -59,6 +59,6 @@ QVERIFY(!person.isValid()); } -QTEST_MAIN(PersonTest); +QTEST_MAIN(PersonTest) #include "persontest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/tests/projecttest/CMakeLists.txt new/attica-0.4.2/lib/tests/projecttest/CMakeLists.txt --- old/attica-0.4.1/lib/tests/projecttest/CMakeLists.txt 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/tests/projecttest/CMakeLists.txt 2013-05-01 00:45:43.000000000 +0200 @@ -2,17 +2,15 @@ cmake_minimum_required(VERSION 2.8) set(QT_MIN_VERSION "4.7.0") -find_package(Qt5Transitional REQUIRED - Core - Network - Test - Widgets -) +if (Qt5Core_FOUND) + find_package(Qt5Transitional REQUIRED + Widgets + ) +endif() include_directories(${KDE4_INCLUDES} ${QT_INCLUDES} ${LIBATTICA_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/lib ${CMAKE_CURRENT_BINARY_DIR} ) set(editproject_UI editproject.ui) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/tests/projecttest/main.cpp new/attica-0.4.2/lib/tests/projecttest/main.cpp --- old/attica-0.4.1/lib/tests/projecttest/main.cpp 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/tests/projecttest/main.cpp 2013-05-01 00:45:43.000000000 +0200 @@ -21,7 +21,7 @@ */ -#include <QtGui/QApplication> +#include <QApplication> #include "projecttest.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/tests/projecttest/projecttest.cpp new/attica-0.4.2/lib/tests/projecttest/projecttest.cpp --- old/attica-0.4.1/lib/tests/projecttest/projecttest.cpp 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/tests/projecttest/projecttest.cpp 2013-05-01 00:45:43.000000000 +0200 @@ -23,12 +23,12 @@ #include "projecttest.h" -#include <QtGui/QLabel> -#include <QtGui/QListWidgetItem> -#include <QtGui/QMenu> -#include <QtGui/QMenuBar> -#include <QtGui/QAction> -#include <QtGui/QVBoxLayout> +#include <QLabel> +#include <QListWidgetItem> +#include <QMenu> +#include <QMenuBar> +#include <QAction> +#include <QVBoxLayout> #include <QDebug> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/tests/projecttest/projecttest.h new/attica-0.4.2/lib/tests/projecttest/projecttest.h --- old/attica-0.4.1/lib/tests/projecttest/projecttest.h 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/tests/projecttest/projecttest.h 2013-05-01 00:45:43.000000000 +0200 @@ -27,7 +27,7 @@ #include "ui_editproject.h" #include <QLabel> -#include <QtGui/QMainWindow> +#include <QMainWindow> #include <providermanager.h> #include <project.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.4.1/lib/version.h.cmake new/attica-0.4.2/lib/version.h.cmake --- old/attica-0.4.1/lib/version.h.cmake 2012-08-14 21:01:19.000000000 +0200 +++ new/attica-0.4.2/lib/version.h.cmake 2013-05-01 00:45:43.000000000 +0200 @@ -33,7 +33,7 @@ #define LIBATTICA_VERSION_MINOR ${CMAKE_LIBATTICA_VERSION_MINOR} /// @brief The Attica release version number at compile time -#define LIBATTICA_VERSION_RELEASE ${CMAKE_LIBATTICA_VERSION_RELEASE} +#define LIBATTICA_VERSION_RELEASE ${CMAKE_LIBATTICA_VERSION_PATCH} /** * \brief Create a unique number from the major, minor and release number of a %Attica version -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
