Projects
Kontact:4.13:Git
kdepim-runtime
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 21
View file
_service:set_version:kdepim-runtime.spec
Changed
@@ -8,7 +8,7 @@ Name: kdepim-runtime Summary: KDE PIM Runtime Environment Epoch: 1 -Version: 4.13.0.git20151005.f30ceca +Version: 4.13.0.git20151224.2372823 Release: 0%{?dist} License: GPLv2
View file
_service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151005.f30ceca.tar.gz/CMakeLists.txt -> _service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151224.2372823.tar.gz/CMakeLists.txt
Changed
@@ -35,7 +35,7 @@ set(KDEPIM_RUNTIME_VERSION_MAJOR 4) set(KDEPIM_RUNTIME_VERSION_MINOR 13) set(KDEPIM_RUNTIME_VERSION_PATCH 0) -set(KDEPIM_RUNTIME_VERSION_KOLAB 4) +set(KDEPIM_RUNTIME_VERSION_KOLAB 5) set(KDEPIM_RUNTIME_VERSION ${KDEPIM_RUNTIME_VERSION_MAJOR}.${KDEPIM_RUNTIME_VERSION_MINOR}.${KDEPIM_RUNTIME_VERSION_PATCH}.${KDEPIM_RUNTIME_VERSION_KOLAB}) configure_file(kdepim-runtime-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdepim-runtime-version.h @ONLY)
View file
_service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151005.f30ceca.tar.gz/resources/imap/imapresource.cpp -> _service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151224.2372823.tar.gz/resources/imap/imapresource.cpp
Changed
@@ -39,6 +39,7 @@ { m_pool->setPasswordRequester( new SettingsPasswordRequester( this, m_pool ) ); m_pool->setSessionUiProxy( SessionUiProxy::Ptr( new SessionUiProxy ) ); + m_pool->setClientId( clientId() ); } ImapResource::~ImapResource() @@ -50,6 +51,10 @@ return i18n( "IMAP Account" ); } +QByteArray ImapResource::clientId() const +{ + return "Kontact IMAP Resource"; +} KDialog* ImapResource::createConfigureDialog(WId windowId) {
View file
_service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151005.f30ceca.tar.gz/resources/imap/imapresource.h -> _service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151224.2372823.tar.gz/resources/imap/imapresource.h
Changed
@@ -42,6 +42,7 @@ protected: virtual QString defaultName() const; + virtual QByteArray clientId() const; protected Q_SLOTS: void onConfigurationDone( int result );
View file
_service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151005.f30ceca.tar.gz/resources/imap/sessionpool.cpp -> _service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151224.2372823.tar.gz/resources/imap/sessionpool.cpp
Changed
@@ -30,6 +30,7 @@ #include <kimap/capabilitiesjob.h> #include <kimap/logoutjob.h> #include <kimap/namespacejob.h> +#include <kimap/idjob.h> #include "imapaccount.h" #include "passwordrequesterinterface.h" @@ -474,11 +475,22 @@ QObject::connect( nsJob, SIGNAL(result(KJob*)), SLOT(onNamespacesTestDone(KJob*)) ); nsJob->start(); return; + } else if ( m_capabilities.contains( QLatin1String("ID") ) ) { + KIMAP::IdJob *idJob = new KIMAP::IdJob( capJob->session() ); + idJob->setField("name", m_clientId); + QObject::connect( idJob, SIGNAL(result(KJob*)), SLOT(onIdDone(KJob*)) ); + idJob->start(); + return; } else { declareSessionReady( capJob->session() ); } } +void SessionPool::setClientId( const QByteArray &clientId ) +{ + m_clientId = clientId; +} + void SessionPool::onNamespacesTestDone( KJob *job ) { KIMAP::NamespaceJob *nsJob = qobject_cast<KIMAP::NamespaceJob*>( job ); @@ -507,7 +519,26 @@ nsJob->sharedNamespaces(); } - declareSessionReady( nsJob->session() ); + if ( m_capabilities.contains( QLatin1String("ID") ) ) { + KIMAP::IdJob *idJob = new KIMAP::IdJob( nsJob->session() ); + idJob->setField("name", m_clientId); + QObject::connect( idJob, SIGNAL(result(KJob*)), SLOT(onIdDone(KJob*)) ); + idJob->start(); + return; + } else { + declareSessionReady( nsJob->session() ); + } +} + +void SessionPool::onIdDone( KJob *job ) +{ + KIMAP::IdJob *idJob = qobject_cast<KIMAP::IdJob*>( job ); + //Can happen if we disonnected meanwhile + if (!m_connectingPool.contains(idJob->session())) { + emit connectDone( CancelledError, i18n( "Disconnected during login.") ); + return; + } + declareSessionReady( idJob->session() ); } void SessionPool::onSessionStateChanged(KIMAP::Session::State newState, KIMAP::Session::State oldState)
View file
_service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151005.f30ceca.tar.gz/resources/imap/sessionpool.h -> _service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151224.2372823.tar.gz/resources/imap/sessionpool.h
Changed
@@ -71,6 +71,8 @@ KIMAP::SessionUiProxy::Ptr sessionUiProxy() const; void setSessionUiProxy( KIMAP::SessionUiProxy::Ptr proxy ); + void setClientId( const QByteArray &clientId ); + bool isConnected() const; bool connect( ImapAccount *account ); void disconnect( SessionTermination termination = LogoutSession ); @@ -104,6 +106,7 @@ void onLoginDone( KJob *job ); void onCapabilitiesTestDone( KJob *job ); void onNamespacesTestDone( KJob *job ); + void onIdDone( KJob *job ); void onSessionStateChanged(KIMAP::Session::State newState, KIMAP::Session::State oldState); void onSessionDestroyed(QObject*); @@ -134,6 +137,7 @@ QList<KIMAP::MailBoxDescriptor> m_personalNamespaces; QList<KIMAP::MailBoxDescriptor> m_userNamespaces; QList<KIMAP::MailBoxDescriptor> m_sharedNamespaces; + QByteArray m_clientId; }; #endif
View file
_service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151005.f30ceca.tar.gz/resources/kolab/kolabhelpers.cpp -> _service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151224.2372823.tar.gz/resources/kolab/kolabhelpers.cpp
Changed
@@ -27,6 +27,7 @@ #include <kolabobject.h> #include <errorhandler.h> #include <KLocalizedString> +#include <QColor> #include "tracer.h" bool KolabHelpers::checkForErrors(const Akonadi::Item &item) @@ -432,6 +433,23 @@ annotations["/shared" KOLAB_FOLDER_TYPE_ANNOTATION] = value; } +QColor KolabHelpers::getFolderColor(const QMap<QByteArray, QByteArray> &annotations) +{ + // kolab saves the color without a "#", so we need to add it to the rgb string to have a propper QColor + if (annotations.contains("/shared" KOLAB_COLOR_ANNOTATION) && !annotations.value("/shared" KOLAB_COLOR_ANNOTATION).isEmpty()) { + return QColor(QLatin1String("#") + annotations.value("/shared" KOLAB_COLOR_ANNOTATION)); + } else if (annotations.contains("/private" KOLAB_COLOR_ANNOTATION) && !annotations.value("/private" KOLAB_COLOR_ANNOTATION).isEmpty()) { + return QColor(QLatin1String("#") + annotations.value("/private" KOLAB_COLOR_ANNOTATION)); + } + return QColor(); +} + +void KolabHelpers::setFolderColor(QMap<QByteArray, QByteArray> &annotations, const QColor &color) +{ + // kolab saves the color without a "#", so we need to delete the prefix "#" if we save it to the annotations + annotations["/shared" KOLAB_COLOR_ANNOTATION] = color.name().toAscii().remove(0,1); +} + QString KolabHelpers::getIcon(Kolab::FolderType type) { switch (type) {
View file
_service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151005.f30ceca.tar.gz/resources/kolab/kolabhelpers.h -> _service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151224.2372823.tar.gz/resources/kolab/kolabhelpers.h
Changed
@@ -24,6 +24,10 @@ #include <kolabdefinitions.h> //libkolab #include <formathelpers.h> //libkolab +#define KOLAB_COLOR_ANNOTATION "/vendor/kolab/color" + +class QColor; + class KolabHelpers { public: static bool checkForErrors(const Akonadi::Item &affectedItem); @@ -33,6 +37,8 @@ static Kolab::FolderType folderTypeFromString(const QByteArray &folderTypeName); static QByteArray getFolderTypeAnnotation( const QMap<QByteArray, QByteArray> &annotations); static void setFolderTypeAnnotation( QMap<QByteArray, QByteArray> &annotations, const QByteArray &value); + static QColor getFolderColor(const QMap<QByteArray, QByteArray> &annotations); + static void setFolderColor(QMap<QByteArray, QByteArray> &annotations, const QColor &color); static Kolab::ObjectType getKolabTypeFromMimeType(const QString &type); static QByteArray kolabTypeForMimeType( const QStringList &contentMimeTypes ); static QStringList getContentMimeTypes(Kolab::FolderType type);
View file
_service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151005.f30ceca.tar.gz/resources/kolab/kolabresource.cpp -> _service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151224.2372823.tar.gz/resources/kolab/kolabresource.cpp
Changed
@@ -25,6 +25,8 @@ #include <retrieveitemstask.h> #include <collectionannotationsattribute.h> #include <changecollectiontask.h> +#include <akonadi/attributefactory.h> +#include <akonadi/collectioncolorattribute.h> #include <akonadi/calendar/blockalarmsattribute.h> #include <KWindowSystem> @@ -47,6 +49,7 @@ KolabResource::KolabResource(const QString& id) :ImapResource(id) { + Akonadi::AttributeFactory::registerAttribute<Akonadi::CollectionColorAttribute>(); //Load translations from imap resource KGlobal::locale()->insertCatalog(QLatin1String("akonadi_imap_resource")); //Ensure we have up-to date metadata before attempting to sync folder @@ -75,11 +78,16 @@ Q_ASSERT(!settings()->retrieveMetadataOnFolderListing()); } -QString KolabResource::defaultName() +QString KolabResource::defaultName() const { return i18n("Kolab Resource"); } +QByteArray KolabResource::clientId() const +{ + return "Kontact Kolab Resource 4/KOLAB"; +} + KDialog *KolabResource::createConfigureDialog(WId windowId) { SetupServer *dlg = new SetupServer( this, windowId ); @@ -148,11 +156,24 @@ Trace() << collection.id(); //Set the annotations on new folders const QByteArray kolabType = KolabHelpers::kolabTypeForMimeType(collection.contentMimeTypes()); + Akonadi::Collection col = collection; + Akonadi::CollectionAnnotationsAttribute *attr = col.attribute<Akonadi::CollectionAnnotationsAttribute>(Akonadi::Collection::AddIfMissing); + QMap<QByteArray, QByteArray> annotations = attr->annotations(); + + bool changed = false; + Akonadi::CollectionColorAttribute *colorAttribute = col.attribute<Akonadi::CollectionColorAttribute>(); + if (colorAttribute) { + const QColor color = colorAttribute->color(); + if (color.isValid()) { + KolabHelpers::setFolderColor(annotations, color); + changed = true; + } + } if (!kolabType.isEmpty()) { - Akonadi::Collection col = collection; - Akonadi::CollectionAnnotationsAttribute *attr = col.attribute<Akonadi::CollectionAnnotationsAttribute>(Akonadi::Collection::AddIfMissing); - QMap<QByteArray, QByteArray> annotations = attr->annotations(); KolabHelpers::setFolderTypeAnnotation(annotations, kolabType); + changed = true; + } + if (changed) { attr->setAnnotations(annotations); return col; } @@ -172,11 +193,15 @@ void KolabResource::collectionChanged(const Akonadi::Collection& collection, const QSet< QByteArray >& parts) { Trace() << collection.id() << parts; + QSet<QByteArray> p = parts; //Update annotations if necessary const Akonadi::Collection col = updateAnnotations(collection); + if(parts.contains(Akonadi::CollectionColorAttribute().type())) { + p << Akonadi::CollectionAnnotationsAttribute().type(); + } //TODO we need to save the collections as well if the annotations have changed emit status( AgentBase::Running, i18nc( "@info:status", "Updating folder '%1'", collection.name() ) ); - ChangeCollectionTask *task = new ChangeCollectionTask( createResourceState(TaskArguments(collection, parts)), this ); + ChangeCollectionTask *task = new ChangeCollectionTask( createResourceState(TaskArguments(collection, p)), this ); task->syncEnabledState(true); startTask(task); }
View file
_service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151005.f30ceca.tar.gz/resources/kolab/kolabresource.h -> _service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151224.2372823.tar.gz/resources/kolab/kolabresource.h
Changed
@@ -62,7 +62,8 @@ const Akonadi::Relation::List &addedRelations, const Akonadi::Relation::List &removedRelations); - virtual QString defaultName(); + virtual QString defaultName() const; + virtual QByteArray clientId() const; private Q_SLOTS: void retrieveTags();
View file
_service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151005.f30ceca.tar.gz/resources/kolab/kolabretrievecollectionstask.cpp -> _service:recompress:tar_scm:kdepim-runtime-4.13.0.git20151224.2372823.tar.gz/resources/kolab/kolabretrievecollectionstask.cpp
Changed
@@ -33,6 +33,7 @@ #include <kimap/myrightsjob.h> #include <akonadi/cachepolicy.h> +#include <akonadi/collectioncolorattribute.h> #include <akonadi/entitydisplayattribute.h> #include <akonadi/kmime/messageparts.h> #include <akonadi/collectionidentificationattribute.h> @@ -42,6 +43,7 @@ #include <KDE/KDebug> #include <KDE/KLocale> +#include <QColor> bool isNamespaceFolder(const QString &path, const QList<KIMAP::MailBoxDescriptor> &namespaces, bool matchCompletePath = false) @@ -196,6 +198,8 @@ { mRequestedMetadata << "/shared/vendor/kolab/folder-type"; mRequestedMetadata << "/private/vendor/kolab/folder-type"; + mRequestedMetadata << "/shared" KOLAB_COLOR_ANNOTATION + << "/private" KOLAB_COLOR_ANNOTATION; } KolabRetrieveCollectionsTask::~KolabRetrieveCollectionsTask() @@ -480,6 +484,10 @@ const Kolab::FolderType folderType = KolabHelpers::folderTypeFromString(type); // kDebug() << mailbox << metadata << type << folderType << KolabHelpers::getContentMimeTypes(folderType); collection.setContentMimeTypes(KolabHelpers::getContentMimeTypes(folderType)); + const QColor color = KolabHelpers::getFolderColor(metadata); + if (color.isValid()) { + collection.attribute<Akonadi::CollectionColorAttribute>(Akonadi::Collection::AddIfMissing)->setColor(color); + } QSet<QByteArray> keepLocalChanges = collection.keepLocalChanges(); keepLocalChanges.remove(cContentMimeTypes); collection.setKeepLocalChanges(keepLocalChanges);
View file
_service:set_version:kdepim-runtime.dsc
Changed
@@ -2,7 +2,7 @@ Source: kdepim-runtime Binary: kdepim-runtime, kdepim-runtime-dbg Architecture: any -Version: 4.13.0.git20151005.f30ceca +Version: 4.13.0.git20151224.2372823 Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org> Uploaders: Sune Vuorela <debian@pusling.com>, Fathi Boudra <fabo@debian.org>, Modestas Vainius <modax@debian.org>, George Kiagiadakis <kiagiadakis.george@gmail.com>, Maximiliano Curia <maxy@debian.org> Homepage: http://pim.kde.org/
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.