Hello community,
here is the log from the commit of package attica for openSUSE:Factory
checked in at Tue Jul 20 12:48:39 CEST 2010.
--------
--- KDE/attica/attica.changes 2010-05-07 11:23:06.000000000 +0200
+++ /mounts/work_src_done/STABLE/attica/attica.changes 2010-07-20 11:11:22.000000000 +0200
@@ -1,0 +2,17 @@
+Wed May 19 14:31:42 CEST 2010 - dmueller@suse.de
+
+- update to released 0.1.4 tarball:
+ - includes upstream changelog (no code change)
+
+-------------------------------------------------------------------
+Fri May 7 13:05:00 UTC 2010 - tittiatcoke@gmail.com
+
+- update to 0.1.4 (trunk)
+ - Remove function decls without body introduced in 0.1.3
+ - Add functions to check for provider services (parts of the api
+ they implement)
+ - Make adding, disabling and removing default providers possible
+ (so we can have other providers than openDesktop.org)
+
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
attica-0.1.3.tar.bz2
attica-pkconfig.patch
New:
----
attica-0.1.4.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ attica.spec ++++++
--- /var/tmp/diff_new_pack.oEbHtc/_old 2010-07-20 12:48:31.000000000 +0200
+++ /var/tmp/diff_new_pack.oEbHtc/_new 2010-07-20 12:48:31.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package attica (Version 0.1.3)
+# spec file for package attica (Version 0.1.4)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -20,7 +20,7 @@
Name: attica
BuildRequires: cmake kde4-filesystem libqt4-devel
Url: http://websvn.kde.org/trunk/kdesupport/attica
-Version: 0.1.3
+Version: 0.1.4
Release: 1
License: LGPLv2.1+
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -29,7 +29,6 @@
Requires: libqt4 > 4.4
Source: attica-%{version}.tar.bz2
Source99: baselibs.conf
-Patch0: attica-pkconfig.patch
Requires: libattica0 = %{version}
%description
@@ -74,7 +73,6 @@
%prep
%setup -q -n attica-%{version}
-%patch0
%build
%cmake_kde4 -d build
++++++ attica-0.1.3.tar.bz2 -> attica-0.1.4.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/CMakeLists.txt new/attica-0.1.4/CMakeLists.txt
--- old/attica-0.1.3/CMakeLists.txt 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/CMakeLists.txt 2010-05-17 18:15:20.000000000 +0200
@@ -2,7 +2,7 @@
set(CMAKE_LIBATTICA_VERSION_MAJOR 0 CACHE INT "Major Attica version number" FORCE)
set(CMAKE_LIBATTICA_VERSION_MINOR 1 CACHE INT "Minor Attica version number" FORCE)
-set(CMAKE_LIBATTICA_VERSION_PATCH 3 CACHE INT "Release Attica version number" FORCE)
+set(CMAKE_LIBATTICA_VERSION_PATCH 4 CACHE INT "Release Attica version number" FORCE)
set(CMAKE_LIBATTICA_VERSION_STRING "${CMAKE_LIBATTICA_VERSION_MAJOR}.${CMAKE_LIBATTICA_VERSION_MINOR}.${CMAKE_LIBATTICA_VERSION_PATCH}" CACHE STRING "Attica version string" FORCE)
cmake_minimum_required(VERSION 2.6)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/ChangeLog new/attica-0.1.4/ChangeLog
--- old/attica-0.1.3/ChangeLog 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/ChangeLog 2010-05-17 18:15:20.000000000 +0200
@@ -14,3 +14,9 @@
- Win and Mac compile/link fixes
- Fix crash when multiple apps would use attica simultaneously: do not delete root component of qtplugins
+0.1.4
+ - Remove function decls without body introduced in 0.1.3
+ - Add functions to check for provider services (parts of the api they implement)
+ - Make adding, disabling and removing default providers possible (so we can have other
+ providers than openDesktop.org)
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/lib/atticabasejob.h new/attica-0.1.4/lib/atticabasejob.h
--- old/attica-0.1.3/lib/atticabasejob.h 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/lib/atticabasejob.h 2010-05-17 18:15:20.000000000 +0200
@@ -55,7 +55,6 @@
void dataFinished();
protected:
- BaseJob(const QSharedPointer<PlatformDependent>& internals);
BaseJob(PlatformDependent* internals);
void setMetadata(const Metadata& data) const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/lib/cmake/libattica.pc.cmake new/attica-0.1.4/lib/cmake/libattica.pc.cmake
--- old/attica-0.1.3/lib/cmake/libattica.pc.cmake 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/lib/cmake/libattica.pc.cmake 2010-05-17 18:15:20.000000000 +0200
@@ -6,7 +6,7 @@
Name: libattica
Description: Qt library to access Open Collaboration Services
#Requires:
-Version: ${ATTICA_VERSION_MAJOR}.${ATTICA_VERSION_MINOR}.${ATTICA_VERSION_PATCH}
+Version: ${CMAKE_LIBATTICA_VERSION_MAJOR}.${CMAKE_LIBATTICA_VERSION_MINOR}.${CMAKE_LIBATTICA_VERSION_PATCH}
Libs: -L${LIB_DESTINATION} -lattica
Cflags: -I${CMAKE_INSTALL_PREFIX}/include
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/lib/getjob.h new/attica-0.1.4/lib/getjob.h
--- old/attica-0.1.3/lib/getjob.h 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/lib/getjob.h 2010-05-17 18:15:20.000000000 +0200
@@ -37,7 +37,6 @@
Q_OBJECT
protected:
- GetJob(const QSharedPointer<PlatformDependent>& internals, const QNetworkRequest& request);
GetJob(PlatformDependent* internals, const QNetworkRequest& request);
private:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/lib/itemjob.h new/attica-0.1.4/lib/itemjob.h
--- old/attica-0.1.3/lib/itemjob.h 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/lib/itemjob.h 2010-05-17 18:15:20.000000000 +0200
@@ -37,7 +37,6 @@
T result() const;
private:
- ItemJob(const QSharedPointer<PlatformDependent>& internals, const QNetworkRequest& request);
ItemJob(PlatformDependent*, const QNetworkRequest& request);
virtual void parse(const QString& xml);
T m_item;
@@ -52,8 +51,6 @@
T result() const;
private:
- ItemPostJob(const QSharedPointer<PlatformDependent>& internals, const QNetworkRequest& request, QIODevice * data);
- ItemPostJob(const QSharedPointer<PlatformDependent>& internals, const QNetworkRequest& request, const StringMap& parameters = StringMap());
ItemPostJob(PlatformDependent* internals, const QNetworkRequest& request, QIODevice * data);
ItemPostJob(PlatformDependent* internals, const QNetworkRequest& request, const StringMap& parameters = StringMap());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/lib/listjob.h new/attica-0.1.4/lib/listjob.h
--- old/attica-0.1.3/lib/listjob.h 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/lib/listjob.h 2010-05-17 18:15:20.000000000 +0200
@@ -43,7 +43,6 @@
virtual void parse(const QString& xml);
private:
- ListJob(const QSharedPointer<PlatformDependent>& internals, const QNetworkRequest& request);
ListJob(PlatformDependent* internals, const QNetworkRequest& request);
typename T::List m_itemList;
friend class Attica::Provider;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/lib/platformdependent.h new/attica-0.1.4/lib/platformdependent.h
--- old/attica-0.1.3/lib/platformdependent.h 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/lib/platformdependent.h 2010-05-17 18:15:20.000000000 +0200
@@ -35,6 +35,7 @@
class QNetworkRequest;
class QString;
class QUrl;
+class QStringList;
namespace Attica {
@@ -43,6 +44,15 @@
public:
virtual ~PlatformDependent() {}
virtual QList<QUrl> getDefaultProviderFiles() const = 0;
+ virtual void addDefaultProviderFile(const QUrl& url) = 0;
+ virtual void removeDefaultProviderFile(const QUrl& url) = 0;
+
+ /**
+ * Providers are enabled by default. Use this call to disable or enable them later.
+ */
+ virtual void enableProvider(const QUrl& baseUrl, bool enabled) const = 0;
+ virtual bool isEnabled(const QUrl& baseUrl) const = 0;
+
virtual bool hasCredentials(const QUrl& baseUrl) const = 0;
virtual bool loadCredentials(const QUrl& baseUrl, QString& user, QString& password) = 0;
virtual bool askForCredentials(const QUrl& baseUrl, QString& user, QString& password) = 0;
@@ -55,7 +65,7 @@
}
-Q_DECLARE_INTERFACE(Attica::PlatformDependent, "org.kde.Attica.Internals/1.0")
+Q_DECLARE_INTERFACE(Attica::PlatformDependent, "org.kde.Attica.Internals/1.2")
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/lib/postjob.h new/attica-0.1.4/lib/postjob.h
--- old/attica-0.1.3/lib/postjob.h 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/lib/postjob.h 2010-05-17 18:15:20.000000000 +0200
@@ -40,10 +40,6 @@
Q_OBJECT
protected:
- PostJob(const QSharedPointer<PlatformDependent>& internals, const QNetworkRequest& request, QIODevice* data);
- PostJob(const QSharedPointer<PlatformDependent>& internals, const QNetworkRequest& request, const StringMap& parameters = StringMap());
- PostJob(const QSharedPointer<PlatformDependent>& internals, const QNetworkRequest& request, const QByteArray& byteArray);
-
PostJob(PlatformDependent* internals, const QNetworkRequest& request, QIODevice* data);
PostJob(PlatformDependent* internals, const QNetworkRequest& request, const StringMap& parameters = StringMap());
PostJob(PlatformDependent* internals, const QNetworkRequest& request, const QByteArray& byteArray);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/lib/provider.cpp new/attica-0.1.4/lib/provider.cpp
--- old/attica-0.1.3/lib/provider.cpp 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/lib/provider.cpp 2010-05-17 18:15:20.000000000 +0200
@@ -67,19 +67,53 @@
QUrl m_baseUrl;
QUrl m_icon;
QString m_name;
- PlatformDependent* m_internals;
QString m_credentialsUserName;
QString m_credentialsPassword;
-
+ QString m_personVersion;
+ QString m_friendVersion;
+ QString m_messageVersion;
+ QString m_activityVersion;
+ QString m_contentVersion;
+ QString m_fanVersion;
+ QString m_knowledgebaseVersion;
+ QString m_eventVersion;
+ QString m_commentVersion;
+ PlatformDependent* m_internals;
+
+ Private()
+ :m_internals(0)
+ {}
+
Private(const Private& other)
: QSharedData(other), m_baseUrl(other.m_baseUrl), m_name(other.m_name)
, m_internals(other.m_internals), m_credentialsUserName(other.m_credentialsUserName)
, m_credentialsPassword(other.m_credentialsPassword)
+ , m_personVersion(other.m_personVersion)
+ , m_friendVersion(other.m_friendVersion)
+ , m_messageVersion(other.m_messageVersion)
+ , m_activityVersion(other.m_activityVersion)
+ , m_contentVersion(other.m_contentVersion)
+ , m_fanVersion(other.m_fanVersion)
+ , m_knowledgebaseVersion(other.m_knowledgebaseVersion)
+ , m_eventVersion(other.m_eventVersion)
+ , m_commentVersion(other.m_commentVersion)
{
}
- Private(PlatformDependent* internals, const QUrl& baseUrl, const QString& name, const QUrl& icon)
+Private(PlatformDependent* internals, const QUrl& baseUrl, const QString& name, const QUrl& icon,
+ const QString& person, const QString& friendV, const QString& message,
+ const QString& activity, const QString& content, const QString& fan,
+ const QString& knowledgebase, const QString& event, const QString& comment)
: m_baseUrl(baseUrl), m_icon(icon), m_name(name), m_internals(internals)
+ , m_personVersion(person)
+ , m_friendVersion(friendV)
+ , m_messageVersion(message)
+ , m_activityVersion(activity)
+ , m_contentVersion(content)
+ , m_fanVersion(fan)
+ , m_knowledgebaseVersion(knowledgebase)
+ , m_eventVersion(event)
+ , m_commentVersion(comment)
{
if (m_baseUrl.isEmpty()) {
return;
@@ -99,7 +133,7 @@
Provider::Provider()
- : d(new Private(0, QUrl(), QString(), QUrl()))
+ : d(new Private)
{
}
@@ -108,8 +142,11 @@
{
}
-Provider::Provider(PlatformDependent* internals, const QUrl& baseUrl, const QString& name, const QUrl& icon)
- : d(new Private(internals, baseUrl, name, icon))
+Provider::Provider(PlatformDependent* internals, const QUrl& baseUrl, const QString& name, const QUrl& icon,
+ const QString& person, const QString& friendV, const QString& message,
+ const QString& activity, const QString& content, const QString& fan,
+ const QString& knowledgebase, const QString& event, const QString& comment)
+ : d(new Private(internals, baseUrl, name, icon, person, friendV, message, activity, content, fan, knowledgebase, event, comment))
{
}
@@ -134,6 +171,15 @@
return d->m_baseUrl.isValid();
}
+bool Provider::isEnabled() const
+{
+ return d->m_internals->isEnabled(d->m_baseUrl);
+}
+
+void Provider::setEnabled(bool enabled)
+{
+ d->m_internals->enableProvider(d->m_baseUrl, enabled);
+}
QString Provider::name() const
{
@@ -635,13 +681,11 @@
return request;
}
-
QNetworkRequest Provider::createRequest(const QString& path)
{
return createRequest(createUrl(path));
}
-
ItemJob<Person>* Provider::doRequestPerson(const QUrl& url)
{
return new ItemJob<Person>(d->m_internals, createRequest(url));
@@ -671,3 +715,69 @@
{
return new ListJob<Message>(d->m_internals, createRequest(url));
}
+
+QString Provider::activityServiceVersion() const
+{
+ return d->m_activityVersion;
+}
+QString Provider::commentServiceVersion() const
+{
+ return d->m_commentVersion;
+}
+QString Provider::contentServiceVersion() const
+{
+ return d->m_contentVersion;
+}
+QString Provider::fanServiceVersion() const
+{
+ return d->m_fanVersion;
+}
+QString Provider::friendServiceVersion() const
+{
+ return d->m_friendVersion;
+}
+QString Provider::knowledgebaseServiceVersion() const
+{
+ return d->m_knowledgebaseVersion;
+}
+QString Provider::messageServiceVersion() const
+{
+ return d->m_messageVersion;
+}
+QString Provider::personServiceVersion() const
+{
+ return d->m_personVersion;
+}
+
+bool Provider::hasActivityService() const
+{
+ return !d->m_activityVersion.isEmpty();
+}
+bool Provider::hasCommentService() const
+{
+ return !d->m_commentVersion.isEmpty();
+}
+bool Provider::hasContentService() const
+{
+ return !d->m_contentVersion.isEmpty();
+}
+bool Provider::hasFanService() const
+{
+ return !d->m_fanVersion.isEmpty();
+}
+bool Provider::hasFriendService() const
+{
+ return !d->m_friendVersion.isEmpty();
+}
+bool Provider::hasKnowledgebaseService() const
+{
+ return !d->m_knowledgebaseVersion.isEmpty();
+}
+bool Provider::hasMessageService() const
+{
+ return !d->m_messageVersion.isEmpty();
+}
+bool Provider::hasPersonService() const
+{
+ return !d->m_personVersion.isEmpty();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/lib/provider.h new/attica-0.1.4/lib/provider.h
--- old/attica-0.1.3/lib/provider.h 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/lib/provider.h 2010-05-17 18:15:20.000000000 +0200
@@ -64,6 +64,30 @@
*
* Accessing functions of the Provider returns a Job class that
* takes care of accessing the server and parsing the result.
+ *
+ * Provider files are xml of the form:
+ <pre>
+ <provider>
+ <id>opendesktop</id>
+ <location>https://api.opendesktop.org/v1/</location>
+ <name>openDesktop.org</name>
+ <icon></icon>
+ <termsofuse>https://opendesktop.org/terms/</termsofuse>
+ <register>https://opendesktop.org/usermanager/new.php</register>
+ <services>
+ <person ocsversion="1.3" />
+ <friend ocsversion="1.3" />
+ <message ocsversion="1.3" />
+ <activity ocsversion="1.3" />
+ <content ocsversion="1.3" />
+ <fan ocsversion="1.3" />
+ <knowledgebase ocsversion="1.3" />
+ <event ocsversion="1.3" />
+ <comment ocsversion="1.2" />
+ </services>
+</provider>
+ </pre>
+ * The server provides the services specified in the services section, not necessarily all of them.
*/
class ATTICA_EXPORT Provider
{
@@ -73,8 +97,27 @@
Provider& operator=(const Provider& other);
~Provider();
+ /**
+ Returns true if the provider has been set up and can be used.
+ */
bool isValid() const;
+
+ /**
+ Test if the provider is enabled by the settings.
+ The application can choose to ignore this, but the user settings should be respected.
+ */
+ bool isEnabled() const;
+ void setEnabled(bool enabled);
+
+ /**
+ A url that identifies this provider.
+ This should be used as identifier when refering to this provider but you don't want to use the full provider object.
+ */
QUrl baseUrl() const;
+
+ /**
+ A name for the provider that can be displayed to the user
+ */
QString name() const;
enum SortMode {
@@ -84,11 +127,112 @@
Downloads
};
- bool hasCredentials();
+ /**
+ Test if the server supports the person part of the API
+ */
+ bool hasPersonService() const;
+ /**
+ Version of the person part of the API
+ */
+ QString personServiceVersion() const;
+
+ /**
+ Test if the server supports the friend part of the API
+ */
+ bool hasFriendService() const;
+
+ /**
+ Version of the friend part of the API
+ */
+ QString friendServiceVersion() const;
+
+ /**
+ Test if the server supports the message part of the API
+ */
+ bool hasMessageService() const;
+ /**
+ Version of the message part of the API
+ */
+ QString messageServiceVersion() const;
+
+ /**
+ Test if the server supports the activity part of the API
+ */
+ bool hasActivityService() const;
+ /**
+ Version of the activity part of the API
+ */
+ QString activityServiceVersion() const;
+
+ /**
+ Test if the server supports the content part of the API
+ */
+ bool hasContentService() const;
+ /**
+ Version of the content part of the API
+ */
+ QString contentServiceVersion() const;
+
+ /**
+ Test if the server supports the fan part of the API
+ */
+ bool hasFanService() const;
+ /**
+ Version of the fan part of the API
+ */
+ QString fanServiceVersion() const;
+
+ /**
+ Test if the server supports the knowledgebase part of the API
+ */
+ bool hasKnowledgebaseService() const;
+ /**
+ Version of the knowledgebase part of the API
+ */
+ QString knowledgebaseServiceVersion() const;
+
+ /**
+ Test if the server supports the comments part of the API
+ */
+ bool hasCommentService() const;
+ /**
+ Version of the comments part of the API
+ */
+ QString commentServiceVersion() const;
+
+ /**
+ Test if the provider has user name/password available.
+ This does not yet open kwallet in case the KDE plugin is used.
+ @return true if the provider has login information
+ */
bool hasCredentials() const;
+ bool hasCredentials();
+
+ /**
+ Load user name and password from the store.
+ Attica will remember the loaded values and use them from this point on.
+ @param user reference that returns the user name
+ @param password reference that returns the password
+ @return if credentials could be loaded
+ */
bool loadCredentials(QString& user, QString& password);
+
+ /**
+ Sets (and remembers) user name and password for this provider.
+ To remove the data an empty username should be passed.
+ @param user the user (login) name
+ @param password the password
+ @return if credentials could be saved
+ */
bool saveCredentials(const QString& user, const QString& password);
+ /**
+ Test if the server accepts the login/password.
+ This function does not actually set the credentials. Use saveCredentials for that purpose.
+ @param user the user (login) name
+ @param password the password
+ @return the job that will contain the success of the login as metadata
+ */
PostJob* checkLogin(const QString& user, const QString& password);
// Person part of OCS
@@ -219,14 +363,13 @@
class Private;
QExplicitlySharedDataPointer<Private> d;
- // old constructor: used to pass internals as QSharedPointer, but changed to pointer
- // deleting the root objects of plugins is evil (see QPluginLoaded docs)
- Provider(const QSharedPointer<PlatformDependent>& internals, const QUrl& baseUrl, const QString& name, const QUrl& icon = QUrl());
- // FIXME use baseUrl as id
Provider(PlatformDependent* internals, const QUrl& baseUrl, const QString& name, const QUrl& icon = QUrl());
-
- // TODO remove
- friend class ProviderManager;
+ Provider(PlatformDependent* internals, const QUrl& baseUrl, const QString& name, const QUrl& icon,
+ const QString& person, const QString& friendV, const QString& message,
+ const QString& activity, const QString& content, const QString& fan,
+ const QString& knowledgebase, const QString& event, const QString& comment);
+
+friend class ProviderManager;
};
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/attica-0.1.3/lib/providermanager.cpp new/attica-0.1.4/lib/providermanager.cpp
--- old/attica-0.1.3/lib/providermanager.cpp 2010-04-06 18:55:37.000000000 +0200
+++ new/attica-0.1.4/lib/providermanager.cpp 2010-05-17 18:15:20.000000000 +0200
@@ -29,7 +29,6 @@
#include