Hello community, here is the log from the commit of package kdepim-runtime for openSUSE:Factory checked in at 2016-07-21 07:45:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kdepim-runtime (Old) and /work/SRC/openSUSE:Factory/.kdepim-runtime.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "kdepim-runtime" Changes: -------- --- /work/SRC/openSUSE:Factory/kdepim-runtime/kdepim-runtime.changes 2016-06-20 10:59:34.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kdepim-runtime.new/kdepim-runtime.changes 2016-07-21 07:45:44.000000000 +0200 @@ -1,0 +2,8 @@ +Thu Jul 7 23:48:32 UTC 2016 - tittiatcoke@gmail.com + +- Update to KDE Applications 16.04.3 + * KDE Applications 16.04.3 + * https://www.kde.org/announcements/announce-applications-16.04.3.php + + +------------------------------------------------------------------- Old: ---- kdepim-runtime-16.04.2.tar.xz New: ---- kdepim-runtime-16.04.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdepim-runtime.spec ++++++ --- /var/tmp/diff_new_pack.Fyfil1/_old 2016-07-21 07:45:45.000000000 +0200 +++ /var/tmp/diff_new_pack.Fyfil1/_new 2016-07-21 07:45:45.000000000 +0200 @@ -17,9 +17,9 @@ %define kf5_version 5.1.0 -%define kf5_pimlibs_version 16.04.2 +%define kf5_pimlibs_version 16.04.3 Name: kdepim-runtime -Version: 16.04.2 +Version: 16.04.3 Release: 0 Summary: Runtime modules for kdepim License: GPL-2.0 ++++++ kdepim-runtime-16.04.2.tar.xz -> kdepim-runtime-16.04.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-runtime-16.04.2/CMakeLists.txt new/kdepim-runtime-16.04.3/CMakeLists.txt --- old/kdepim-runtime-16.04.2/CMakeLists.txt 2016-05-12 21:26:25.000000000 +0200 +++ new/kdepim-runtime-16.04.3/CMakeLists.txt 2016-06-19 15:35:53.000000000 +0200 @@ -35,7 +35,7 @@ set(KDEPIM_RUNTIME_DEV_VERSION "") endif() -set(KDEPIM_RUNTIME_VERSION_NUMBER "5.2.2") +set(KDEPIM_RUNTIME_VERSION_NUMBER "5.2.3") set(KDEPIM_RUNTIME_VERSION "${KDEPIM_RUNTIME_VERSION_NUMBER}${KDEPIM_RUNTIME_DEV_VERSION}") configure_file(kdepim-runtime-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdepim-runtime-version.h @ONLY) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-runtime-16.04.2/agents/newmailnotifier/CMakeLists.txt new/kdepim-runtime-16.04.3/agents/newmailnotifier/CMakeLists.txt --- old/kdepim-runtime-16.04.2/agents/newmailnotifier/CMakeLists.txt 2016-05-12 21:26:25.000000000 +0200 +++ new/kdepim-runtime-16.04.3/agents/newmailnotifier/CMakeLists.txt 2016-06-19 15:35:53.000000000 +0200 @@ -55,6 +55,9 @@ set_target_properties( akonadi_newmailnotifier_agent PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "KDE New Mail Notifier") endif () +if(BUILD_TESTING) + add_subdirectory(tests) +endif() install(TARGETS akonadi_newmailnotifier_agent ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-runtime-16.04.2/agents/newmailnotifier/newmailnotifierselectcollectionwidget.cpp new/kdepim-runtime-16.04.3/agents/newmailnotifier/newmailnotifierselectcollectionwidget.cpp --- old/kdepim-runtime-16.04.2/agents/newmailnotifier/newmailnotifierselectcollectionwidget.cpp 2016-05-12 21:26:25.000000000 +0200 +++ new/kdepim-runtime-16.04.3/agents/newmailnotifier/newmailnotifierselectcollectionwidget.cpp 2016-06-19 15:35:53.000000000 +0200 @@ -23,29 +23,87 @@ #include <CollectionModifyJob> #include <CollectionFilterProxyModel> #include <KRecursiveFilterProxyModel> +#include <AkonadiCore/AttributeFactory> #include <ChangeRecorder> #include <EntityTreeModel> #include <Collection> #include <KMime/Message> -#include <KCheckableProxyModel> - #include <KLocalizedString> #include <QPushButton> #include <KLineEdit> #include "newmailnotifier_debug.h" #include <QVBoxLayout> +#include <QIdentityProxyModel> #include <QHBoxLayout> #include <QTreeView> #include <QLabel> #include <QTimer> +NewMailNotifierCollectionProxyModel::NewMailNotifierCollectionProxyModel(QObject *parent) + : QIdentityProxyModel(parent) +{ +} + +QVariant NewMailNotifierCollectionProxyModel::data(const QModelIndex &index, int role) const +{ + if (role == Qt::CheckStateRole) + { + if (index.isValid()) { + const Akonadi::Collection collection = + data(index, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>(); + if (mNotificationCollection.contains(collection)) { + return mNotificationCollection.value(collection) ? Qt::Checked : Qt::Unchecked; + } else { + Akonadi::NewMailNotifierAttribute *attr = collection.attribute<Akonadi::NewMailNotifierAttribute>(); + if (!attr || !attr->ignoreNewMail()) { + return Qt::Checked; + } + return Qt::Unchecked; + } + } + } + return QIdentityProxyModel::data(index, role); +} + +bool NewMailNotifierCollectionProxyModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + if (role == Qt::CheckStateRole) + { + if (index.isValid()) { + const Akonadi::Collection collection = + data(index, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>(); + mNotificationCollection[collection] = (value == Qt::Checked); + emit dataChanged(index, index); + return true; + } + } + + return QIdentityProxyModel::setData(index, value, role); +} + +Qt::ItemFlags NewMailNotifierCollectionProxyModel::flags(const QModelIndex &index) const +{ + if (index.isValid()) { + return QIdentityProxyModel::flags(index) | Qt::ItemIsUserCheckable; + } else { + return QIdentityProxyModel::flags(index); + } +} + +QHash<Akonadi::Collection, bool> NewMailNotifierCollectionProxyModel::notificationCollection() const +{ + return mNotificationCollection; +} + + NewMailNotifierSelectCollectionWidget::NewMailNotifierSelectCollectionWidget(QWidget *parent) : QWidget(parent), mNeedUpdate(false) { + Akonadi::AttributeFactory::registerAttribute<Akonadi::NewMailNotifierAttribute>(); QVBoxLayout *vbox = new QVBoxLayout; QLabel *label = new QLabel(i18n("Select which folders to monitor for new message notifications:")); @@ -67,14 +125,12 @@ mimeTypeProxy->addMimeTypeFilters(QStringList() << KMime::Message::mimeType()); mimeTypeProxy->setSourceModel(mModel); - // Create the Check proxy model. - mSelectionModel = new QItemSelectionModel(mimeTypeProxy); - mCheckProxy = new KCheckableProxyModel(this); - mCheckProxy->setSelectionModel(mSelectionModel); - mCheckProxy->setSourceModel(mimeTypeProxy); + + mNewMailNotifierProxyModel = new NewMailNotifierCollectionProxyModel(this); + mNewMailNotifierProxyModel->setSourceModel(mimeTypeProxy); mCollectionFilter = new KRecursiveFilterProxyModel(this); - mCollectionFilter->setSourceModel(mCheckProxy); + mCollectionFilter->setSourceModel(mNewMailNotifierProxyModel); mCollectionFilter->setDynamicSortFilter(true); mCollectionFilter->setFilterCaseSensitivity(Qt::CaseInsensitive); @@ -114,10 +170,6 @@ void NewMailNotifierSelectCollectionWidget::slotCollectionTreeFetched() { - if (!mNeedUpdate) { - mNeedUpdate = true; - QTimer::singleShot(1000, this, &NewMailNotifierSelectCollectionWidget::slotUpdateCollectionStatus); - } mFolderView->expandAll(); } @@ -127,11 +179,6 @@ mFolderView->expandAll(); } -void NewMailNotifierSelectCollectionWidget::slotUpdateCollectionStatus() -{ - updateStatus(QModelIndex()); -} - void NewMailNotifierSelectCollectionWidget::slotSelectAllCollections() { forceStatus(QModelIndex(), true); @@ -142,46 +189,25 @@ forceStatus(QModelIndex(), false); } -void NewMailNotifierSelectCollectionWidget::updateStatus(const QModelIndex &parent) -{ - const int nbCol = mCheckProxy->rowCount(parent); - for (int i = 0; i < nbCol; ++i) { - const QModelIndex child = mCheckProxy->index(i, 0, parent); - - const Akonadi::Collection collection = - mCheckProxy->data(child, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>(); - - Akonadi::NewMailNotifierAttribute *attr = collection.attribute<Akonadi::NewMailNotifierAttribute>(); - if (!attr || !attr->ignoreNewMail()) { - mCheckProxy->setData(child, Qt::Checked, Qt::CheckStateRole); - } - updateStatus(child); - } - mNeedUpdate = false; -} - void NewMailNotifierSelectCollectionWidget::forceStatus(const QModelIndex &parent, bool status) { - const int nbCol = mCheckProxy->rowCount(parent); + const int nbCol = mNewMailNotifierProxyModel->rowCount(parent); for (int i = 0; i < nbCol; ++i) { - const QModelIndex child = mCheckProxy->index(i, 0, parent); - mCheckProxy->setData(child, status ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole); + const QModelIndex child = mNewMailNotifierProxyModel->index(i, 0, parent); + mNewMailNotifierProxyModel->setData(child, status ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole); forceStatus(child, status); } } -void NewMailNotifierSelectCollectionWidget::updateCollectionsRecursive(const QModelIndex &parent) +void NewMailNotifierSelectCollectionWidget::updateCollectionsRecursive() { - const int nbCol = mCheckProxy->rowCount(parent); - for (int i = 0; i < nbCol; ++i) { - const QModelIndex child = mCheckProxy->index(i, 0, parent); - - Akonadi::Collection collection = - mCheckProxy->data(child, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>(); - + QHashIterator<Akonadi::Collection, bool> i(mNewMailNotifierProxyModel->notificationCollection()); + while (i.hasNext()) { + i.next(); + Akonadi::Collection collection = i.key(); Akonadi::NewMailNotifierAttribute *attr = collection.attribute<Akonadi::NewMailNotifierAttribute>(); Akonadi::CollectionModifyJob *modifyJob = Q_NULLPTR; - const bool selected = (mCheckProxy->data(child, Qt::CheckStateRole).value<int>() != 0); + const bool selected = i.value(); if (selected && attr && attr->ignoreNewMail()) { collection.removeAttribute<Akonadi::NewMailNotifierAttribute>(); modifyJob = new Akonadi::CollectionModifyJob(collection); @@ -196,7 +222,6 @@ if (modifyJob) { connect(modifyJob, &Akonadi::CollectionModifyJob::finished, this, &NewMailNotifierSelectCollectionWidget::slotModifyJobDone); } - updateCollectionsRecursive(child); } } @@ -216,3 +241,5 @@ } } + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-runtime-16.04.2/agents/newmailnotifier/newmailnotifierselectcollectionwidget.h new/kdepim-runtime-16.04.3/agents/newmailnotifier/newmailnotifierselectcollectionwidget.h --- old/kdepim-runtime-16.04.2/agents/newmailnotifier/newmailnotifierselectcollectionwidget.h 2016-05-12 21:26:25.000000000 +0200 +++ new/kdepim-runtime-16.04.3/agents/newmailnotifier/newmailnotifierselectcollectionwidget.h 2016-06-19 15:35:53.000000000 +0200 @@ -23,6 +23,7 @@ #include <QWidget> #include <Collection> #include <QModelIndex> +#include <QIdentityProxyModel> class QItemSelectionModel; class KRecursiveFilterProxyModel; @@ -32,9 +33,25 @@ class ChangeRecorder; } class QTreeView; -class KCheckableProxyModel; class KJob; + +class NewMailNotifierCollectionProxyModel : public QIdentityProxyModel +{ +public: + explicit NewMailNotifierCollectionProxyModel(QObject *parent = Q_NULLPTR); + + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; + + bool setData(const QModelIndex &index, const QVariant &_data, int role) Q_DECL_OVERRIDE; + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; + + QHash<Akonadi::Collection, bool> notificationCollection() const; + +private: + QHash<Akonadi::Collection, bool> mNotificationCollection; +}; + class NewMailNotifierSelectCollectionWidget : public QWidget { Q_OBJECT @@ -42,26 +59,24 @@ explicit NewMailNotifierSelectCollectionWidget(QWidget *parent = Q_NULLPTR); ~NewMailNotifierSelectCollectionWidget(); - void updateCollectionsRecursive(const QModelIndex &parent); + void updateCollectionsRecursive(); private Q_SLOTS: void slotSelectAllCollections(); void slotUnselectAllCollections(); void slotModifyJobDone(KJob *job); - void slotUpdateCollectionStatus(); void slotSetCollectionFilter(const QString &); void slotCollectionTreeFetched(); private: - void updateStatus(const QModelIndex &parent); void forceStatus(const QModelIndex &parent, bool status); QTreeView *mFolderView; QItemSelectionModel *mSelectionModel; Akonadi::EntityTreeModel *mModel; Akonadi::ChangeRecorder *mChangeRecorder; - KCheckableProxyModel *mCheckProxy; KRecursiveFilterProxyModel *mCollectionFilter; + NewMailNotifierCollectionProxyModel *mNewMailNotifierProxyModel; bool mNeedUpdate; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-runtime-16.04.2/agents/newmailnotifier/newmailnotifiersettingsdialog.cpp new/kdepim-runtime-16.04.3/agents/newmailnotifier/newmailnotifiersettingsdialog.cpp --- old/kdepim-runtime-16.04.2/agents/newmailnotifier/newmailnotifiersettingsdialog.cpp 2016-05-12 21:26:25.000000000 +0200 +++ new/kdepim-runtime-16.04.3/agents/newmailnotifier/newmailnotifiersettingsdialog.cpp 2016-06-19 15:35:53.000000000 +0200 @@ -212,7 +212,7 @@ void NewMailNotifierSettingsDialog::slotOkClicked() { - mSelectCollection->updateCollectionsRecursive(QModelIndex()); + mSelectCollection->updateCollectionsRecursive(); NewMailNotifierAgentSettings::setShowPhoto(mShowPhoto->isChecked()); NewMailNotifierAgentSettings::setShowFrom(mShowFrom->isChecked()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-runtime-16.04.2/agents/newmailnotifier/tests/CMakeLists.txt new/kdepim-runtime-16.04.3/agents/newmailnotifier/tests/CMakeLists.txt --- old/kdepim-runtime-16.04.2/agents/newmailnotifier/tests/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/kdepim-runtime-16.04.3/agents/newmailnotifier/tests/CMakeLists.txt 2016-06-19 15:35:53.000000000 +0200 @@ -0,0 +1,13 @@ +set(newmailnotifieragent_common_SRCS) +ecm_qt_declare_logging_category(newmailnotifieragent_common_SRCS HEADER newmailnotifier_debug.h IDENTIFIER NEWMAILNOTIFIER_LOG CATEGORY_NAME log_newmailnotifier) + + +set(newmailnotifierselectcollectionwidget_SRCS newmailnotifierselectcollectionwidget_test.cpp ../newmailnotifierselectcollectionwidget.cpp ${newmailnotifieragent_common_SRCS}) +add_executable(newmailnotifierselectcollectionwidgettest ${newmailnotifierselectcollectionwidget_SRCS}) +target_link_libraries(newmailnotifierselectcollectionwidgettest + Qt5::Widgets + KF5::I18n + KF5::AkonadiCore + KF5::Mime + KF5::Completion + KF5::AkonadiMime) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-runtime-16.04.2/agents/newmailnotifier/tests/newmailnotifierselectcollectionwidget_test.cpp new/kdepim-runtime-16.04.3/agents/newmailnotifier/tests/newmailnotifierselectcollectionwidget_test.cpp --- old/kdepim-runtime-16.04.2/agents/newmailnotifier/tests/newmailnotifierselectcollectionwidget_test.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/kdepim-runtime-16.04.3/agents/newmailnotifier/tests/newmailnotifierselectcollectionwidget_test.cpp 2016-06-19 15:35:53.000000000 +0200 @@ -0,0 +1,34 @@ +/* + Copyright (c) 2016 Laurent Montel <montel@kde.org> + + 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 "newmailnotifierselectcollectionwidget_test.h" +#include "../newmailnotifierselectcollectionwidget.h" +#include <QApplication> + + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + + NewMailNotifierSelectCollectionWidget *w = new NewMailNotifierSelectCollectionWidget; + w->show(); + app.exec(); + delete w; + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepim-runtime-16.04.2/agents/newmailnotifier/tests/newmailnotifierselectcollectionwidget_test.h new/kdepim-runtime-16.04.3/agents/newmailnotifier/tests/newmailnotifierselectcollectionwidget_test.h --- old/kdepim-runtime-16.04.2/agents/newmailnotifier/tests/newmailnotifierselectcollectionwidget_test.h 1970-01-01 01:00:00.000000000 +0100 +++ new/kdepim-runtime-16.04.3/agents/newmailnotifier/tests/newmailnotifierselectcollectionwidget_test.h 2016-06-19 15:35:53.000000000 +0200 @@ -0,0 +1,24 @@ +/* + Copyright (c) 2016 Laurent Montel <montel@kde.org> + + 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 NEWMAILNOTIFIERSELECTCOLLECTIONWIDGET_TEST_H +#define NEWMAILNOTIFIERSELECTCOLLECTIONWIDGET_TEST_H + + +#endif // NEWMAILNOTIFIERSELECTCOLLECTIONWIDGET_TEST_H