Hello community, here is the log from the commit of package incidenceeditor for openSUSE:Factory checked in at 2016-09-14 23:02:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/incidenceeditor (Old) and /work/SRC/openSUSE:Factory/.incidenceeditor.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "incidenceeditor" Changes: -------- --- /work/SRC/openSUSE:Factory/incidenceeditor/incidenceeditor.changes 2016-08-29 15:16:21.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.incidenceeditor.new/incidenceeditor.changes 2016-09-14 23:02:53.000000000 +0200 @@ -1,0 +2,8 @@ +Fri Sep 9 08:07:16 UTC 2016 - [email protected] + +- Update to KDE Applications 16.08.1 + * KDE Applications 16.08.1 + * https://www.kde.org/announcements/announce-applications-16.08.1.php + + +------------------------------------------------------------------- Old: ---- incidenceeditor-16.08.0.tar.xz New: ---- incidenceeditor-16.08.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ incidenceeditor.spec ++++++ --- /var/tmp/diff_new_pack.wwVJ2X/_old 2016-09-14 23:02:54.000000000 +0200 +++ /var/tmp/diff_new_pack.wwVJ2X/_new 2016-09-14 23:02:54.000000000 +0200 @@ -17,7 +17,7 @@ Name: incidenceeditor -Version: 16.08.0 +Version: 16.08.1 Release: 0 Summary: Base package of kdepim License: GPL-2.0+ and LGPL-2.1+ ++++++ incidenceeditor-16.08.0.tar.xz -> incidenceeditor-16.08.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/incidenceeditor-16.08.0/.arcconfig new/incidenceeditor-16.08.1/.arcconfig --- old/incidenceeditor-16.08.0/.arcconfig 1970-01-01 01:00:00.000000000 +0100 +++ new/incidenceeditor-16.08.1/.arcconfig 2016-08-26 15:26:42.000000000 +0200 @@ -0,0 +1,4 @@ +{ + "phabricator.uri" : "https://phabricator.kde.org/project/profile/34/", + "history.immutable" : true +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/incidenceeditor-16.08.0/CMakeLists.txt new/incidenceeditor-16.08.1/CMakeLists.txt --- old/incidenceeditor-16.08.0/CMakeLists.txt 2016-08-06 20:11:58.000000000 +0200 +++ new/incidenceeditor-16.08.1/CMakeLists.txt 2016-08-26 15:26:42.000000000 +0200 @@ -19,22 +19,22 @@ include(ECMQtDeclareLoggingCategory) include(ECMAddTests) -set(PIM_VERSION "5.3.0") +set(PIM_VERSION "5.3.1") set(INCIDENCEEDITOR_LIB_VERSION ${PIM_VERSION}) -set(AKONADI_MIMELIB_VERSION "5.3.0") -set(KDEPIM_LIB_VERSION "5.3.0") +set(AKONADI_MIMELIB_VERSION "5.3.1") +set(KDEPIM_LIB_VERSION "5.3.1") set(QT_REQUIRED_VERSION "5.5.0") -set(KMIME_LIB_VERSION "5.3.0") -set(KMAILTRANSPORT_LIB_VERSION "5.3.0") -set(KLDAP_LIB_VERSION "5.3.0") -set(CALENDARUTILS_LIB_VERSION "5.3.0") -set(KCALENDARCORE_LIB_VERSION "5.3.0") -set(CALENDARSUPPORT_LIB_VERSION "5.3.0") -set(LIBKDEPIM_LIB_VERSION "5.3.0") -set(KDGANTT2_LIB_VERSION "5.3.0") -set(EVENTVIEW_LIB_VERSION "5.3.0") -set(AKONADI_VERSION "5.3.0") +set(KMIME_LIB_VERSION "5.3.1") +set(KMAILTRANSPORT_LIB_VERSION "5.3.1") +set(KLDAP_LIB_VERSION "5.3.1") +set(CALENDARUTILS_LIB_VERSION "5.3.1") +set(KCALENDARCORE_LIB_VERSION "5.3.1") +set(CALENDARSUPPORT_LIB_VERSION "5.3.1") +set(LIBKDEPIM_LIB_VERSION "5.3.1") +set(KDGANTT2_LIB_VERSION "5.3.1") +set(EVENTVIEW_LIB_VERSION "5.3.1") +set(AKONADI_VERSION "5.3.1") find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED) find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/incidenceeditor-16.08.0/src/attendeeline.cpp new/incidenceeditor-16.08.1/src/attendeeline.cpp --- old/incidenceeditor-16.08.0/src/attendeeline.cpp 2016-08-06 20:11:58.000000000 +0200 +++ new/incidenceeditor-16.08.1/src/attendeeline.cpp 2016-08-26 15:26:42.000000000 +0200 @@ -420,3 +420,8 @@ Q_EMIT changed(mData->attendee(), KCalCore::Attendee::Ptr(new KCalCore::Attendee(QLatin1String(""), QLatin1String("")))); } +bool AttendeeLine::canDeleteLineEdit() const +{ + return mEdit->canDeleteLineEdit(); +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/incidenceeditor-16.08.0/src/attendeeline.h new/incidenceeditor-16.08.1/src/attendeeline.h --- old/incidenceeditor-16.08.0/src/attendeeline.h 2016-08-06 20:11:58.000000000 +0200 +++ new/incidenceeditor-16.08.1/src/attendeeline.h 2016-08-26 15:26:42.000000000 +0200 @@ -118,6 +118,7 @@ int setColumnWidth(int w) Q_DECL_OVERRIDE; void aboutToBeDeleted() Q_DECL_OVERRIDE; + bool canDeleteLineEdit() const Q_DECL_OVERRIDE; void setActions(AttendeeActions actions); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/incidenceeditor-16.08.0/src/freebusyurldialog.cpp new/incidenceeditor-16.08.1/src/freebusyurldialog.cpp --- old/incidenceeditor-16.08.0/src/freebusyurldialog.cpp 2016-08-06 20:11:58.000000000 +0200 +++ new/incidenceeditor-16.08.1/src/freebusyurldialog.cpp 2016-08-26 15:26:42.000000000 +0200 @@ -41,15 +41,14 @@ FreeBusyUrlDialog::FreeBusyUrlDialog(const AttendeeData::Ptr &attendee, QWidget *parent) : QDialog(parent) { - QFrame *topFrame = new QFrame(this); setModal(true); setWindowTitle(i18n("Edit Free/Busy Location")); - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - QVBoxLayout *mainLayout = new QVBoxLayout; - setLayout(mainLayout); + QVBoxLayout *mainLayout = new QVBoxLayout(this); + + QFrame *topFrame = new QFrame(this); + QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); mainLayout->addWidget(topFrame); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); - okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); connect(buttonBox, &QDialogButtonBox::rejected, this, &FreeBusyUrlDialog::reject); mainLayout->addWidget(buttonBox); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/incidenceeditor-16.08.0/src/incidencecategories.cpp new/incidenceeditor-16.08.1/src/incidencecategories.cpp --- old/incidenceeditor-16.08.0/src/incidencecategories.cpp 2016-08-06 20:11:58.000000000 +0200 +++ new/incidenceeditor-16.08.1/src/incidencecategories.cpp 2016-08-26 15:26:42.000000000 +0200 @@ -26,7 +26,10 @@ #include <Libkdepim/TagWidgets> #include "incidenceeditor_debug.h" +#include <TagAttribute> #include <TagCreateJob> +#include <TagFetchJob> +#include <TagFetchScope> using namespace IncidenceEditorNG; @@ -50,13 +53,15 @@ { mLoadedIncidence = incidence; mDirty = false; + mWasDirty = false; + mSelectedTags.clear(); + mMissingCategories = incidence->categories(); + if (mLoadedIncidence) { - checkForUnknownCategories(mLoadedIncidence->categories()); - } else { - mSelectedTags.clear(); + Akonadi::TagFetchJob *fetchJob = new Akonadi::TagFetchJob(this); + fetchJob->fetchScope().fetchAttribute<Akonadi::TagAttribute>(); + connect(fetchJob, &Akonadi::TagFetchJob::result, this, &IncidenceCategories::onTagsFetched); } - - mWasDirty = false; } void IncidenceCategories::load(const Akonadi::Item &item) @@ -82,13 +87,23 @@ QStringList IncidenceCategories::categories() const { QStringList list; - list.reserve(mSelectedTags.count()); + list.reserve(mSelectedTags.count() + mMissingCategories.count()); Q_FOREACH (const Akonadi::Tag &tag, mSelectedTags) { list << tag.name(); } + list << mMissingCategories; return list; } +void IncidenceCategories::createMissingCategories() +{ + Q_FOREACH (const QString &category, mMissingCategories) { + Akonadi::Tag missingTag = Akonadi::Tag::genericTag(category); + Akonadi::TagCreateJob *createJob = new Akonadi::TagCreateJob(missingTag, this); + connect(createJob, &Akonadi::TagCreateJob::result, this, &IncidenceCategories::onMissingTagCreated); + } +} + bool IncidenceCategories::isDirty() const { return mDirty; @@ -100,11 +115,48 @@ qCDebug(INCIDENCEEDITOR_LOG) << "mLoadedIncidence->categories() = " << mLoadedIncidence->categories(); } -void IncidenceCategories::checkForUnknownCategories(const QStringList &categoriesToCheck) +void IncidenceCategories::matchExistingCategories(const QStringList &categories, + const Akonadi::Tag::List &existingTags) +{ + for (const QString &category : categories) { + auto matchedTagIter = std::find_if(existingTags.cbegin(), existingTags.cend(), + [&category](const Akonadi::Tag &tag) { + return tag.name() == category; + }); + Q_ASSERT(matchedTagIter != existingTags.cend()); + if (!mSelectedTags.contains(*matchedTagIter)) { + mSelectedTags << *matchedTagIter; + } + } +} + +void IncidenceCategories::onTagsFetched(KJob *job) +{ + if (job->error()) { + qCWarning(INCIDENCEEDITOR_LOG) << "Failed to load tags " << job->errorString(); + return; + } + Akonadi::TagFetchJob *fetchJob = static_cast<Akonadi::TagFetchJob *>(job); + const Akonadi::Tag::List jobTags = fetchJob->tags(); + QStringList matchedCategories; + for (const Akonadi::Tag &tag : jobTags) { + if (mMissingCategories.removeAll(tag.name()) > 0) { + matchedCategories << tag.name(); + } + } + matchExistingCategories(matchedCategories, jobTags); + createMissingCategories(); + mUi->mTagWidget->setSelection(mSelectedTags); +} + +void IncidenceCategories::onMissingTagCreated(KJob *job) { - foreach (const QString &category, categoriesToCheck) { - Akonadi::TagCreateJob *tagCreateJob = new Akonadi::TagCreateJob(Akonadi::Tag::genericTag(category), this); - tagCreateJob->setMergeIfExisting(true); - //TODO add the missing tags to the item and add them to the list of selected tags in the widget + if (job->error()) { + qCWarning(INCIDENCEEDITOR_LOG) << "Failed to create tag " << job->errorString(); + return; } + Akonadi::TagCreateJob *createJob = static_cast<Akonadi::TagCreateJob *>(job); + mMissingCategories.removeAll(createJob->tag().name()); + mSelectedTags << createJob->tag(); + mUi->mTagWidget->setSelection(mSelectedTags); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/incidenceeditor-16.08.0/src/incidencecategories.h new/incidenceeditor-16.08.1/src/incidencecategories.h --- old/incidenceeditor-16.08.0/src/incidencecategories.h 2016-08-06 20:11:58.000000000 +0200 +++ new/incidenceeditor-16.08.1/src/incidencecategories.h 2016-08-26 15:26:42.000000000 +0200 @@ -50,21 +50,28 @@ bool isDirty() const Q_DECL_OVERRIDE; void printDebugInfo() const Q_DECL_OVERRIDE; +private: + void matchExistingCategories(const QStringList &categories, const Akonadi::Tag::List &existingTags); + void createMissingCategories(); + private Q_SLOTS: void onSelectionChanged(const Akonadi::Tag::List &); + void onTagsFetched(KJob *); + void onMissingTagCreated(KJob *); private: - - /** If the incidence comes from outside of KDE it can contain unknown categories. - * KOrganizer usually checks for these, but it can happen that it checks before the - * items are in the ETM, due to akonadi's async nature. - * So we make the check inside the editor, and add new categories to config. This way - * the editor can be used standalone too. - * */ - void checkForUnknownCategories(const QStringList &categoriesToCheck); - Ui::EventOrTodoDesktop *mUi; Akonadi::Tag::List mSelectedTags; + + /** + * List of categories for which no tag might exist. + * + * For each category of the editted incidence, we want to make sure that there exists a + * corresponding tag in Akonadi. For missing categories, a \a TagCreateJob is issued. + * Eventually, there should be no missing categories left. In case tag creation fails for some + * categories, this list still holds these categories so they don't get lost + */ + QStringList mMissingCategories; bool mDirty; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/incidenceeditor-16.08.0/src/tests/main.cpp new/incidenceeditor-16.08.1/src/tests/main.cpp --- old/incidenceeditor-16.08.0/src/tests/main.cpp 2016-08-06 20:11:58.000000000 +0200 +++ new/incidenceeditor-16.08.1/src/tests/main.cpp 2016-08-26 15:26:42.000000000 +0200 @@ -39,10 +39,10 @@ int main(int argc, char **argv) { + QApplication app(argc, argv); QCoreApplication::setApplicationName("IncidenceEditorNGApp"); QCoreApplication::setApplicationVersion("0.1"); - QApplication app(argc, argv); QCommandLineParser parser; parser.addHelpOption(); parser.addVersionOption();
