diff -Nru kdepimlibs-4.14.5/akonadi/calendar/standardcalendaractionmanager.cpp kdepimlibs-4.14.6/akonadi/calendar/standardcalendaractionmanager.cpp --- kdepimlibs-4.14.5/akonadi/calendar/standardcalendaractionmanager.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/calendar/standardcalendaractionmanager.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -79,6 +79,11 @@ mGenericManager->setContextText( StandardActionManager::CreateCollection, StandardActionManager::ErrorMessageTitle, i18n("Calendar folder creation failed")); + mGenericManager->action(Akonadi::StandardActionManager::CreateCollection)->setProperty("ContentMimeTypes", QStringList() << + QLatin1String("inode/directory") << + QLatin1String("application/x-vnd.akonadi.calendar.todo") << + QLatin1String("application/x-vnd.akonadi.calendar.event") << + QLatin1String("application/x-vnd.akonadi.calendar.journal") ); break; case Akonadi::StandardActionManager::CopyCollections: diff -Nru kdepimlibs-4.14.5/akonadi/CMakeLists.txt kdepimlibs-4.14.6/akonadi/CMakeLists.txt --- kdepimlibs-4.14.5/akonadi/CMakeLists.txt 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/CMakeLists.txt 2015-02-26 21:31:08.000000000 +0000 @@ -200,6 +200,7 @@ tagfetchjob.cpp tagdeletejob.cpp tageditwidget.cpp + tagselectwidget.cpp tagmanagementdialog.cpp tagselectiondialog.cpp tagwidget.cpp @@ -419,6 +420,8 @@ tagfetchscope.h tagdeletejob.h tagwidget.h + tageditwidget.h + tagselectwidget.h tagmanagementdialog.h tagselectiondialog.h trashjob.h diff -Nru kdepimlibs-4.14.5/akonadi/collectiondialog_desktop.cpp kdepimlibs-4.14.6/akonadi/collectiondialog_desktop.cpp --- kdepimlibs-4.14.5/akonadi/collectiondialog_desktop.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/collectiondialog_desktop.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -170,6 +170,7 @@ bool mKeepTreeExpanded; KRecursiveFilterProxyModel *mFilterCollection; QCheckBox *mUseByDefault; + QStringList mContentMimeTypes; void slotDoubleClicked(); void slotSelectionChanged(); @@ -266,6 +267,9 @@ Akonadi::Collection collection; collection.setName(name); collection.setParentCollection(parentCollection); + if (!mContentMimeTypes.isEmpty()) { + collection.setContentMimeTypes(mContentMimeTypes); + } Akonadi::CollectionCreateJob *job = new Akonadi::CollectionCreateJob(collection); connect(job, SIGNAL(result(KJob*)), mParent, SLOT(slotCollectionCreationResult(KJob*))); } @@ -402,4 +406,10 @@ return d->mUseByDefault->isChecked(); } +void CollectionDialog::setContentMimeTypes(const QStringList &mimetypes) +{ + d->mContentMimeTypes = mimetypes; +} + + #include "moc_collectiondialog.cpp" diff -Nru kdepimlibs-4.14.5/akonadi/collectiondialog.h kdepimlibs-4.14.6/akonadi/collectiondialog.h --- kdepimlibs-4.14.5/akonadi/collectiondialog.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/collectiondialog.h 2015-02-26 21:31:08.000000000 +0000 @@ -201,6 +201,11 @@ * @since 4.13 */ bool useFolderByDefault() const; + /** + * Allow to specify collection content mimetype when we create new one. + * @since 4.14.6 + */ + void setContentMimeTypes(const QStringList &mimetypes); private: //@cond PRIVATE diff -Nru kdepimlibs-4.14.5/akonadi/collectionrequester.cpp kdepimlibs-4.14.6/akonadi/collectionrequester.cpp --- kdepimlibs-4.14.5/akonadi/collectionrequester.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/collectionrequester.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -239,6 +239,13 @@ } } +void CollectionRequester::setContentMimeTypes(const QStringList &mimetypes) +{ + if (d->collectionDialog) { + d->collectionDialog->setContentMimeTypes(mimetypes); + } +} + void CollectionRequester::changeEvent(QEvent *event) { if (event->type() == QEvent::WindowTitleChange) { diff -Nru kdepimlibs-4.14.5/akonadi/collectionrequester.h kdepimlibs-4.14.6/akonadi/collectionrequester.h --- kdepimlibs-4.14.5/akonadi/collectionrequester.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/collectionrequester.h 2015-02-26 21:31:08.000000000 +0000 @@ -115,6 +115,12 @@ */ void changeCollectionDialogOptions(CollectionDialog::CollectionDialogOptions options); + /** + * Allow to specify collection content mimetype when we create new one. + * @since 4.14.6 + */ + void setContentMimeTypes(const QStringList &mimetypes); + protected: void changeEvent(QEvent * event); diff -Nru kdepimlibs-4.14.5/akonadi/contact/contactgroupeditordialog.cpp kdepimlibs-4.14.6/akonadi/contact/contactgroupeditordialog.cpp --- kdepimlibs-4.14.5/akonadi/contact/contactgroupeditordialog.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/contact/contactgroupeditordialog.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -49,7 +49,7 @@ void slotGroupNameChanged( const QString& name ) { bool isValid = !( name.contains( QLatin1Char( '@' ) ) || name.contains( QLatin1Char( '.' ) ) ); - q->button( Ok )->setEnabled( !name.isEmpty() && isValid ); + q->button( Ok )->setEnabled( !name.trimmed().isEmpty() && isValid ); mEditor->groupNameIsValid( isValid ); } @@ -115,7 +115,7 @@ connect( d->mEditor->d->mGui.groupName, SIGNAL(textChanged(QString)), this, SLOT(slotGroupNameChanged(QString)) ); - button( Ok )->setEnabled( !d->mEditor->d->mGui.groupName->text().isEmpty() ); + button( Ok )->setEnabled( !d->mEditor->d->mGui.groupName->text().trimmed().isEmpty() ); d->readConfig(); } diff -Nru kdepimlibs-4.14.5/akonadi/contact/contactgroupeditor.ui kdepimlibs-4.14.6/akonadi/contact/contactgroupeditor.ui --- kdepimlibs-4.14.5/akonadi/contact/contactgroupeditor.ui 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/contact/contactgroupeditor.ui 2015-02-26 21:31:08.000000000 +0000 @@ -11,6 +11,9 @@ + + 0 + diff -Nru kdepimlibs-4.14.5/akonadi/contact/standardcontactactionmanager.cpp kdepimlibs-4.14.6/akonadi/contact/standardcontactactionmanager.cpp --- kdepimlibs-4.14.5/akonadi/contact/standardcontactactionmanager.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/contact/standardcontactactionmanager.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -123,6 +123,11 @@ mGenericManager->setContextText( StandardActionManager::CreateCollection, StandardActionManager::ErrorMessageTitle, i18n( "Address book folder creation failed" ) ); + mGenericManager->action(Akonadi::StandardActionManager::CreateCollection)->setProperty("ContentMimeTypes", QStringList() << + QLatin1String("application/x-vnd.kde.contactgroup") << + QLatin1String("text/directory") << + QLatin1String("application/x-vnd.kde.contactgroup")); + break; case Akonadi::StandardActionManager::CopyCollections: diff -Nru kdepimlibs-4.14.5/akonadi/designer/akonadi.widgets kdepimlibs-4.14.6/akonadi/designer/akonadi.widgets --- kdepimlibs-4.14.5/akonadi/designer/akonadi.widgets 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/designer/akonadi.widgets 2015-02-26 21:31:08.000000000 +0000 @@ -17,3 +17,11 @@ ConstructorArgs=(parent) Group=Input (KDE-PIM) +[Akonadi::TagSelectWidget] +ToolTip=A Widget to select tag (Akonadi) +WhatsThis=A Widget to select tag. +IncludeFile=akonadi/tagselectwidget.h +ConstructorArgs=(parent) +Group=Input (KDE-PIM) + + diff -Nru kdepimlibs-4.14.5/akonadi/favoritecollectionsmodel.cpp kdepimlibs-4.14.6/akonadi/favoritecollectionsmodel.cpp --- kdepimlibs-4.14.5/akonadi/favoritecollectionsmodel.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/favoritecollectionsmodel.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -232,12 +232,15 @@ void saveConfig() { QStringList labels; - + QList ids; foreach (const Collection::Id &collectionId, collectionIds) { - labels << labelForCollection(collectionId); + const QModelIndex idx = EntityTreeModel::modelIndexForCollection(q->sourceModel(), Collection(collectionId)); + if (idx.isValid()) { + labels << labelForCollection(collectionId); + ids << collectionId; + } } - - configGroup.writeEntry("FavoriteCollectionIds", collectionIds); + configGroup.writeEntry("FavoriteCollectionIds", ids); configGroup.writeEntry("FavoriteCollectionLabels", labels); configGroup.config()->sync(); } diff -Nru kdepimlibs-4.14.5/akonadi/kmime/messageflags.cpp kdepimlibs-4.14.6/akonadi/kmime/messageflags.cpp --- kdepimlibs-4.14.5/akonadi/kmime/messageflags.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/kmime/messageflags.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -20,6 +20,10 @@ #include "messageflags.h" +#include +#include +#include + const char *Akonadi::MessageFlags::Seen = "\\SEEN"; const char *Akonadi::MessageFlags::Deleted = "\\DELETED"; const char *Akonadi::MessageFlags::Answered = "\\ANSWERED"; @@ -38,3 +42,18 @@ const char *Akonadi::MessageFlags::Encrypted = "$ENCRYPTED"; const char *Akonadi::MessageFlags::Spam = "$JUNK"; const char *Akonadi::MessageFlags::Ham = "$NOTJUNK"; + +void Akonadi::MessageFlags::copyMessageFlags(KMime::Message &message, Akonadi::Item &item) +{ + if (KMime::isSigned(&message)) + item.setFlag(Akonadi::MessageFlags::Signed); + + if (KMime::isEncrypted(&message)) + item.setFlag(Akonadi::MessageFlags::Encrypted); + + if (KMime::hasInvitation(&message)) + item.setFlag(Akonadi::MessageFlags::HasInvitation); + + if (KMime::hasAttachment(&message)) + item.setFlag(Akonadi::MessageFlags::HasAttachment); +} diff -Nru kdepimlibs-4.14.5/akonadi/kmime/messageflags.h kdepimlibs-4.14.6/akonadi/kmime/messageflags.h --- kdepimlibs-4.14.5/akonadi/kmime/messageflags.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/kmime/messageflags.h 2015-02-26 21:31:08.000000000 +0000 @@ -23,8 +23,15 @@ #include "akonadi-kmime_export.h" +namespace KMime +{ + class Message; +} + namespace Akonadi { + class Item; + /** * @short Contains predefined message flag identifiers. * @@ -137,6 +144,14 @@ * @since 4.6 */ AKONADI_KMIME_EXPORT extern const char *Ham; + + +/** + * Copies all message flags from a KMime::Message object + * into an Akonadi::Item object + * @since 4.14.6 + */ +AKONADI_KMIME_EXPORT void copyMessageFlags(KMime::Message &from, Akonadi::Item &to); } } diff -Nru kdepimlibs-4.14.5/akonadi/resourcebase.h kdepimlibs-4.14.6/akonadi/resourcebase.h --- kdepimlibs-4.14.5/akonadi/resourcebase.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/resourcebase.h 2015-02-26 21:31:08.000000000 +0000 @@ -781,8 +781,8 @@ Q_PRIVATE_SLOT(d_func(), void slotSessionReconnected()) Q_PRIVATE_SLOT(d_func(), void slotRecursiveMoveReplay(RecursiveMover *)) Q_PRIVATE_SLOT(d_func(), void slotRecursiveMoveReplayResult(KJob *)) - Q_PRIVATE_SLOT(d_func(), void slotItemRetrievalCollectionFetchDone(KJob *)); - Q_PRIVATE_SLOT(d_func(), void slotAttributeRetrievalCollectionFetchDone(KJob *)); + Q_PRIVATE_SLOT(d_func(), void slotItemRetrievalCollectionFetchDone(KJob *)) + Q_PRIVATE_SLOT(d_func(), void slotAttributeRetrievalCollectionFetchDone(KJob *)) }; } diff -Nru kdepimlibs-4.14.5/akonadi/tageditwidget.cpp kdepimlibs-4.14.6/akonadi/tageditwidget.cpp --- kdepimlibs-4.14.5/akonadi/tageditwidget.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tageditwidget.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -18,7 +18,7 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "tageditwidget_p.h" +#include "tageditwidget.h" #include #include @@ -268,7 +268,7 @@ d->select(QModelIndex(), 0, d->m_model->rowCount() - 1, QItemSelectionModel::ClearAndSelect); } -Akonadi::Tag::List TagEditWidget::selection() +Akonadi::Tag::List TagEditWidget::selection() const { Akonadi::Tag::List list; for (int i = 0; i < d->m_checkableProxy->rowCount(); ++i) { diff -Nru kdepimlibs-4.14.5/akonadi/tageditwidget.h kdepimlibs-4.14.6/akonadi/tageditwidget.h --- kdepimlibs-4.14.5/akonadi/tageditwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tageditwidget.h 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,57 @@ +/* + This file is part of Akonadi + + Copyright (c) 2014 Christian Mollekopf + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + 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 Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + +#ifndef AKONADI_TAGEDITWIDGET_P_H +#define AKONADI_TAGEDITWIDGET_P_H + +#include +#include "akonadi/tag.h" +#include "akonadi_export.h" + +namespace Akonadi { + +class TagModel; +/** + * A widget that offers facilities to add/remove tags and optionally provides a way to select tags. + * + * @since 4.13 + */ +class AKONADI_EXPORT TagEditWidget : public QWidget +{ + Q_OBJECT +public: + explicit TagEditWidget(Akonadi::TagModel *model, QWidget *parent = 0, bool enableSelection = false); + virtual ~TagEditWidget(); + + void setSelection(const Akonadi::Tag::List &tags); + Akonadi::Tag::List selection() const; + +protected: + bool eventFilter(QObject *watched, QEvent *event); + +private: + class Private; + QSharedPointer d; +}; + +} + +#endif diff -Nru kdepimlibs-4.14.5/akonadi/tageditwidget_p.h kdepimlibs-4.14.6/akonadi/tageditwidget_p.h --- kdepimlibs-4.14.5/akonadi/tageditwidget_p.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tageditwidget_p.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/* - This file is part of Akonadi - - Copyright (c) 2014 Christian Mollekopf - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - 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 Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#ifndef AKONADI_TAGEDITWIDGET_P_H -#define AKONADI_TAGEDITWIDGET_P_H - -#include -#include "akonadi/tag.h" - -namespace Akonadi { - -class TagModel; -/** - * A widget that offers facilities to add/remove tags and optionally provides a way to select tags. - * - * @since 4.13 - */ -class TagEditWidget : public QWidget -{ - Q_OBJECT -public: - explicit TagEditWidget(Akonadi::TagModel *model, QWidget *parent = 0, bool enableSelection = false); - virtual ~TagEditWidget(); - - void setSelection(const Akonadi::Tag::List &tags); - Akonadi::Tag::List selection(); - -protected: - bool eventFilter(QObject *watched, QEvent *event); - -private: - class Private; - QSharedPointer d; -}; - -} - -#endif diff -Nru kdepimlibs-4.14.5/akonadi/tagmanagementdialog.cpp kdepimlibs-4.14.6/akonadi/tagmanagementdialog.cpp --- kdepimlibs-4.14.5/akonadi/tagmanagementdialog.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tagmanagementdialog.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -22,7 +22,7 @@ #include "tagmanagementdialog.h" #include "tagmodel.h" #include "monitor.h" -#include "tageditwidget_p.h" +#include "tageditwidget.h" #include #include diff -Nru kdepimlibs-4.14.5/akonadi/tagselectiondialog.cpp kdepimlibs-4.14.6/akonadi/tagselectiondialog.cpp --- kdepimlibs-4.14.5/akonadi/tagselectiondialog.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tagselectiondialog.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -22,7 +22,7 @@ #include "tagselectiondialog.h" #include "tagmodel.h" #include "monitor.h" -#include "tageditwidget_p.h" +#include "tageditwidget.h" #include #include diff -Nru kdepimlibs-4.14.5/akonadi/tagselectwidget.cpp kdepimlibs-4.14.6/akonadi/tagselectwidget.cpp --- kdepimlibs-4.14.5/akonadi/tagselectwidget.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tagselectwidget.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,97 @@ +/* + Copyright (c) 2015 Montel Laurent + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "tagselectwidget.h" +#include "monitor.h" +#include "tagmodel.h" +#include "tageditwidget.h" + +#include + +using namespace Akonadi; + +class TagSelectWidget::Private +{ +public: + Private(TagSelectWidget *parent) + : mParent(parent) + { + init(); + } + void init(); + TagSelectWidget *mParent; + Akonadi::TagEditWidget *mTagEditWidget; +}; + +void TagSelectWidget::Private::init() +{ + QHBoxLayout *mainLayout = new QHBoxLayout; + mParent->setLayout(mainLayout); + + Monitor *monitor = new Monitor(mParent); + monitor->setTypeMonitored(Monitor::Tags); + + Akonadi::TagModel *model = new Akonadi::TagModel(monitor, mParent); + mTagEditWidget = new Akonadi::TagEditWidget(model, mParent, true); + mTagEditWidget->setObjectName(QLatin1String("tageditwidget")); + + mainLayout->addWidget(mTagEditWidget); + +} + +TagSelectWidget::TagSelectWidget(QWidget *parent) + : QWidget(parent), + d(new Private(this)) +{ +} + +TagSelectWidget::~TagSelectWidget() +{ + delete d; +} + +void TagSelectWidget::setSelection(const Tag::List &tags) +{ + d->mTagEditWidget->setSelection(tags); +} + +Tag::List TagSelectWidget::selection() const +{ + return d->mTagEditWidget->selection(); +} + +QStringList TagSelectWidget::tagToStringList() const +{ + QStringList list; + const Akonadi::Tag::List tags = selection(); + foreach (const Akonadi::Tag &tag, tags) { + list.append(tag.url().url()); + } + return list; +} + +void TagSelectWidget::setSelectionFromStringList(const QStringList &lst) +{ + Akonadi::Tag::List tags; + + const QStringList categories = lst; + foreach (const QString &category, categories) { + tags.append(Akonadi::Tag::fromUrl(category)); + } + setSelection(tags); +} + diff -Nru kdepimlibs-4.14.5/akonadi/tagselectwidget.h kdepimlibs-4.14.6/akonadi/tagselectwidget.h --- kdepimlibs-4.14.5/akonadi/tagselectwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tagselectwidget.h 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,59 @@ +/* + Copyright (c) 2015 Montel Laurent + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef TAGSELECTWIDGET_H +#define TAGSELECTWIDGET_H + +#include +#include "akonadi_export.h" +#include "tag.h" + +namespace Akonadi { +/** + * A widget that offers facilities to add/remove tags and provides a way to select tags. + * + * @since 4.14.6 + */ + +class AKONADI_EXPORT TagSelectWidget : public QWidget +{ + Q_OBJECT +public: + explicit TagSelectWidget(QWidget *parent = 0); + ~TagSelectWidget(); + + void setSelection(const Akonadi::Tag::List &tags); + Akonadi::Tag::List selection() const; + + /** + * @brief tagToStringList + * @return QStringList from selected tag (List of Url) + */ + QStringList tagToStringList() const; + /** + * @brief setSelectionFromStringList, convert a QStringList to Tag (converted from url) + * @param lst + */ + void setSelectionFromStringList(const QStringList &lst); +private: + //@cond PRIVATE + class Private; + Private *const d; +}; +} + +#endif // TAGSELECTWIDGET_H diff -Nru kdepimlibs-4.14.5/akonadi/tests/CMakeLists.txt kdepimlibs-4.14.6/akonadi/tests/CMakeLists.txt --- kdepimlibs-4.14.5/akonadi/tests/CMakeLists.txt 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tests/CMakeLists.txt 2015-02-26 21:31:08.000000000 +0000 @@ -143,6 +143,7 @@ # and the test is not very critical (we'll notice if we can't start the server), so we disable it for now. #add_akonadi_isolated_test(servermanagertest.cpp) add_akonadi_isolated_test(collectioncreator.cpp) +add_akonadi_isolated_test(tagselectwidgettest.cpp) # Having a benchmark is cool if you have any reference to compare against, but this diff -Nru kdepimlibs-4.14.5/akonadi/tests/tagselectwidgettest.cpp kdepimlibs-4.14.6/akonadi/tests/tagselectwidgettest.cpp --- kdepimlibs-4.14.5/akonadi/tests/tagselectwidgettest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tests/tagselectwidgettest.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,41 @@ +/* + Copyright (c) 2015 Montel Laurent + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + + +#include "tagselectwidgettest.h" +#include "tagselectwidget.h" +#include "tageditwidget.h" +#include +TagSelectWidgetTest::TagSelectWidgetTest(QObject *parent) + : QObject(parent) +{ + +} + +TagSelectWidgetTest::~TagSelectWidgetTest() +{ + +} + +void TagSelectWidgetTest::shouldHaveDefaultValue() +{ + Akonadi::TagSelectWidget widget; + Akonadi::TagEditWidget *edit = qFindChild(&widget, QLatin1String("tageditwidget")); + QVERIFY(edit); +} + +QTEST_KDEMAIN(TagSelectWidgetTest, GUI) diff -Nru kdepimlibs-4.14.5/akonadi/tests/tagselectwidgettest.h kdepimlibs-4.14.6/akonadi/tests/tagselectwidgettest.h --- kdepimlibs-4.14.5/akonadi/tests/tagselectwidgettest.h 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tests/tagselectwidgettest.h 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,34 @@ +/* + Copyright (c) 2015 Montel Laurent + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + + +#ifndef TAGSELECTWIDGETTEST_H +#define TAGSELECTWIDGETTEST_H + +#include + +class TagSelectWidgetTest : public QObject +{ + Q_OBJECT +public: + explicit TagSelectWidgetTest(QObject *parent = 0); + ~TagSelectWidgetTest(); +private Q_SLOTS: + void shouldHaveDefaultValue(); +}; + +#endif // TAGSELECTWIDGETTEST_H diff -Nru kdepimlibs-4.14.5/akonadi/tests/testsearchplugin/akonaditestsearchplugin.desktop kdepimlibs-4.14.6/akonadi/tests/testsearchplugin/akonaditestsearchplugin.desktop --- kdepimlibs-4.14.5/akonadi/tests/testsearchplugin/akonaditestsearchplugin.desktop 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/akonadi/tests/testsearchplugin/akonaditestsearchplugin.desktop 2015-02-26 21:31:08.000000000 +0000 @@ -1,6 +1,7 @@ [Desktop Entry] Type=AkonadiSearchPlugin Name=Akonadi Test Search Plugin +Name[bs]=Priključak za Akonadi test pretrage Name[ca]=Connector de cerca de prova per a l'Akonadi Name[ca@valencia]=Connector de cerca de prova per a l'Akonadi Name[cs]=Modul pro testování hledání v Akonadi diff -Nru kdepimlibs-4.14.5/CMakeLists.txt kdepimlibs-4.14.6/CMakeLists.txt --- kdepimlibs-4.14.5/CMakeLists.txt 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/CMakeLists.txt 2015-02-26 21:31:08.000000000 +0000 @@ -7,7 +7,7 @@ ############### The kdepimlibs version (used e.g. in KdepimLibsConfig.cmake) ############### set(KDEPIMLIBS_VERSION_MAJOR 4) set(KDEPIMLIBS_VERSION_MINOR 14) -set(KDEPIMLIBS_VERSION_PATCH 5) +set(KDEPIMLIBS_VERSION_PATCH 6) set(KDEPIMLIBS_VERSION ${KDEPIMLIBS_VERSION_MAJOR}.${KDEPIMLIBS_VERSION_MINOR}.${KDEPIMLIBS_VERSION_PATCH}) diff -Nru kdepimlibs-4.14.5/debian/changelog kdepimlibs-4.14.6/debian/changelog --- kdepimlibs-4.14.5/debian/changelog 2015-02-10 19:27:38.000000000 +0000 +++ kdepimlibs-4.14.6/debian/changelog 2015-03-13 22:04:47.000000000 +0000 @@ -1,3 +1,11 @@ +kdepimlibs (4:4.14.6-0ubuntu1) vivid; urgency=medium + + * New upstream release + * Update watch file + * Add missing files to -dev / wrap-and-sort. + + -- Scarlett Clark Fri, 13 Mar 2015 15:04:47 -0700 + kdepimlibs (4:4.14.5-0ubuntu1) vivid; urgency=medium * New upstream release diff -Nru kdepimlibs-4.14.5/debian/kdepimlibs5-dev.install kdepimlibs-4.14.6/debian/kdepimlibs5-dev.install --- kdepimlibs-4.14.5/debian/kdepimlibs5-dev.install 2015-02-10 19:27:38.000000000 +0000 +++ kdepimlibs-4.14.6/debian/kdepimlibs5-dev.install 2015-03-13 22:04:47.000000000 +0000 @@ -634,12 +634,14 @@ usr/include/akonadi/tagattribute.h usr/include/akonadi/tagcreatejob.h usr/include/akonadi/tagdeletejob.h +usr/include/akonadi/tageditwidget.h usr/include/akonadi/tagfetchjob.h usr/include/akonadi/tagfetchscope.h usr/include/akonadi/tagmanagementdialog.h usr/include/akonadi/tagmodel.h usr/include/akonadi/tagmodifyjob.h usr/include/akonadi/tagselectiondialog.h +usr/include/akonadi/tagselectwidget.h usr/include/akonadi/tagwidget.h usr/include/akonadi/transactionjobs.h usr/include/akonadi/transactionsequence.h @@ -695,6 +697,7 @@ usr/include/kabc/addresseedialog.h usr/include/kabc/addresseelist.h usr/include/kabc/addresslineedit.h +usr/include/kabc/calendarurl.h usr/include/kabc/contactgroup.h usr/include/kabc/contactgrouptool.h usr/include/kabc/distributionlist.h @@ -707,6 +710,7 @@ usr/include/kabc/formatfactory.h usr/include/kabc/gender.h usr/include/kabc/geo.h +usr/include/kabc/impp.h usr/include/kabc/kabc_export.h usr/include/kabc/key.h usr/include/kabc/lang.h diff -Nru kdepimlibs-4.14.5/debian/watch kdepimlibs-4.14.6/debian/watch --- kdepimlibs-4.14.5/debian/watch 2015-02-10 19:27:38.000000000 +0000 +++ kdepimlibs-4.14.6/debian/watch 2015-03-13 22:04:47.000000000 +0000 @@ -1,2 +1,2 @@ version=3 -http://download.kde.org/stable/applications/14.12.2/src/kdepimlibs-([\d\.]*).tar.xz +http://download.kde.org/stable/applications/14.12.3/src/kdepimlibs-([\d\.]*).tar.xz diff -Nru kdepimlibs-4.14.5/kabc/addressee.cpp kdepimlibs-4.14.6/kabc/addressee.cpp --- kdepimlibs-4.14.5/kabc/addressee.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/addressee.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -45,7 +45,6 @@ template static bool listEquals( const QList&, const QList& ); static bool listEquals( const QStringList&, const QStringList& ); -static bool emailsEquals( const QStringList&, const QStringList& ); class Addressee::Private : public QSharedData { @@ -100,6 +99,14 @@ mGender = other.mGender; mCategories = other.mCategories; mCustomFields = other.mCustomFields; + mCalendarUrl = other.mCalendarUrl; + mSoundListExtra = other.mSoundListExtra; + mPhotoListExtra = other.mPhotoListExtra; + mLogoListExtra = other.mLogoListExtra; + mUrlListExtra = other.mUrlListExtra; + mSources = other.mSources; + mMembers = other.mMembers; + mRelationShips = other.mRelationShips; #ifndef KDEPIM_NO_KRESOURCES mResource = other.mResource; @@ -148,6 +155,15 @@ QString mKind; QStringList mCategories; QMap mCustomFields; + CalendarUrl::List mCalendarUrl; + + Sound::List mSoundListExtra; + Picture::List mPhotoListExtra; + Picture::List mLogoListExtra; + QList mUrlListExtra; + QStringList mMembers; + QStringList mRelationShips; + QList mSources; #ifndef KDEPIM_NO_KRESOURCES Resource *mResource; @@ -369,7 +385,38 @@ kDebug() << "kind differs"; return false; } - + if ( !listEquals( d->mCalendarUrl, addressee.d->mCalendarUrl ) ) { + kDebug() << "calendarUrl differs"; + return false; + } + if ( !listEquals( d->mSoundListExtra, addressee.d->mSoundListExtra ) ) { + kDebug() << "Extra sound differs"; + return false; + } + if ( !listEquals( d->mPhotoListExtra, addressee.d->mPhotoListExtra ) ) { + kDebug() << "Extra photo differs"; + return false; + } + if ( !listEquals( d->mLogoListExtra, addressee.d->mLogoListExtra ) ) { + kDebug() << "Extra logo differs"; + return false; + } + if ( !listEquals( d->mUrlListExtra, addressee.d->mUrlListExtra ) ) { + kDebug() << "Extra url differs"; + return false; + } + if (!listEquals( d->mMembers, addressee.d->mMembers)) { + kDebug() << "Members differs"; + return false; + } + if (!listEquals( d->mRelationShips, addressee.d->mRelationShips)) { + kDebug() << "RelationShips differs"; + return false; + } + if (!listEquals( d->mSources, addressee.d->mSources)) { + kDebug() << "Sources differs"; + return false; + } return true; } @@ -430,12 +477,96 @@ d->mKind = kind; } +void Addressee::insertCalendarUrl(const CalendarUrl &calendarUrl) +{ + d->mEmpty = false; + //TODO verify that there is not same calendarurl + if (calendarUrl.isValid()) { + d->mCalendarUrl.append(calendarUrl); + } +} + +void Addressee::insertExtraSound(const Sound &sound) +{ + d->mSoundListExtra.append(sound); +} + +void Addressee::setExtraSoundList(const KABC::Sound::List &soundList) +{ + d->mSoundListExtra = soundList; +} + +KABC::Sound::List Addressee::extraSoundList() const +{ + return d->mSoundListExtra; +} + +void Addressee::insertExtraPhoto(const Picture &picture) +{ + d->mPhotoListExtra.append(picture); +} + +void Addressee::setExtraPhotoList(const Picture::List &pictureList) +{ + d->mPhotoListExtra = pictureList; +} + +Picture::List Addressee::extraPhotoList() const +{ + return d->mPhotoListExtra; +} + +void Addressee::insertExtraLogo(const Picture &logo) +{ + d->mLogoListExtra.append(logo); +} + +void Addressee::setExtraLogoList(const Picture::List &logoList) +{ + d->mLogoListExtra = logoList; +} + +Picture::List Addressee::extraLogoList() const +{ + return d->mLogoListExtra; +} + +void Addressee::insertExtraUrl(const KUrl &url) +{ + d->mUrlListExtra.append(url); +} + +void Addressee::setExtraUrlList(const QList &urlList) +{ + d->mUrlListExtra = urlList; +} + +QList Addressee::extraUrlList() const +{ + return d->mUrlListExtra; +} + +void Addressee::insertSourceUrl(const KUrl &url) +{ + d->mSources.append(url); +} + +void Addressee::setSourcesUrlList(const QList &urlList) +{ + d->mSources = urlList; +} + +QList Addressee::sourcesUrlList() const +{ + return d->mSources; +} + + QString Addressee::kind() const { return d->mKind; } - void Addressee::setFormattedName( const QString &formattedName ) { if ( formattedName == d->mFormattedName ) @@ -1364,6 +1495,12 @@ d->mLangs.append( language ); } +void Addressee::setLangs(const Lang::List &langs) +{ + d->mLangs = langs; + d->mEmpty = false; +} + Lang::List Addressee::langs() const { return d->mLangs; @@ -1709,6 +1846,48 @@ return Address(); } +void Addressee::insertMember( const QString & member) +{ + d->mEmpty = false; + + if ( d->mMembers.contains( member ) ) + return; + + d->mMembers.append( member ); +} + +void Addressee::setMembers( const QStringList &m ) +{ + d->mEmpty = false; + d->mMembers = m; +} + +QStringList Addressee::members() const +{ + return d->mMembers; +} + +void Addressee::insertRelationShip(const QString &relation) +{ + d->mEmpty = false; + + if ( d->mRelationShips.contains( relation ) ) + return; + + d->mRelationShips.append( relation ); +} + +void Addressee::setRelationShips(const QStringList &c) +{ + d->mEmpty = false; + d->mRelationShips = c; +} + +QStringList Addressee::relationShips() const +{ + return d->mRelationShips; +} + void Addressee::insertCategory( const QString &c ) { d->mEmpty = false; @@ -2039,6 +2218,14 @@ s << a.d->mLangs; s << a.d->mGender; s << a.d->mKind; + s << a.d->mCalendarUrl; + s << a.d->mSoundListExtra; + s << a.d->mPhotoListExtra; + s << a.d->mLogoListExtra; + s << a.d->mUrlListExtra; + s << a.d->mMembers; + s << a.d->mRelationShips; + s << a.d->mSources; return s; } @@ -2082,6 +2269,14 @@ s >> a.d->mLangs; s >> a.d->mGender; s >> a.d->mKind; + s >> a.d->mCalendarUrl; + s >> a.d->mSoundListExtra; + s >> a.d->mPhotoListExtra; + s >> a.d->mLogoListExtra; + s >> a.d->mUrlListExtra; + s >> a.d->mMembers; + s >> a.d->mRelationShips; + s >> a.d->mSources; a.d->mEmpty = false; return s; @@ -2127,28 +2322,6 @@ return false; } } - - return true; -} - -bool emailsEquals( const QStringList &list, const QStringList &pattern ) -{ - if ( list.count() != pattern.count() ) - return false; - - if ( list.isEmpty() ) - return true; - - if ( list.first() != pattern.first() ) - return false; - - QStringList::ConstIterator it; - QStringList::ConstIterator end( list.constEnd() ); - for ( it = list.constBegin(); it != end; ++it ) { - if ( !pattern.contains( *it ) ) { - return false; - } - } return true; } diff -Nru kdepimlibs-4.14.5/kabc/addressee.h kdepimlibs-4.14.6/kabc/addressee.h --- kdepimlibs-4.14.5/kabc/addressee.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/addressee.h 2015-02-26 21:31:08.000000000 +0000 @@ -39,6 +39,7 @@ #include "kabc/lang.h" #include "kabc/gender.h" #include "kabc/timezone.h" +#include "kabc/calendarurl.h" #include "kabc/addresseelist.h" // for typedef QList List; namespace KABC { @@ -986,6 +987,7 @@ void removeLang(const QString &language); void insertLang(const Lang &language); + void setLangs(const Lang::List &langs); Lang::List langs() const; void setGender(const KABC::Gender &gender); @@ -993,6 +995,39 @@ QString kind() const; void setKind(const QString &kind); + + void insertCalendarUrl(const KABC::CalendarUrl &calendarUrl); + + + void insertExtraSound(const KABC::Sound &sound); + void setExtraSoundList(const KABC::Sound::List &soundList); + KABC::Sound::List extraSoundList() const; + + void insertExtraPhoto(const KABC::Picture &picture); + void setExtraPhotoList(const KABC::Picture::List &pictureList); + KABC::Picture::List extraPhotoList() const; + + void insertExtraLogo(const KABC::Picture &log); + void setExtraLogoList(const KABC::Picture::List &logoList); + KABC::Picture::List extraLogoList() const; + + + QList extraUrlList() const; + void setExtraUrlList(const QList &urlList); + void insertExtraUrl(const KUrl &url); + + + void insertMember(const QString &member); + void setMembers(const QStringList &c); + QStringList members() const; + + void insertRelationShip(const QString &related); + void setRelationShips(const QStringList &c); + QStringList relationShips() const; + + void insertSourceUrl(const KUrl &url); + void setSourcesUrlList(const QList &urlList); + QList sourcesUrlList() const; private: class Private; QSharedDataPointer d; diff -Nru kdepimlibs-4.14.5/kabc/calendarurl.cpp kdepimlibs-4.14.6/kabc/calendarurl.cpp --- kdepimlibs-4.14.5/kabc/calendarurl.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/calendarurl.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,179 @@ +/* + This file is part of libkabc. + Copyright (c) 2015 Laurent Montel + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "calendarurl.h" + +#include +#include +#include + +using namespace KABC; + +class CalendarUrl::Private : public QSharedData +{ +public: + Private() + { + } + + Private( const Private &other ) + : QSharedData( other ) + { + parameters = other.parameters; + type = other.type; + url = other.url; + } + static QString typeToString(CalendarUrl::CalendarType type); + QMap parameters; + QUrl url; + CalendarUrl::CalendarType type; + +}; + +QString CalendarUrl::Private::typeToString(CalendarUrl::CalendarType type) +{ + QString ret; + switch(type) { + case Unknown: + ret = QLatin1String("Unknown"); + break; + case FBUrl: + ret = QLatin1String("FreeBusy"); + break; + case CALUri: + ret = QLatin1String("CalUri"); + break; + case CALADRUri: + ret = QLatin1String("Caladruri"); + break; + } + return ret; +} + + +CalendarUrl::CalendarUrl() + : d(new Private) +{ + d->type = Unknown; +} + +CalendarUrl::CalendarUrl(CalendarUrl::CalendarType type) + : d(new Private) +{ + d->type = type; +} + +CalendarUrl::CalendarUrl( const CalendarUrl &other ) + : d( other.d ) +{ +} + +CalendarUrl::~CalendarUrl() +{ + +} + +QMap CalendarUrl::parameters() const +{ + return d->parameters; +} + +bool CalendarUrl::operator==(const CalendarUrl &other) const +{ + return (d->parameters == other.parameters()) && (d->type == other.type()) && (d->url == other.url()); +} + +bool CalendarUrl::operator!=(const CalendarUrl &other) const +{ + return !( other == *this ); +} + +CalendarUrl &CalendarUrl::operator=(const CalendarUrl &other) +{ + if ( this != &other ) { + d = other.d; + } + + return *this; +} + + +QString CalendarUrl::toString() const +{ + QString str; + str += QString::fromLatin1( "CalendarUrl {\n" ); + str += QString::fromLatin1( " url: %1\n" ).arg( d->url.toString() ); + str += QString::fromLatin1( " type: %1\n" ).arg( CalendarUrl::Private::typeToString(d->type) ); + if (!d->parameters.isEmpty()) { + QMapIterator i(d->parameters); + QString param; + while (i.hasNext()) { + i.next(); + param += QString::fromLatin1("%1 %2").arg(i.key()).arg(i.value().join(QLatin1String(","))); + } + str += QString::fromLatin1( " parameters: %1\n" ).arg( param ); + } + str += QString::fromLatin1( "}\n" ); + return str; +} + +void CalendarUrl::setParameters(const QMap ¶ms) +{ + d->parameters = params; +} + +bool CalendarUrl::isValid() const +{ + return (d->type != Unknown) && (d->url.isValid()); +} + +void CalendarUrl::setType(CalendarUrl::CalendarType type) +{ + d->type = type; +} + +CalendarUrl::CalendarType CalendarUrl::type() const +{ + return d->type; +} + +void CalendarUrl::setUrl(const QUrl &url) +{ + d->url = url; +} + +QUrl CalendarUrl::url() const +{ + return d->url; +} + +QDataStream &KABC::operator<<(QDataStream &s, const CalendarUrl &calUrl) +{ + return s << calUrl.d->parameters << (uint)calUrl.d->type << calUrl.d->url; +} + +QDataStream &KABC::operator>>(QDataStream &s, CalendarUrl &calUrl) +{ + uint type; + s >> calUrl.d->parameters >> type >> calUrl.d->url; + calUrl.d->type = static_cast(type); + return s; +} + diff -Nru kdepimlibs-4.14.5/kabc/calendarurl.h kdepimlibs-4.14.6/kabc/calendarurl.h --- kdepimlibs-4.14.5/kabc/calendarurl.h 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/calendarurl.h 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,83 @@ +/* + This file is part of libkabc. + Copyright (c) 2015 Laurent Montel + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef CALENDARURL_H +#define CALENDARURL_H +#include "kabc_export.h" + +#include +#include +#include +class QUrl; +/** @short Class that holds a Calendar Url (FBURL/CALADRURI/CALURI) + * @since 4.14.6 + */ + +namespace KABC { + +class KABC_EXPORT CalendarUrl +{ + friend KABC_EXPORT QDataStream &operator<<( QDataStream &, const CalendarUrl & ); + friend KABC_EXPORT QDataStream &operator>>( QDataStream &, CalendarUrl & ); +public: + enum CalendarType { + Unknown = 0, + FBUrl, + CALUri, + CALADRUri + }; + + CalendarUrl(); + CalendarUrl(CalendarUrl::CalendarType type); + CalendarUrl(const CalendarUrl &other); + + ~CalendarUrl(); + + typedef QList List; + + bool isValid() const; + + void setType(CalendarUrl::CalendarType type); + CalendarUrl::CalendarType type() const; + + void setUrl(const QUrl &url); + QUrl url() const; + + void setParameters(const QMap ¶ms); + QMap parameters() const; + + bool operator==( const CalendarUrl &other ) const; + bool operator!=( const CalendarUrl &other ) const; + + CalendarUrl &operator=( const CalendarUrl &other ); + + + QString toString() const; +private: + class Private; + QSharedDataPointer d; +}; + +KABC_EXPORT QDataStream &operator<<( QDataStream &stream, const CalendarUrl &object ); + +KABC_EXPORT QDataStream &operator>>( QDataStream &stream, CalendarUrl &object ); + +} +#endif // CALENDARURL_H diff -Nru kdepimlibs-4.14.5/kabc/CMakeLists.txt kdepimlibs-4.14.6/kabc/CMakeLists.txt --- kdepimlibs-4.14.5/kabc/CMakeLists.txt 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/CMakeLists.txt 2015-02-26 21:31:08.000000000 +0000 @@ -44,6 +44,7 @@ set(kabc_LIB_SRCS address.cpp addressee.cpp + calendarurl.cpp contactgroup.cpp contactgrouptool.cpp errorhandler.cpp @@ -51,6 +52,7 @@ field.cpp geo.cpp gender.cpp + impp.cpp key.cpp ldapdn.cpp ldif.cpp @@ -117,6 +119,7 @@ addressee.h addresseedialog.h addresseelist.h + calendarurl.h contactgroup.h contactgrouptool.h distributionlist.h @@ -125,6 +128,7 @@ email.h field.h geo.h + impp.h key.h lang.h gender.h diff -Nru kdepimlibs-4.14.5/kabc/impp.cpp kdepimlibs-4.14.6/kabc/impp.cpp --- kdepimlibs-4.14.5/kabc/impp.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/impp.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -35,10 +35,13 @@ Private( const Private &other ) : QSharedData( other ) { + address = other.address; + imType = other.imType; parameters = other.parameters; } QMap parameters; QString address; + QString imType; }; Impp::Impp() @@ -65,7 +68,17 @@ bool Impp::isValid() const { - return !d->address.isEmpty(); + return !d->address.isEmpty() && !d->imType.isEmpty(); +} + +void Impp::setIMType(const QString &type) +{ + d->imType = type; +} + +QString Impp::imType() const +{ + return d->imType; } void Impp::setAddress(const QString &address) @@ -90,7 +103,7 @@ bool Impp::operator==(const Impp &other) const { - return (d->parameters == other.parameters()) && (d->address == other.address()); + return (d->parameters == other.parameters()) && (d->address == other.address()) && (d->imType == other.imType()); } bool Impp::operator!=(const Impp &other) const @@ -112,6 +125,7 @@ QString str; str += QString::fromLatin1( "Impp {\n" ); str += QString::fromLatin1( " address: %1\n" ).arg( d->address ); + str += QString::fromLatin1( " type: %1\n" ).arg( d->imType ); if (!d->parameters.isEmpty()) { QMapIterator i(d->parameters); QString param; @@ -128,11 +142,11 @@ QDataStream &KABC::operator<<(QDataStream &s, const Impp &impp) { - return s << impp.d->parameters << impp.d->address; + return s << impp.d->parameters << impp.d->address << impp.d->imType; } QDataStream &KABC::operator>>(QDataStream &s, Impp &impp) { - s >> impp.d->parameters >> impp.d->address; + s >> impp.d->parameters >> impp.d->address >> impp.d->imType; return s; } diff -Nru kdepimlibs-4.14.5/kabc/impp.h kdepimlibs-4.14.6/kabc/impp.h --- kdepimlibs-4.14.5/kabc/impp.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/impp.h 2015-02-26 21:31:08.000000000 +0000 @@ -47,6 +47,9 @@ bool isValid() const; + void setIMType(const QString &type); + QString imType() const; + void setAddress(const QString &address); QString address() const; diff -Nru kdepimlibs-4.14.5/kabc/picture.h kdepimlibs-4.14.6/kabc/picture.h --- kdepimlibs-4.14.5/kabc/picture.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/picture.h 2015-02-26 21:31:08.000000000 +0000 @@ -75,6 +75,7 @@ */ ~Picture(); + typedef QList List; /** * Assignment operator * diff -Nru kdepimlibs-4.14.5/kabc/sound.h kdepimlibs-4.14.6/kabc/sound.h --- kdepimlibs-4.14.5/kabc/sound.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/sound.h 2015-02-26 21:31:08.000000000 +0000 @@ -91,6 +91,8 @@ */ ~Sound(); + typedef QList List; + /** * Assignment operator. * diff -Nru kdepimlibs-4.14.5/kabc/tests/addresseetest.cpp kdepimlibs-4.14.6/kabc/tests/addresseetest.cpp --- kdepimlibs-4.14.5/kabc/tests/addresseetest.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/tests/addresseetest.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -55,6 +55,8 @@ QStringList customs; customs << QLatin1String( "X-Danger: high" ); + KABC::Gender gender(QLatin1String("H")); + addressee.setGender(gender); addressee.setUid( QLatin1String( "My uid" ) ); addressee.setName( QLatin1String( "John Sinclair" ) ); addressee.setFormattedName( QLatin1String( "Sinclair, John" ) ); @@ -89,6 +91,7 @@ #endif addressee.setChanged( false ); + QVERIFY( addressee.gender() == gender ); QVERIFY( addressee.uid() == QLatin1String( "My uid" ) ); QVERIFY( addressee.name() == QLatin1String( "John Sinclair" ) ); QVERIFY( addressee.formattedName() == QLatin1String( "Sinclair, John" ) ); diff -Nru kdepimlibs-4.14.5/kabc/tests/calendarurltest.cpp kdepimlibs-4.14.6/kabc/tests/calendarurltest.cpp --- kdepimlibs-4.14.5/kabc/tests/calendarurltest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/tests/calendarurltest.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,110 @@ +/* + This file is part of libkabc. + Copyright (c) 2015 Laurent Montel + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "calendarurltest.h" + +#include "emailtest.h" +#include "kabc/calendarurl.h" +#include + +using namespace KABC; + +CalendarUrlTest::CalendarUrlTest(QObject *parent) + : QObject(parent) +{ + +} + +CalendarUrlTest::~CalendarUrlTest() +{ + +} + +void CalendarUrlTest::shouldHaveDefaultValue() +{ + CalendarUrl calendarUrl(CalendarUrl::FBUrl); + QVERIFY(!calendarUrl.isValid()); + QVERIFY(calendarUrl.url().isEmpty()); + QVERIFY(calendarUrl.parameters().isEmpty()); +} + +void CalendarUrlTest::shouldAssignValue() +{ + QMap params; + params.insert(QLatin1String("Foo1"), QStringList()<< QLatin1String("bla1") < params; + params.insert(QLatin1String("Foo1"), QStringList()<< QLatin1String("bla1") <> result; + + QVERIFY( calendarUrl == result ); +} + +void CalendarUrlTest::shouldEqualCalendarUrl() +{ + CalendarUrl calendarUrl(CalendarUrl::FBUrl); + CalendarUrl result; + CalendarUrl::CalendarType type = CalendarUrl::CALUri; + calendarUrl.setType(type); + QMap params; + params.insert(QLatin1String("Foo1"), QStringList()<< QLatin1String("bla1") < + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef CALENDARURLTEST_H +#define CALENDARURLTEST_H + +#include + +class CalendarUrlTest : public QObject +{ + Q_OBJECT +public: + explicit CalendarUrlTest(QObject *parent = 0); + ~CalendarUrlTest(); + +private Q_SLOTS: + void shouldHaveDefaultValue(); + void shouldAssignValue(); + void shouldAssignExternal(); + void shouldSerialized(); + void shouldEqualCalendarUrl(); +}; + +#endif // CALENDARURLTEST_H diff -Nru kdepimlibs-4.14.5/kabc/tests/CMakeLists.txt kdepimlibs-4.14.6/kabc/tests/CMakeLists.txt --- kdepimlibs-4.14.5/kabc/tests/CMakeLists.txt 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/tests/CMakeLists.txt 2015-02-26 21:31:08.000000000 +0000 @@ -216,3 +216,22 @@ target_link_libraries(gendertest ${KDE4_KDECORE_LIBS} kabc ${QT_QTTEST_LIBRARY} ${QT_QTGUI_LIBRARY}) + +########### next target ############### + +set(calendarurltest_SRCS calendarurltest.cpp) + + +kde4_add_unit_test(calendarurltest TESTNAME kabc-calendarurltest ${calendarurltest_SRCS}) + +target_link_libraries(calendarurltest ${KDE4_KDECORE_LIBS} kabc ${QT_QTTEST_LIBRARY} ${QT_QTGUI_LIBRARY}) + +########### next target ############### + +set(impptest_SRCS impptest.cpp) + + +kde4_add_unit_test(impptest TESTNAME kabc-impptest ${impptest_SRCS}) + +target_link_libraries(impptest ${KDE4_KDECORE_LIBS} kabc ${QT_QTTEST_LIBRARY} ${QT_QTGUI_LIBRARY}) + diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/testroundtrip.cpp kdepimlibs-4.14.6/kabc/vcardparser/testroundtrip.cpp --- kdepimlibs-4.14.5/kabc/vcardparser/testroundtrip.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/testroundtrip.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -58,9 +58,9 @@ QVERIFY( mInputDir.exists() ); QVERIFY( mInputDir.cd( QLatin1String( "tests" ) ) ); - //mOutput2_1Dir = QDir( QLatin1String( ":/output2.1" ) ); - //QVERIFY( mOutput2_1Dir.exists() ); - //QVERIFY( mOutput2_1Dir.cd( QLatin1String( "tests" ) ) ); + mOutput2_1Dir = QDir( QLatin1String( ":/output2.1" ) ); + QVERIFY( mOutput2_1Dir.exists() ); + QVERIFY( mOutput2_1Dir.cd( QLatin1String( "tests" ) ) ); mOutput3_0Dir = QDir( QLatin1String( ":/output3.0" ) ); QVERIFY( mOutput3_0Dir.exists() ); @@ -148,7 +148,6 @@ if ( !output3_0File.isEmpty() ) { const QByteArray outputData = converter.createVCards( list, VCardConverter::v3_0 ); - QFile outputFile( QFileInfo( mOutput3_0Dir, output3_0File ).absoluteFilePath() ); QVERIFY( outputFile.open( QIODevice::ReadOnly ) ); diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/testroundtrip.qrc kdepimlibs-4.14.6/kabc/vcardparser/testroundtrip.qrc --- kdepimlibs-4.14.5/kabc/vcardparser/testroundtrip.qrc 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/testroundtrip.qrc 2015-02-26 21:31:08.000000000 +0000 @@ -11,12 +11,21 @@ tests/vcard8.vcf tests/vcard9.vcf tests/vcard10.vcf - tests/vcard11.vcf + tests/vcard11.vcf + tests/vcard12.vcf + tests/vcard13.vcf + tests/vcard14.vcf - tests/vcard3.vcf.2_1ref + tests/vcard1.vcf.2_1ref + tests/vcard2.vcf.2_1ref + tests/vcard3.vcf.2_1ref + tests/vcard6.vcf.2_1ref + tests/vcard7.vcf.2_1ref + tests/vcard12.vcf.2_1ref + tests/vcard14.vcf.2_1ref @@ -32,6 +41,9 @@ tests/vcard9.vcf.ref tests/vcard10.vcf.ref tests/vcard11.vcf.ref + tests/vcard12.vcf.ref + tests/vcard13.vcf.ref + tests/vcard14.vcf.ref diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard12.vcf kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard12.vcf --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard12.vcf 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard12.vcf 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,15 @@ +BEGIN:VCARD +VERSION:3.0 +UID:pas-id-54B2522600000001 +FN:Good Looking +N:Looking;Good;;; +PHOTO;TYPE=WORK;ENCODING=b:iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAA + CXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wELCiUrjAUGmgAAABl0RVh0Q29tbWVudABDcm + VhdGVkIHdpdGggR0lNUFeBDhcAAAAZSURBVAjXY/zPAAVMDAwMDP//MzAwMMLFAEMrBAHo3Yr/ + AAAAAElFTkSuQmCC +PHOTO;TYPE=HOME;ENCODING=b:iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAA + CXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wELCiQG0MFrrgAAABl0RVh0Q29tbWVudABDcm + VhdGVkIHdpdGggR0lNUFeBDhcAAAAUSURBVAjXY/j//z8DAwOEhAG4GACzagv1unIx3wAAAABJ + RU5ErkJggg== +EMAIL;TYPE=WORK;X-EVOLUTION-UI-SLOT=1:goodlooking@example.com +END:VCARD Binary files /tmp/7vC84FO4vK/kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard12.vcf.2_1ref and /tmp/vXEakC5i6k/kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard12.vcf.2_1ref differ diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard12.vcf.ref kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard12.vcf.ref --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard12.vcf.ref 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard12.vcf.ref 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,16 @@ +BEGIN:VCARD +VERSION:3.0 +EMAIL;TYPE=WORK;X-EVOLUTION-UI-SLOT=1:goodlooking@example.com +FN:Good Looking +N:Looking;Good;;; +PHOTO;ENCODING=b;TYPE=WORK:iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAA + CXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wELCiUrjAUGmgAAABl0RVh0Q29tbWVudABDcmV + hdGVkIHdpdGggR0lNUFeBDhcAAAAZSURBVAjXY/zPAAVMDAwMDP//MzAwMMLFAEMrBAHo3Yr/AA + AAAElFTkSuQmCC +PHOTO;ENCODING=b;TYPE=HOME:iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAA + CXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wELCiQG0MFrrgAAABl0RVh0Q29tbWVudABDcmV + hdGVkIHdpdGggR0lNUFeBDhcAAAAUSURBVAjXY/j//z8DAwOEhAG4GACzagv1unIx3wAAAABJRU + 5ErkJggg== +UID:pas-id-54B2522600000001 +END:VCARD + diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard13.vcf kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard13.vcf --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard13.vcf 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard13.vcf 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,12 @@ +BEGIN:VCARD +CLASS:PUBLIC +EMAIL;TYPE=HOME;X-EVOLUTION-UI-SLOT=2:thejoe@abc.com +EMAIL;TYPE=WORK;X-EVOLUTION-UI-SLOT=1:johndoe@abc.com +FN:Test User +N:User;Test;;; +UID:uJTkVqH5Qt +URL:test1.url +URL:test2.url +VERSION:3.0 +END:VCARD + diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard13.vcf.ref kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard13.vcf.ref --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard13.vcf.ref 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard13.vcf.ref 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,12 @@ +BEGIN:VCARD +VERSION:3.0 +CLASS:PUBLIC +EMAIL;TYPE=HOME,PREF;X-EVOLUTION-UI-SLOT=2:thejoe@abc.com +EMAIL;TYPE=WORK;X-EVOLUTION-UI-SLOT=1:johndoe@abc.com +FN:Test User +N:User;Test;;; +UID:uJTkVqH5Qt +URL:test1.url +URL:test2.url +END:VCARD + diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard14.vcf kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard14.vcf --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard14.vcf 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard14.vcf 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,12 @@ +BEGIN:VCARD +VERSION:3.0 +CLASS:PUBLIC +EMAIL;TYPE=HOME,PREF;X-EVOLUTION-UI-SLOT=2:thejoe@abc.com +EMAIL;TYPE=WORK;X-EVOLUTION-UI-SLOT=1:johndoe@abc.com +FN:Test User +N:User;Test;;; +UID:uJTkVqH5Qt +SOURCE:http://www.kde.org +SOURCE:http://www.kde1.org +END:VCARD + diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard14.vcf.2_1ref kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard14.vcf.2_1ref --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard14.vcf.2_1ref 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard14.vcf.2_1ref 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,11 @@ +BEGIN:VCARD +VERSION:2.1 +EMAIL;HOME;PREF;X-EVOLUTION-UI-SLOT=2:thejoe@abc.com +EMAIL;WORK;X-EVOLUTION-UI-SLOT=1:johndoe@abc.com +FN:Test User +N:User;Test;;; +SOURCE:http://www.kde.org +SOURCE:http://www.kde1.org +UID:uJTkVqH5Qt +END:VCARD + diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard14.vcf.ref kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard14.vcf.ref --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard14.vcf.ref 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard14.vcf.ref 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,12 @@ +BEGIN:VCARD +VERSION:3.0 +CLASS:PUBLIC +EMAIL;TYPE=HOME,PREF;X-EVOLUTION-UI-SLOT=2:thejoe@abc.com +EMAIL;TYPE=WORK;X-EVOLUTION-UI-SLOT=1:johndoe@abc.com +FN:Test User +N:User;Test;;; +SOURCE:http://www.kde.org +SOURCE:http://www.kde1.org +UID:uJTkVqH5Qt +END:VCARD + diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard1.vcf.2_1ref kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard1.vcf.2_1ref --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard1.vcf.2_1ref 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard1.vcf.2_1ref 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,14 @@ +BEGIN:VCARD +VERSION:2.1 +ADR;PARCEL;POSTAL;WORK:;;6544 Battleford Drive;Raleigh;NC;27613-3502;U.S.A. +EMAIL;INTERNET;PREF:Frank_Dawson@Lotus.com +EMAIL;INTERNET:fdawson@earthlink.net +FN:Frank Dawson +N:;;;; +ORG:Lotus Development Corporation +TEL;MSG;VOICE;WORK:+1-919-676-9515 +TEL;FAX;WORK:+1-919-676-9564 +UID:gDVbA6LY3t +URL:http://home.earthlink.net/~fdawson +END:VCARD + diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard2.vcf.2_1ref kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard2.vcf.2_1ref --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard2.vcf.2_1ref 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard2.vcf.2_1ref 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,12 @@ +BEGIN:VCARD +VERSION:2.1 +ADR;WORK:;;501 E. Middlefield Rd.;Mountain View;CA; 94043;U.S.A. +EMAIL;INTERNET:howes@netscape.com +FN:Tim Howes +N:;;;; +ORG:Netscape Communications Corp. +TEL;MSG;VOICE;WORK:+1-415-937-3419 +TEL;FAX;WORK:+1-415-528-4164 +UID:1UgvYejJMs +END:VCARD + diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard3.vcf.2_1ref kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard3.vcf.2_1ref --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard3.vcf.2_1ref 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard3.vcf.2_1ref 2015-02-26 21:31:08.000000000 +0000 @@ -1,6 +1,6 @@ BEGIN:VCARD VERSION:2.1 -EMAIL:geiseri@yahoo.com +EMAIL;INTERNET:geiseri@yahoo.com FN:ian geiser N:geiser;ian;;; ORG:Source eXtreme diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard6.vcf.2_1ref kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard6.vcf.2_1ref --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard6.vcf.2_1ref 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard6.vcf.2_1ref 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,9 @@ +BEGIN:VCARD +VERSION:2.1 +EMAIL;PREF:email1@abc.de +EMAIL:email2@abc.de +FN:Test User +N:User;Test;;; +UID:uJTkVqH5Qt +END:VCARD + diff -Nru kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard7.vcf.2_1ref kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard7.vcf.2_1ref --- kdepimlibs-4.14.5/kabc/vcardparser/tests/vcard7.vcf.2_1ref 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardparser/tests/vcard7.vcf.2_1ref 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,8 @@ +BEGIN:VCARD +VERSION:2.1 +LABEL;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE;WORK:401 Park Drive 3 West\n + Boston\, MA 02215\nUSA\nHerecomesyetanotherline +N:;;;; +UID:pas-id-3E136F9B00000000 +END:VCARD + diff -Nru kdepimlibs-4.14.5/kabc/vcardtool.cpp kdepimlibs-4.14.6/kabc/vcardtool.cpp --- kdepimlibs-4.14.5/kabc/vcardtool.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kabc/vcardtool.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -1,6 +1,7 @@ /* This file is part of libkabc. Copyright (c) 2003 Tobias Koenig + Copyright (c) 2015 Laurent Montel This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -85,6 +86,17 @@ return createVCards( list, version, false /*don't export*/); } +void VCardTool::addParameter(VCardLine &line, VCard::Version version, const QString &key, const QStringList &valueStringList) const +{ + if (version == VCard::v2_1) { + Q_FOREACH(const QString &valueStr, valueStringList) { + line.addParameter( valueStr, QString() ); + } + } else { + line.addParameter( key, valueStringList.join(QLatin1String(",")) ); + } +} + QByteArray VCardTool::createVCards( const Addressee::List &list, VCard::Version version, bool exportVcard ) const { @@ -147,9 +159,9 @@ for ( typeIt = mAddressTypeMap.constBegin(); typeIt != mAddressTypeMap.constEnd(); ++typeIt ) { if ( typeIt.value() & ( *it ).type() ) { - adrLine.addParameter( QLatin1String( "TYPE" ), typeIt.key() ); + addParameter(adrLine, version, QLatin1String( "TYPE" ), QStringList()< not necessary to export just tag... // CATEGORIES only > 2.1 - if ( version != VCard::v2_1 ) { - QStringList categories = ( *addrIt ).categories(); - QStringList::Iterator catIt; - QStringList::Iterator catEnd( categories.end() ); - for ( catIt = categories.begin(); catIt != catEnd; ++catIt ) { - ( *catIt ).replace( QLatin1Char( ',' ), QLatin1String( "\\," ) ); - } + if (!exportVcard) { + if ( version != VCard::v2_1 ) { + QStringList categories = ( *addrIt ).categories(); + QStringList::Iterator catIt; + QStringList::Iterator catEnd( categories.end() ); + for ( catIt = categories.begin(); catIt != catEnd; ++catIt ) { + ( *catIt ).replace( QLatin1Char( ',' ), QLatin1String( "\\," ) ); + } + + VCardLine catLine( QLatin1String( "CATEGORIES" ), categories.join( QLatin1String( "," ) ) ); + card.addLine( catLine ); + } + } - VCardLine catLine( QLatin1String( "CATEGORIES" ), categories.join( QLatin1String( "," ) ) ); - card.addLine( catLine ); + // MEMBER (only in 4.0) + if ( version == VCard::v4_0) { + // The KIND property must be set to "group" in order to use this property. + if (( *addrIt ).kind().toLower() == QLatin1String("group")) { + Q_FOREACH (const QString &member, ( *addrIt ).members() ) { + VCardLine line( QLatin1String( "MEMBER" ), member ); + card.addLine( line ); + } + } } + // SOURCE + Q_FOREACH (const KUrl &url, ( *addrIt ).sourcesUrlList()) { + VCardLine line = VCardLine( QLatin1String( "SOURCE" ), url.url() ); + card.addLine( line ); + } + + // RELATED + if (version == VCard::v4_0) { + Q_FOREACH (const QString &relation, ( *addrIt ).relationShips() ) { + VCardLine line( QLatin1String( "RELATED" ), relation ); + card.addLine( line ); + } + } // CLASS only for version == 3.0 if ( version == VCard::v3_0 ) { card.addLine( createSecrecy( ( *addrIt ).secrecy() ) ); @@ -231,11 +271,19 @@ foundType = true; } if (!valueStringList.isEmpty()) { - line.addParameter( i.key(), valueStringList.join(QLatin1String(",")) ); + if (i.key().toLower() == QLatin1String( "type" )) { + addParameter(line, version, i.key(), valueStringList); + } else { + line.addParameter( i.key(), valueStringList.join(QLatin1String(",")) ); + } } } if (!foundType && needToAddPref) { - line.addParameter( QLatin1String( "TYPE" ), QLatin1String( "PREF" ) ); + if (version == VCard::v2_1) { + line.addParameter( QLatin1String( "PREF" ), QString() ); + } else { + line.addParameter( QLatin1String( "TYPE" ), QLatin1String( "PREF" ) ); + } } card.addLine( line ); } @@ -270,6 +318,9 @@ // LOGO card.addLine( createPicture( QLatin1String( "LOGO" ), ( *addrIt ).logo(), version ) ); + Q_FOREACH (const KABC::Picture &logo, ( *addrIt ).extraLogoList()) { + card.addLine( createPicture( QLatin1String( "LOGO" ), logo, version ) ); + } // MAILER only for version < 4.0 if ( version != VCard::v4_0 ) { @@ -349,6 +400,9 @@ // PHOTO card.addLine( createPicture( QLatin1String( "PHOTO" ), ( *addrIt ).photo(), version ) ); + Q_FOREACH (const KABC::Picture &photo, ( *addrIt ).extraPhotoList()) { + card.addLine( createPicture( QLatin1String( "PHOTO" ), photo, version ) ); + } // PROID only for version > 2.1 if ( version != VCard::v2_1 ) { @@ -373,6 +427,9 @@ // SOUND card.addLine( createSound( ( *addrIt ).sound(), version ) ); + Q_FOREACH (const KABC::Sound &sound, ( *addrIt ).extraSoundList()) { + card.addLine( createSound( sound, version ) ); + } // TEL const PhoneNumber::List phoneNumbers = ( *addrIt ).phoneNumbers(); @@ -385,7 +442,7 @@ QMap::ConstIterator typeEnd( mPhoneTypeMap.constEnd() ); for ( typeIt = mPhoneTypeMap.constBegin(); typeIt != typeEnd; ++typeIt ) { if ( typeIt.value() & ( *phoneIt ).type() ) { - line.addParameter( QLatin1String( "TYPE" ), typeIt.key() ); + addParameter(line, version, QLatin1String( "TYPE" ), QStringList()< mAddressTypeMap; QMap mPhoneTypeMap; - + void addParameter(VCardLine &line, VCard::Version version, const QString &key, const QStringList &valueStringList) const; class VCardToolPrivate; VCardToolPrivate *d; }; diff -Nru kdepimlibs-4.14.5/kholidays/holidays/plan2/holiday_uy_es kdepimlibs-4.14.6/kholidays/holidays/plan2/holiday_uy_es --- kdepimlibs-4.14.5/kholidays/holidays/plan2/holiday_uy_es 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kholidays/holidays/plan2/holiday_uy_es 2015-02-26 21:31:08.000000000 +0000 @@ -29,7 +29,7 @@ "Navidad" public religious on december 25 :: Religious -"Carnaval" religious on easter minus 47 days length 2 days +"Carnaval" religious on easter minus 48 days length 2 days "Jueves santo" religious on easter minus 3 days "Viernes santo" religious on easter minus 2 days "Sábado de gloria" religious on easter minus 1 day diff -Nru kdepimlibs-4.14.5/kmbox/mbox.cpp kdepimlibs-4.14.6/kmbox/mbox.cpp --- kdepimlibs-4.14.5/kmbox/mbox.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmbox/mbox.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -313,8 +313,8 @@ bool MBox::purge( const MBoxEntry::List &deletedEntries, QList *movedEntries ) { - if ( d->mMboxFile.fileName().isEmpty() ) { - return false; // No file loaded yet. + if ( d->mMboxFile.fileName().isEmpty() || d->mReadOnly ) { + return false; // No file loaded yet or it's readOnly } if ( deletedEntries.isEmpty() ) { @@ -569,6 +569,10 @@ if ( !fileName.isEmpty() && KUrl( fileName ).toLocalFile() != d->mMboxFile.fileName() ) { if ( !d->mMboxFile.copy( fileName ) ) { return false; + } else { + // if the original file was read-only, also the copied file is read-only + // Let's make it writable now + QFile::setPermissions(fileName, d->mMboxFile.permissions() | QFile::WriteOwner); } if ( d->mAppendedEntries.size() == 0 ) { @@ -589,6 +593,9 @@ return true; } + if ( d->mReadOnly ) + return false; + if ( d->mAppendedEntries.size() == 0 ) { return true; // Nothing to do. } @@ -692,3 +699,13 @@ return !d->mFileLocked; } + +void MBox::setReadOnly(bool ro) +{ + d->mReadOnly = ro; +} + +bool MBox::isReadOnly() const +{ + return d->mReadOnly; +} diff -Nru kdepimlibs-4.14.5/kmbox/mbox.h kdepimlibs-4.14.6/kmbox/mbox.h --- kdepimlibs-4.14.5/kmbox/mbox.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmbox/mbox.h 2015-02-26 21:31:08.000000000 +0000 @@ -121,8 +121,7 @@ /** * Removes all messages for the given mbox entries from the current reference file - * (i.e. the file that is loaded with load( const QString & ) or the file - * from the last save( const QString & ) call if that was not the same file). + * (the file that is loaded with load( const QString & ). * This method will first check if all lines at the offsets are actually * separator lines if this is not then no message will be deleted to prevent * corruption. @@ -135,7 +134,7 @@ * the @c second member is the entry with the new (current) offset * * @return true if all offsets refer to a mbox separator line and a file was - * loaded, false otherewhise. In the latter the physical file has + * loaded, false otherwise. If the latter, the physical file has * not changed. */ bool purge( const MBoxEntry::List &deletedEntries, QList *movedEntries = 0 ); @@ -198,7 +197,7 @@ * new LockType cannot be used (e.g. the lockfile executable could not be * found) the LockType will not be changed. * @param ltype the locktype to set - * This method will not do anything if the mbox obeject is currently locked + * This method will not do anything if the mbox object is currently locked * to make sure that it doesn't leave a locked file for one of the lockfile * / mutt_dotlock methods. */ @@ -231,6 +230,33 @@ */ bool unlock(); + /** + * Set the access mode of the mbox file to read only. + * + * If this is set to true, the mbox file can only be read from disk. + * When the mbox file given in load() can not be opened in readWrite mode, + * but can be opened in readOnly mode, this flag is automatically set to true. + * You can still append messages, which are stored in memory + * until save() is called, but the mbox can not be saved/purged to itself. + * However it is possible to save it to a different file. + * @param ro the readOnly flag to use + * + * @see save( const QString & ) + * + * @since 4.14.5 + */ + void setReadOnly(bool ro = true); + + /** + * Returns if the current access mode is set to readOnly. + * + * The access mode can either be set explicitely with setReadOnly() or + * implicitely by calling load() on a readOnly file. + * + * @since 4.14.5 + */ + bool isReadOnly() const; + private: //@cond PRIVATE friend class MBoxPrivate; diff -Nru kdepimlibs-4.14.5/kmbox/mbox_p.cpp kdepimlibs-4.14.6/kmbox/mbox_p.cpp --- kdepimlibs-4.14.5/kmbox/mbox_p.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmbox/mbox_p.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -45,10 +45,17 @@ return true; // already open } - if ( !mMboxFile.open( QIODevice::ReadWrite ) ) { // messages file - kDebug() << "Cannot open mbox file `" << mMboxFile.fileName() << "' FileError:" - << mMboxFile.errorString(); - return false; + QIODevice::OpenMode mode = mReadOnly ? QIODevice::ReadOnly : QIODevice::ReadWrite; + + if ( !mMboxFile.open( mode ) ) { // messages file + // failed to open readWrite -> try to open readOnly + if ( !mMboxFile.open( QIODevice::ReadOnly ) ) { + kDebug() << "Cannot open mbox file `" << mMboxFile.fileName() << "' FileError:" + << mMboxFile.errorString(); + return false; + } else { + mReadOnly = true; + } } return true; diff -Nru kdepimlibs-4.14.5/kmbox/tests/mboxtest.cpp kdepimlibs-4.14.6/kmbox/tests/mboxtest.cpp --- kdepimlibs-4.14.5/kmbox/tests/mboxtest.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmbox/tests/mboxtest.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -455,6 +455,52 @@ } } +void MboxTest::testReadOnlyMbox() +{ + { // create a non-empty mbox file + MBox mbox; + QVERIFY(mbox.load(fileName())); + mbox.appendMessage(mMail1); + mbox.appendMessage(mMail2); + QVERIFY(mbox.save()); + } + + QFile::Permissions perm = QFile::permissions(fileName()); + QFile::setPermissions(fileName(), QFile::ReadOwner); + + MBox mbox; + QVERIFY(mbox.load(fileName())); + QVERIFY(mbox.isReadOnly()); + + // this still works since we could save it to a different file + MBoxEntry entry = mbox.appendMessage(mMail1); + + QVERIFY(!mbox.save()); // original mbox is read-only + + // reading back the appended message (from memory) + QByteArray msg = mbox.readRawMessage(entry); + QVERIFY(!msg.isEmpty()); + + // read first message from disk + MBoxEntry::List list = mbox.entries(); + msg = mbox.readRawMessage(list.at(0)); + QVERIFY(!msg.isEmpty()); + + QVERIFY(!mbox.purge(list)); // original mbox is read-only + + QString tmpSaved = mTempDir->name() + QLatin1String("tempSaved.mbox"); + QVERIFY(mbox.save(tmpSaved)); // other mbox file can be written + + MBox savedMbox; + savedMbox.setReadOnly(); + QVERIFY(savedMbox.isReadOnly()); + QVERIFY(savedMbox.load(tmpSaved)); + QVERIFY(!savedMbox.save()); + + // set back to initial permissions + QFile::setPermissions(fileName(), perm); +} + void MboxTest::cleanupTestCase() { mTempDir->unlink(); diff -Nru kdepimlibs-4.14.5/kmbox/tests/mboxtest.h kdepimlibs-4.14.6/kmbox/tests/mboxtest.h --- kdepimlibs-4.14.5/kmbox/tests/mboxtest.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmbox/tests/mboxtest.h 2015-02-26 21:31:08.000000000 +0000 @@ -44,6 +44,7 @@ void testEntries(); void testPurge(); void testHeaders(); + void testReadOnlyMbox(); private: QString fileName(); diff -Nru kdepimlibs-4.14.5/kmime/kmime_content.cpp kdepimlibs-4.14.6/kmime/kmime_content.cpp --- kdepimlibs-4.14.5/kmime/kmime_content.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmime/kmime_content.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -586,42 +586,59 @@ } } -void Content::removeContent( Content *c, bool del ) +void Content::replaceContent(Content *oldContent, Content *newContent) { - Q_D( Content ); - if ( d->multipartContents.isEmpty() || !d->multipartContents.contains( c ) ) { - return; - } + Q_D( Content ); + if ( d->multipartContents.isEmpty() || !d->multipartContents.contains( oldContent ) ) { + return; + } - // This method makes no sense for encapsulated messages. - // Should be covered by the above assert already, though. - Q_ASSERT( !bodyIsMessage() ); - - d->multipartContents.removeAll( c ); - if ( del ) { - delete c; - } else { - c->d_ptr->parent = 0; - } + d->multipartContents.removeAll( oldContent ); + delete oldContent; + d->multipartContents.append( newContent ); + if( newContent->parent() != this ) { + // If the content was part of something else, this will remove it from there. + newContent->setParent( this ); + } +} - // If only one content is left, turn this content into a single-part. - if( d->multipartContents.count() == 1 ) { - Content *main = d->multipartContents.first(); - - // Move all headers from the old subcontent to ourselves. - // NOTE: This also sets the new Content-Type. - foreach( Headers::Base *h, main->h_eaders ) { - setHeader( h ); // Will remove the old one if present. +void Content::removeContent( Content *c, bool del ) +{ + Q_D( Content ); + if ( d->multipartContents.isEmpty() || !d->multipartContents.contains( c ) ) { + return; + } + + // This method makes no sense for encapsulated messages. + // Should be covered by the above assert already, though. + Q_ASSERT( !bodyIsMessage() ); + + d->multipartContents.removeAll( c ); + if ( del ) { + delete c; + } else { + c->d_ptr->parent = 0; } - main->h_eaders.clear(); - // Move the body. - d->body = main->body(); + // If only one content is left, turn this content into a single-part. + if( d->multipartContents.count() == 1 ) { + Content *main = d->multipartContents.first(); + + // Move all headers from the old subcontent to ourselves. + // NOTE: This also sets the new Content-Type. + foreach( Headers::Base *h, main->h_eaders ) { + setHeader( h ); // Will remove the old one if present. + } + main->h_eaders.clear(); + + // Move the body. + d->body = main->body(); + + // Delete the old subcontent. + delete main; + d->multipartContents.clear(); + } - // Delete the old subcontent. - delete main; - d->multipartContents.clear(); - } } void Content::changeEncoding( Headers::contentEncoding e ) diff -Nru kdepimlibs-4.14.5/kmime/kmime_content.h kdepimlibs-4.14.6/kmime/kmime_content.h --- kdepimlibs-4.14.5/kmime/kmime_content.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmime/kmime_content.h 2015-02-26 21:31:08.000000000 +0000 @@ -617,6 +617,7 @@ // KDE5: Do not convert single-part->multipart automatically. void addContent( Content *content, bool prepend = false ); + void replaceContent(Content *oldContent, Content *newContent); /** Removes the given sub-Content. If only one sub-Content is left, the current Content object is converted into a single-part Content. diff -Nru kdepimlibs-4.14.5/kmime/kmime_util.cpp kdepimlibs-4.14.6/kmime/kmime_util.cpp --- kdepimlibs-4.14.5/kmime/kmime_util.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmime/kmime_util.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -975,6 +975,27 @@ return false; } +bool hasInvitation( Content *content ) +{ + if ( !content ) { + return false; + } + + if ( isInvitation(content) ) { + return true; + } + + // Ok, content itself is not an invitation. now we deal with multiparts + if ( content->contentType()->isMultipart() ) { + Q_FOREACH ( Content *child, content->contents() ) { + if ( hasInvitation( child ) ) { + return true; + } + } + } + return false; +} + bool isSigned( Message *message ) { if ( !message ) { diff -Nru kdepimlibs-4.14.5/kmime/kmime_util.h kdepimlibs-4.14.6/kmime/kmime_util.h --- kdepimlibs-4.14.5/kmime/kmime_util.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmime/kmime_util.h 2015-02-26 21:31:08.000000000 +0000 @@ -414,6 +414,14 @@ KMIME_EXPORT bool hasAttachment( Content* content ); /** + * Returns whether or not the given MIME node contains an invitation part. This function will + * recursively parse the MIME tree looking for a suitable invitation and return true if one is found. + * @param content the MIME node to parse + * @since 4.14.6 + */ +KMIME_EXPORT bool hasInvitation( Content* content ); + +/** * Returns whether or not the given @p message is partly or fully signed. * * @param message the message to check for being signed diff -Nru kdepimlibs-4.14.5/kmime/tests/auto/CMakeLists.txt kdepimlibs-4.14.6/kmime/tests/auto/CMakeLists.txt --- kdepimlibs-4.14.5/kmime/tests/auto/CMakeLists.txt 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmime/tests/auto/CMakeLists.txt 2015-02-26 21:31:08.000000000 +0000 @@ -1,5 +1,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}") +# to find akonadi-kmime_export.h and akonadi_export.h +include_directories(${CMAKE_BINARY_DIR}/akonadi/kmime ${CMAKE_BINARY_DIR}/akonadi) + macro(add_kmime_test _source) set(_test ${_source}) get_filename_component(_name ${_source} NAME_WE) @@ -20,3 +23,5 @@ add_kmime_test(rfc2231test.cpp) add_kmime_test(base64benchmark.cpp) add_kmime_test(sizetest.cpp) + +target_link_libraries(messagetest akonadi-kde akonadi-kmime) diff -Nru kdepimlibs-4.14.5/kmime/tests/auto/messagetest.cpp kdepimlibs-4.14.6/kmime/tests/auto/messagetest.cpp --- kdepimlibs-4.14.5/kmime/tests/auto/messagetest.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmime/tests/auto/messagetest.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -20,6 +20,8 @@ #include "messagetest.h" #include #include +#include +#include using namespace KMime; @@ -594,6 +596,32 @@ QVERIFY(KMime::isSigned(msg.get()) == false); } +void MessageTest::testCopyFlags() +{ + { + KMime::Message::Ptr msg = readAndParseMail("x-pkcs7.mbox"); + + Akonadi::Item item; + Akonadi::MessageFlags::copyMessageFlags(*msg, item); + + QVERIFY(item.hasFlag(Akonadi::MessageFlags::Signed) == false); + QVERIFY(item.hasFlag(Akonadi::MessageFlags::Encrypted) == true); + QVERIFY(item.hasFlag(Akonadi::MessageFlags::HasInvitation) == false); + QVERIFY(item.hasFlag(Akonadi::MessageFlags::HasAttachment) == false); + } + + { + KMime::Message::Ptr msg = readAndParseMail("signed.mbox"); + + Akonadi::Item item; + Akonadi::MessageFlags::copyMessageFlags(*msg, item); + + QVERIFY(item.hasFlag(Akonadi::MessageFlags::Signed) == true); + QVERIFY(item.hasFlag(Akonadi::MessageFlags::Encrypted) == false); + QVERIFY(item.hasFlag(Akonadi::MessageFlags::HasInvitation) == true); + QVERIFY(item.hasFlag(Akonadi::MessageFlags::HasAttachment) == true); + } +} KMime::Message::Ptr MessageTest::readAndParseMail( const QString &mailFile ) const { diff -Nru kdepimlibs-4.14.5/kmime/tests/auto/messagetest.h kdepimlibs-4.14.6/kmime/tests/auto/messagetest.h --- kdepimlibs-4.14.5/kmime/tests/auto/messagetest.h 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/kmime/tests/auto/messagetest.h 2015-02-26 21:31:08.000000000 +0000 @@ -46,6 +46,7 @@ void testEncapsulatedMessages(); void testOutlookAttachmentNaming(); void testEncryptedMails(); + void testCopyFlags(); private: KMime::Message::Ptr readAndParseMail( const QString &mailFile ) const; diff -Nru kdepimlibs-4.14.5/kmime/tests/data/mails/signed.mbox kdepimlibs-4.14.6/kmime/tests/data/mails/signed.mbox --- kdepimlibs-4.14.5/kmime/tests/data/mails/signed.mbox 1970-01-01 00:00:00.000000000 +0000 +++ kdepimlibs-4.14.6/kmime/tests/data/mails/signed.mbox 2015-02-26 21:31:08.000000000 +0000 @@ -0,0 +1,100 @@ +From kollix@aon.at Sun Jan 25 12:44:33 2015 +From: Martin Koller +To: test@localhost.test +Subject: test +Date: Sun, 25 Jan 2015 13:44:33 +0100 +Message-ID: <2598248.iFiatFhcDT@lapi.koller> +X-KMail-Identity: 511735207 +User-Agent: KMail/4.14.3 (Linux/3.16.7-7-desktop; KDE/4.14.3; x86_64; ; ) +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="nextPart2295257.OfFvv7xAGP"; micalg="pgp-sha1"; protocol="application/pgp-signature" + + +--nextPart2295257.OfFvv7xAGP +Content-Type: multipart/mixed; boundary="nextPart3532720.K8MVRkdBcf" +Content-Transfer-Encoding: quoted-printable + +This is a multi-part message in MIME format. + +=2D-nextPart3532720.K8MVRkdBcf +Content-Transfer-Encoding: 7Bit +Content-Type: text/plain; charset="us-ascii" + +test +=2D-nextPart3532720.K8MVRkdBcf +Content-Disposition: attachment; filename="cal.ics" +Content-Transfer-Encoding: 7Bit +Content-Type: text/calendar; charset="utf-8"; name="cal.ics" + +BEGIN:VCALENDAR +PRODID:-//K Desktop Environment//NONSGML KOrganizer 4.14.3//EN +VERSION:2.0 +X-KDE-ICAL-IMPLEMENTATION-VERSION:1.0 +METHOD:REQUEST +BEGIN:VEVENT +ORGANIZER;CN="Martin Koller":MAILTO:kollix@aon.at +DTSTAMP:20150125T124126Z +ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT; + CUTYPE=INDIVIDUAL;X-UID=116335000:mailto:test@localhost +CREATED:20150125T123913Z +UID:KOrganizer-1427713305.180 +SEQUENCE:2 +LAST-MODIFIED:20150125T124121Z +SUMMARY:test +ATTACH;FMTTYPE=text/plain;X-LABEL=test.txt:file:///tmp/test.txt +DTSTART:20150125T150000Z +DTEND:20150125T154500Z +TRANSP:OPAQUE +END:VEVENT +END:VCALENDAR +=2D-nextPart3532720.K8MVRkdBcf-- +This is a multi-part message in MIME format. + +--nextPart3532720.K8MVRkdBcf +Content-Transfer-Encoding: 7Bit +Content-Type: text/plain; charset="us-ascii" + +test +--nextPart3532720.K8MVRkdBcf +Content-Disposition: attachment; filename="cal.ics" +Content-Transfer-Encoding: 7Bit +Content-Type: text/calendar; charset="utf-8"; name="cal.ics" + +BEGIN:VCALENDAR +PRODID:-//K Desktop Environment//NONSGML KOrganizer 4.14.3//EN +VERSION:2.0 +X-KDE-ICAL-IMPLEMENTATION-VERSION:1.0 +METHOD:REQUEST +BEGIN:VEVENT +ORGANIZER;CN="Martin Koller":MAILTO:kollix@aon.at +DTSTAMP:20150125T124126Z +ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT; + CUTYPE=INDIVIDUAL;X-UID=116335000:mailto:test@localhost +CREATED:20150125T123913Z +UID:KOrganizer-1427713305.180 +SEQUENCE:2 +LAST-MODIFIED:20150125T124121Z +SUMMARY:test +ATTACH;FMTTYPE=text/plain;X-LABEL=test.txt:file:///tmp/test.txt +DTSTART:20150125T150000Z +DTEND:20150125T154500Z +TRANSP:OPAQUE +END:VEVENT +END:VCALENDAR +--nextPart3532720.K8MVRkdBcf-- + +--nextPart2295257.OfFvv7xAGP +Content-Type: application/pgp-signature; name="signature.asc" +Content-Description: This is a digitally signed message part. +Content-Transfer-Encoding: 7Bit + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iD8DBQBUxOUxHmdPoI37D4YRAkbbAJ4wxR9wrFu6t1OvZ2KvtjvGBHsLWQCfTVLn +BT0BF04iL4Ap/lVapK8G9NA= +=rJWz +-----END PGP SIGNATURE----- + +--nextPart2295257.OfFvv7xAGP-- + diff -Nru kdepimlibs-4.14.5/mailtransport/messagequeuejob.cpp kdepimlibs-4.14.6/mailtransport/messagequeuejob.cpp --- kdepimlibs-4.14.5/mailtransport/messagequeuejob.cpp 2015-01-29 22:44:25.000000000 +0000 +++ kdepimlibs-4.14.6/mailtransport/messagequeuejob.cpp 2015-02-26 21:31:08.000000000 +0000 @@ -145,22 +145,7 @@ item.addAttribute( sentActionAttribute.clone() ); item.addAttribute( transportAttribute.clone() ); - // Update status flags - if ( KMime::isSigned( message.get() ) ) { - item.setFlag( Akonadi::MessageFlags::Signed ); - } - - if ( KMime::isEncrypted( message.get() ) ) { - item.setFlag( Akonadi::MessageFlags::Encrypted ); - } - - if ( KMime::isInvitation( message.get() ) ) { - item.setFlag( Akonadi::MessageFlags::HasInvitation ); - } - - if ( KMime::hasAttachment( message.get() ) ) { - item.setFlag( Akonadi::MessageFlags::HasAttachment ); - } + Akonadi::MessageFlags::copyMessageFlags(*message, item); // Set flags. item.setFlag( Akonadi::MessageFlags::Queued );