Skip to content

Commit

Permalink
chore: remove qml-module-org-kde-kitemmodels dependency
Browse files Browse the repository at this point in the history
移除 qml-module-org-kde-kitemmodels 依赖。

原本全屏视图过滤当前页面的图标用此组件提供的 sortfilterproxy 模型,
但实际实现需要一些额外的支持,比如 sort 后的排序。因而不再使用原方
案。原本的 KSortFilterProxyModel 由 MultiPageSortFilterProxyModel
替代。

Log:
  • Loading branch information
BLumia committed Nov 22, 2023
1 parent c227262 commit 630b4cd
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 450 deletions.
6 changes: 0 additions & 6 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,3 @@ Files: *.deepin.dde.*.xml */org.desktopspec.*.xml
Copyright: UnionTech Software Technology Co., Ltd.
License: GPL-3.0-or-later

# vendored from KItemModels
Files: src/quick/ksortfilterproxymodel.cpp src/quick/ksortfilterproxymodel.h
Copyright: 2010, Marco Martin <[email protected]>
2019, David Edmundson <[email protected]>
License: LGPL-2.0-or-later

3 changes: 1 addition & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Depends:
qml-module-qtquick-controls2,
qml-module-qtquick-controls2-styles-chameleon,
# v-- actually should be depended by qqc2-styles-chameleon
qml-module-qtgraphicaleffects,
qml-module-org-kde-kitemmodels
qml-module-qtgraphicaleffects
Conflicts: dde-launcher
Replaces: dde-launcher
Description: <insert up to 60 chars description>
Expand Down
2 changes: 0 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <launcherappiconprovider.h>
#include <launcherfoldericonprovider.h>
#include <blurhashimageprovider.h>
#include <ksortfilterproxymodel.h>
#include <multipagesortfilterproxymodel.h>

DCORE_USE_NAMESPACE
Expand Down Expand Up @@ -82,7 +81,6 @@ int main(int argc, char* argv[])
LauncherController::instance().setVisible(true);
}

qmlRegisterType<KSortFilterProxyModel>("org.deepin.vendored", 1, 0, "KSortFilterProxyModel");
qmlRegisterType<MultipageSortFilterProxyModel>("org.deepin.launchpad", 1, 0, "MultipageSortFilterProxyModel");
qmlRegisterUncreatableType<AppItem>("org.deepin.launchpad", 1, 0, "AppItem", "AppItem should only be created from C++ side");
qmlRegisterSingletonInstance("org.deepin.launchpad", 1, 0, "AppsModel", &AppsModel::instance());
Expand Down
2 changes: 0 additions & 2 deletions qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<qresource prefix="/">
<file>qml/Main.qml</file>
<file>qml/DebugDialog.qml</file>
<file>qml/FullscreenFrameV23.qml</file>
<file>qml/FullscreenFrame.qml</file>
<file>qml/WindowedFrameV23.qml</file>
<file>qml/WindowedFrame.qml</file>
<file>qml/AlphabetCategory.qml</file>
<file>qml/AppListView.qml</file>
Expand Down
4 changes: 2 additions & 2 deletions qml/FullscreenFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import org.deepin.dtk 1.0
import org.deepin.vendored 1.0

import org.deepin.launchpad 1.0

Expand Down Expand Up @@ -148,7 +147,7 @@ Control {
focus: true
activeGridViewFocusOnTab: gridViewLoader.SwipeView.isCurrentItem
delegate: IconItemDelegate {
dndEnabled: false
dndEnabled: true
Drag.mimeData: {
"application/x-dde-launcher-dnd-fullscreen": ("0," + modelData + "," + index), // "folder,page,index"
"application/x-dde-launcher-dnd-desktopId": model.desktopId
Expand Down Expand Up @@ -365,6 +364,7 @@ Control {
focus: true
activeGridViewFocusOnTab: folderGridViewLoader.SwipeView.isCurrentItem
delegate: IconItemDelegate {
dndEnabled: true
iconSource: "image://app-icon/" + iconName
width: folderGridViewContainer.cellSize
height: folderGridViewContainer.cellSize
Expand Down
4 changes: 3 additions & 1 deletion src/models/multipageproxymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ void MultipageProxyModel::commitDndOperation(const QString &dragId, const QStrin

saveItemArrangementToUserData();
// Lazy solution, just notify the view that all rows and its roles are changed so they need to be updated.
emit dataChanged(index(0, 0, QModelIndex()), index(rowCount(QModelIndex()), 0, QModelIndex()));
emit dataChanged(index(0, 0, QModelIndex()), index(rowCount(QModelIndex()), 0, QModelIndex()), {
PageRole, IndexInPageRole, FolderIdNumberRole, IconsNameRole
});
}

QModelIndex MultipageProxyModel::index(int row, int column, const QModelIndex &parent) const
Expand Down
2 changes: 0 additions & 2 deletions src/quick/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ PRIVATE
launcherappiconprovider.cpp
launcherfoldericonprovider.cpp
blurhashimageprovider.cpp
ksortfilterproxymodel.cpp
)

target_sources(launcher-qml-utils PUBLIC
Expand All @@ -20,7 +19,6 @@ FILES
launcherappiconprovider.h
launcherfoldericonprovider.h
blurhashimageprovider.h
ksortfilterproxymodel.h
)

target_include_directories(launcher-qml-utils PUBLIC ${CMAKE_CURRENT_LIST_DIR})
Expand Down
263 changes: 0 additions & 263 deletions src/quick/ksortfilterproxymodel.cpp

This file was deleted.

Loading

0 comments on commit 630b4cd

Please sign in to comment.