Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package kf6-kcalendarcore for 
openSUSE:Factory checked in at 2024-07-14 08:49:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kf6-kcalendarcore (Old)
 and      /work/SRC/openSUSE:Factory/.kf6-kcalendarcore.new.17339 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kf6-kcalendarcore"

Sun Jul 14 08:49:26 2024 rev:5 rq:1187096 version:6.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kf6-kcalendarcore/kf6-kcalendarcore.changes      
2024-06-09 20:22:10.937741756 +0200
+++ 
/work/SRC/openSUSE:Factory/.kf6-kcalendarcore.new.17339/kf6-kcalendarcore.changes
   2024-07-14 08:52:36.705075674 +0200
@@ -1,0 +2,12 @@
+Tue Jul  9 09:41:35 UTC 2024 - Christophe Marin <[email protected]>
+
+- Update to 6.4.0
+  * New feature release
+  * For more details please see:
+  * https://kde.org/announcements/frameworks/6/6.4.0
+- Changes since 6.3.0:
+  * Add missing QtCore dependency to QML module
+  * Add QML bindings for CalendarListModel and CalendarPluginLoader
+  * Add CalendarListModel
+
+-------------------------------------------------------------------

Old:
----
  kcalendarcore-6.3.0.tar.xz
  kcalendarcore-6.3.0.tar.xz.sig

New:
----
  kcalendarcore-6.4.0.tar.xz
  kcalendarcore-6.4.0.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kf6-kcalendarcore.spec ++++++
--- /var/tmp/diff_new_pack.W92Cln/_old  2024-07-14 08:52:37.341099015 +0200
+++ /var/tmp/diff_new_pack.W92Cln/_new  2024-07-14 08:52:37.345099162 +0200
@@ -20,13 +20,13 @@
 
 %define sonum 6
 %define rname kcalendarcore
-# Full KF6 version (e.g. 6.3.0)
+# Full KF6 version (e.g. 6.4.0)
 %{!?_kf6_version: %global _kf6_version %{version}}
 # Last major and minor KF6 version (e.g. 6.0)
 %{!?_kf6_bugfix_version: %define _kf6_bugfix_version %(echo %{_kf6_version} | 
awk -F. '{print $1"."$2}')}
 %bcond_without released
 Name:           kf6-kcalendarcore
-Version:        6.3.0
+Version:        6.4.0
 Release:        0
 Summary:        Library to access and handle calendar data
 License:        LGPL-2.0-or-later
@@ -42,6 +42,7 @@
 BuildRequires:  pkgconfig
 BuildRequires:  cmake(LibIcal) >= 3.0
 BuildRequires:  cmake(Qt6Core) >= %{qt6_version}
+BuildRequires:  cmake(Qt6Qml) >= %{qt6_version}
 BuildRequires:  cmake(Qt6Gui) >= %{qt6_version}
 BuildRequires:  cmake(Qt6ToolsTools) >= %{qt6_version}
 
@@ -58,6 +59,16 @@
 It supports the standard formats iCalendar and vCalendar and the group
 scheduling standard iTIP.
 
+%package imports 
+Summary:        Library to access to and handle calendar data - QtQuick 
bindings
+Requires:       libKF6CalendarCore%{sonum} = %{version}
+
+%description imports
+KCalendarCore is a library to provide access to and handling of calendar data.
+It supports the standard formats iCalendar and vCalendar and the group
+scheduling standard iTIP. This package provides QtQuick bindings for 
KCalendarCore,
+allowing its use from QML.
+
 %package devel
 Summary:        Development files for kcalendarcore, a library to handle 
calendar data
 Requires:       libKF6CalendarCore%{sonum} = %{version}
@@ -95,6 +106,9 @@
 %{_kf6_debugdir}/kcalendarcore.renamecategories
 %{_kf6_libdir}/libKF6CalendarCore.so.*
 
+%files imports
+%{_kf6_qmldir}/org/kde/calendarcore
+
 %files devel
 %doc %{_kf6_qchdir}/KF6CalendarCore.*
 %{_kf6_cmakedir}/KF6CalendarCore/


++++++ kcalendarcore-6.3.0.tar.xz -> kcalendarcore-6.4.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcalendarcore-6.3.0/CMakeLists.txt 
new/kcalendarcore-6.4.0/CMakeLists.txt
--- old/kcalendarcore-6.3.0/CMakeLists.txt      2024-05-31 15:24:05.000000000 
+0200
+++ new/kcalendarcore-6.4.0/CMakeLists.txt      2024-07-05 22:05:34.000000000 
+0200
@@ -1,11 +1,11 @@
 cmake_minimum_required(VERSION 3.16)
-set(KF_VERSION "6.3.0") # handled by release scripts
+set(KF_VERSION "6.4.0") # handled by release scripts
 
 project(KCalendarCore VERSION ${KF_VERSION})
 
 # ECM setup
 include(FeatureSummary)
-find_package(ECM 6.3.0  NO_MODULE)
+find_package(ECM 6.4.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL "https://commits.kde.org/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
@@ -26,6 +26,7 @@
 include(ECMSetupVersion)
 include(ECMQtDeclareLoggingCategory)
 include(ECMAddQch)
+include(ECMQmlModule)
 
 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of 
deprecated API excluded from the build [default=0].")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcalendarcore-6.3.0/autotests/CMakeLists.txt 
new/kcalendarcore-6.4.0/autotests/CMakeLists.txt
--- old/kcalendarcore-6.3.0/autotests/CMakeLists.txt    2024-05-31 
15:24:05.000000000 +0200
+++ new/kcalendarcore-6.4.0/autotests/CMakeLists.txt    2024-07-05 
22:05:34.000000000 +0200
@@ -57,6 +57,7 @@
   testtostring
   testvcalexport
   testcalendarobserver
+  calendarlistmodeltest
 )
 
 set_target_properties(testmemorycalendar PROPERTIES COMPILE_FLAGS 
-DICALTESTDATADIR="\\"${CMAKE_CURRENT_SOURCE_DIR}/data/\\"")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kcalendarcore-6.3.0/autotests/calendarlistmodeltest.cpp 
new/kcalendarcore-6.4.0/autotests/calendarlistmodeltest.cpp
--- old/kcalendarcore-6.3.0/autotests/calendarlistmodeltest.cpp 1970-01-01 
01:00:00.000000000 +0100
+++ new/kcalendarcore-6.4.0/autotests/calendarlistmodeltest.cpp 2024-07-05 
22:05:34.000000000 +0200
@@ -0,0 +1,42 @@
+/*
+    SPDX-FileCopyrightText: 2022 Volker Krause <[email protected]>
+    SPDX-License-Identifier: LGPL-2.0-or-later
+*/
+
+#include <KCalendarCore/CalendarListModel>
+#include <KCalendarCore/CalendarPluginLoader>
+
+#include <QAbstractItemModelTester>
+#include <QDebug>
+#include <QTest>
+
+using namespace KCalendarCore;
+
+class CalendarListModelTest : public QObject
+{
+    Q_OBJECT
+private Q_SLOTS:
+    void testModel()
+    {
+        CalendarListModel model;
+        QAbstractItemModelTester modelTest(&model);
+
+        if (CalendarPluginLoader::hasPlugin()) {
+            QCOMPARE(model.rowCount(), 
CalendarPluginLoader::plugin()->calendars().size());
+
+            for (auto i = 0; i < model.rowCount(); ++i) {
+                auto idx = model.index(i, 0);
+                
QVERIFY(idx.data(CalendarListModel::CalendarRole).value<KCalendarCore::Calendar 
*>());
+                
QVERIFY(!idx.data(CalendarListModel::NameRole).toString().isEmpty());
+                
QVERIFY(!idx.data(CalendarListModel::IdRole).toString().isEmpty());
+            }
+
+        } else {
+            QCOMPARE(model.rowCount(), 0);
+        }
+    }
+};
+
+QTEST_MAIN(CalendarListModelTest)
+
+#include "calendarlistmodeltest.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcalendarcore-6.3.0/src/CMakeLists.txt 
new/kcalendarcore-6.4.0/src/CMakeLists.txt
--- old/kcalendarcore-6.3.0/src/CMakeLists.txt  2024-05-31 15:24:05.000000000 
+0200
+++ new/kcalendarcore-6.4.0/src/CMakeLists.txt  2024-07-05 22:05:34.000000000 
+0200
@@ -1,6 +1,8 @@
 add_library(KF6CalendarCore)
 add_library(KF6::CalendarCore ALIAS KF6CalendarCore)
 
+qt_extract_metatypes(KF6CalendarCore)
+
 set_target_properties(KF6CalendarCore PROPERTIES
     VERSION     ${KCALENDARCORE_VERSION}
     SOVERSION   ${KCALENDARCORE_SOVERSION}
@@ -17,6 +19,7 @@
     calendar.cpp
     calendar.h
     calendar_p.h
+    calendarlistmodel.cpp
     calendarplugin.cpp
     calendarplugin.h
     calendarpluginloader.cpp
@@ -130,6 +133,7 @@
   CalFormat
   CalStorage
   Calendar
+  CalendarListModel
   CalendarPlugin
   CalendarPluginLoader
   Conference
@@ -165,6 +169,8 @@
   REQUIRED_HEADERS KCalendarCore_HEADERS
 )
 
+add_subdirectory(qml)
+
 ########### install files ###############
 
 install(FILES
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcalendarcore-6.3.0/src/calendarlistmodel.cpp 
new/kcalendarcore-6.4.0/src/calendarlistmodel.cpp
--- old/kcalendarcore-6.3.0/src/calendarlistmodel.cpp   1970-01-01 
01:00:00.000000000 +0100
+++ new/kcalendarcore-6.4.0/src/calendarlistmodel.cpp   2024-07-05 
22:05:34.000000000 +0200
@@ -0,0 +1,81 @@
+/*
+    SPDX-FileCopyrightText: 2022 Volker Krause <[email protected]>
+    SPDX-License-Identifier: LGPL-2.0-or-later
+*/
+
+#include "calendarlistmodel.h"
+
+#include <KCalendarCore/CalendarPlugin>
+#include <KCalendarCore/CalendarPluginLoader>
+
+using namespace KCalendarCore;
+
+namespace KCalendarCore
+{
+class CalendarListModelPrivate
+{
+public:
+    QList<Calendar::Ptr> calendars;
+};
+}
+
+CalendarListModel::CalendarListModel(QObject *parent)
+    : QAbstractListModel(parent)
+{
+    if (CalendarPluginLoader::hasPlugin()) {
+        d = std::make_unique<CalendarListModelPrivate>();
+        d->calendars = CalendarPluginLoader::plugin()->calendars();
+        connect(CalendarPluginLoader::plugin(), 
&CalendarPlugin::calendarsChanged, this, [this]() {
+            beginResetModel();
+            d->calendars = CalendarPluginLoader::plugin()->calendars();
+            endResetModel();
+        });
+    }
+}
+
+CalendarListModel::~CalendarListModel() = default;
+
+int CalendarListModel::rowCount(const QModelIndex &parent) const
+{
+    if (parent.isValid() || !d) {
+        return 0;
+    }
+
+    return d->calendars.size();
+}
+
+QVariant CalendarListModel::data(const QModelIndex &index, int role) const
+{
+    if (!checkIndex(index) || !d) {
+        return {};
+    }
+
+    const auto &cal = d->calendars.at(index.row());
+    switch (role) {
+    case NameRole:
+        return cal->name();
+    case IconRole:
+        return cal->icon();
+    case CalendarRole:
+        return QVariant::fromValue(cal.get());
+    case AccessModeRole:
+        return cal->accessMode();
+    case IdRole:
+        return cal->id();
+    }
+
+    return {};
+}
+
+QHash<int, QByteArray> CalendarListModel::roleNames() const
+{
+    auto n = QAbstractListModel::roleNames();
+    n.insert(NameRole, "name");
+    n.insert(IconRole, "icon");
+    n.insert(CalendarRole, "calendar");
+    n.insert(AccessModeRole, "accessMode");
+    n.insert(IdRole, "id");
+    return n;
+}
+
+#include "moc_calendarlistmodel.cpp"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcalendarcore-6.3.0/src/calendarlistmodel.h 
new/kcalendarcore-6.4.0/src/calendarlistmodel.h
--- old/kcalendarcore-6.3.0/src/calendarlistmodel.h     1970-01-01 
01:00:00.000000000 +0100
+++ new/kcalendarcore-6.4.0/src/calendarlistmodel.h     2024-07-05 
22:05:34.000000000 +0200
@@ -0,0 +1,49 @@
+/*
+    SPDX-FileCopyrightText: 2022 Volker Krause <[email protected]>
+    SPDX-License-Identifier: LGPL-2.0-or-later
+*/
+
+#ifndef KCALENDARCORE_CALENDARLISTMODEL_H
+#define KCALENDARCORE_CALENDARLISTMODEL_H
+
+#include "kcalendarcore_export.h"
+
+#include <QAbstractListModel>
+
+#include <memory>
+
+namespace KCalendarCore
+{
+
+class CalendarListModelPrivate;
+
+/** Model adaptor for KCalendarCore::CalendarPlugin::calendars().
+ *
+ *  @since 6.4
+ */
+class KCALENDARCORE_EXPORT CalendarListModel : public QAbstractListModel
+{
+    Q_OBJECT
+public:
+    explicit CalendarListModel(QObject *parent = nullptr);
+    ~CalendarListModel();
+
+    enum Role {
+        NameRole = Qt::DisplayRole, ///< display name of the calendar
+        IconRole = Qt::DecorationRole, ///< the calendar icon, when available
+        CalendarRole = Qt::UserRole, ///< the KCalendarCore::Calendar calendar
+        AccessModeRole, ///< the access mode of the calendar (see 
KCalendarCore::AccessMode)
+        IdRole, ///< the internal calendar id
+    };
+
+    [[nodiscard]] int rowCount(const QModelIndex &parent = {}) const override;
+    [[nodiscard]] QVariant data(const QModelIndex &index, int role) const 
override;
+    [[nodiscard]] QHash<int, QByteArray> roleNames() const override;
+
+private:
+    std::unique_ptr<CalendarListModelPrivate> d;
+};
+
+}
+
+#endif // KCALENDARCORE_CALENDARLISTMODEL_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcalendarcore-6.3.0/src/qml/CMakeLists.txt 
new/kcalendarcore-6.4.0/src/qml/CMakeLists.txt
--- old/kcalendarcore-6.3.0/src/qml/CMakeLists.txt      1970-01-01 
01:00:00.000000000 +0100
+++ new/kcalendarcore-6.4.0/src/qml/CMakeLists.txt      2024-07-05 
22:05:34.000000000 +0200
@@ -0,0 +1,13 @@
+# SPDX-FileCopyrightText: 2024 Volker Krause <[email protected]>
+# SPDX-License-Identifier: BSD-3-Clause
+
+ecm_add_qml_module(kcalendarcoreqml URI "org.kde.calendarcore" CLASS_NAME 
KCalendarCoreQmlPlugin DEPENDENCIES QtCore)
+
+target_sources(kcalendarcoreqml PRIVATE
+    kcalendarcoreqmlplugin.cpp
+    types.h
+)
+
+target_link_libraries(kcalendarcoreqml PRIVATE KF6CalendarCore Qt6::Qml)
+
+ecm_finalize_qml_module(kcalendarcoreqml)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kcalendarcore-6.3.0/src/qml/kcalendarcoreqmlplugin.cpp 
new/kcalendarcore-6.4.0/src/qml/kcalendarcoreqmlplugin.cpp
--- old/kcalendarcore-6.3.0/src/qml/kcalendarcoreqmlplugin.cpp  1970-01-01 
01:00:00.000000000 +0100
+++ new/kcalendarcore-6.4.0/src/qml/kcalendarcoreqmlplugin.cpp  2024-07-05 
22:05:34.000000000 +0200
@@ -0,0 +1,27 @@
+/*
+    SPDX-FileCopyrightText: 2024 Volker Krause <[email protected]>
+    SPDX-License-Identifier: LGPL-2.0-or-later
+*/
+
+#include <KCalendarCore/CalendarPluginLoader>
+
+#include <QQmlEngine>
+#include <QQmlExtensionPlugin>
+
+class KCalendarCoreQmlPlugin : public QQmlExtensionPlugin
+{
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
+
+public:
+    void registerTypes(const char *uri) override;
+};
+
+void KCalendarCoreQmlPlugin::registerTypes(const char *uri)
+{
+    qmlRegisterSingletonType(uri, 1, 0, "CalendarPluginLoader", [](QQmlEngine 
*, QJSEngine *jsEngine) -> QJSValue {
+        return jsEngine->toScriptValue(KCalendarCore::CalendarPluginLoader());
+    });
+}
+
+#include "kcalendarcoreqmlplugin.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcalendarcore-6.3.0/src/qml/types.h 
new/kcalendarcore-6.4.0/src/qml/types.h
--- old/kcalendarcore-6.3.0/src/qml/types.h     1970-01-01 01:00:00.000000000 
+0100
+++ new/kcalendarcore-6.4.0/src/qml/types.h     2024-07-05 22:05:34.000000000 
+0200
@@ -0,0 +1,19 @@
+/*
+    SPDX-FileCopyrightText: 2024 Volker Krause <[email protected]>
+    SPDX-License-Identifier: LGPL-2.0-or-later
+*/
+
+#ifndef KCALENDARCORE_QML_TYPES
+#define KCALENDARCORE_QML_TYPES
+
+#include <KCalendarCore/CalendarListModel>
+
+#include <QQmlEngine>
+
+struct CalendarListModelForeign {
+    Q_GADGET
+    QML_NAMED_ELEMENT(CalendarListModel)
+    QML_FOREIGN(KCalendarCore::CalendarListModel)
+};
+
+#endif

Reply via email to