Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Build-Depends:
libdtk6widget-dev,
libdtkcommon-dev,
libgtest-dev,
libgmock-dev,
libicu-dev,
libqt6svg6,
libxcb-ewmh-dev,
Expand Down
7 changes: 6 additions & 1 deletion panels/dock/taskmanager/rolegroupmodel.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2025 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -13,6 +13,11 @@ RoleGroupModel::RoleGroupModel(QAbstractItemModel *sourceModel, int role, QObjec
RoleGroupModel::setSourceModel(sourceModel);
}

RoleGroupModel::~RoleGroupModel()
{
qDeleteAll(m_map);
}

void RoleGroupModel::setDeduplicationRole(const int &role)
{
if (role != m_roleForDeduplication) {
Expand Down
3 changes: 2 additions & 1 deletion panels/dock/taskmanager/rolegroupmodel.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2025 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -12,6 +12,7 @@ class RoleGroupModel : public QAbstractProxyModel

public:
explicit RoleGroupModel(QAbstractItemModel *sourceModel, int role, QObject *parent = nullptr);
~RoleGroupModel() override;
void setSourceModel(QAbstractItemModel *sourceModel) override;

void setDeduplicationRole(const int &role);
Expand Down
5 changes: 4 additions & 1 deletion panels/notification/common/dataaccessorproxy.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -34,6 +34,9 @@ void DataAccessorProxy::setSource(DataAccessor *source)
if (!source)
return;

if (m_source == source)
return;

if (m_source) {
delete m_source;
}
Expand Down
3 changes: 2 additions & 1 deletion tests/panels/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
# SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: CC0-1.0

add_subdirectory(dock)
add_subdirectory(notification)
8 changes: 7 additions & 1 deletion tests/panels/dock/taskmanager/combinemodela.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -43,6 +43,12 @@ TestModelA::TestModelA(QObject *parent)

}

TestModelA::~TestModelA()
{
qDeleteAll(m_list);
m_list.clear();
}

QHash<int, QByteArray> TestModelA::roleNames() const
{
return {
Expand Down
3 changes: 2 additions & 1 deletion tests/panels/dock/taskmanager/combinemodela.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -34,6 +34,7 @@ class TestModelA : public QAbstractListModel
};
Q_ENUM(Roles)
TestModelA(QObject *parent = nullptr);
~TestModelA();
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override;
Expand Down
8 changes: 7 additions & 1 deletion tests/panels/dock/taskmanager/combinemodelb.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -43,6 +43,12 @@ TestModelB::TestModelB(QObject *parent)

}

TestModelB::~TestModelB()
{
qDeleteAll(m_list);
m_list.clear();
}

QHash<int, QByteArray> TestModelB::roleNames() const
{
return {
Expand Down
3 changes: 2 additions & 1 deletion tests/panels/dock/taskmanager/combinemodelb.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -33,6 +33,7 @@ class TestModelB : public QAbstractListModel
};
Q_ENUM(Roles)
TestModelB(QObject *parent = nullptr);
~TestModelB();
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override;
Expand Down
5 changes: 3 additions & 2 deletions tests/panels/dock/taskmanager/rolecombinemodeltests.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -68,7 +68,8 @@ TEST(RoleGroupModel, ModelTest)
return QModelIndex();
});

[[maybe_unused]] auto tester = new QAbstractItemModelTester(&model, QAbstractItemModelTester::FailureReportingMode::Fatal);
auto tester = new QAbstractItemModelTester(&model, QAbstractItemModelTester::FailureReportingMode::Fatal);
delete tester;
}

TEST(RoleCombineModel, dataTest) {
Expand Down
Loading
Loading