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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set(DTK_NS Dtk6)
set(ASQT_NS AppStreamQt)

find_package(QT NAMES ${QT_NS} REQUIRED COMPONENTS Core)
find_package(${QT_NS} REQUIRED COMPONENTS Core Gui Concurrent Qml Svg Quick QuickControls2 LinguistTools)
find_package(${QT_NS} REQUIRED COMPONENTS Core Gui Concurrent DBus Qml Svg Quick QuickControls2 LinguistTools)
find_package(${DTK_NS} REQUIRED COMPONENTS Core Gui)
find_package(${ASQT_NS} 1.0 REQUIRED)
find_package(DDEShell REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Build-Depends:
libdtk6gui-dev (>= 6.0.19),
libdtk6declarative-dev (>> 6.7.33),
dde-api-dev (>> 6.0.39),
libdde-shell-dev (>= 2.0.45),
libdde-shell-dev (>= 2.0.53),
libappstreamqt-dev (>= 1.0.0)
Standards-Version: 4.6.0
Rules-Requires-Root: no
Expand Down
10 changes: 6 additions & 4 deletions desktopintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#include "desktopintegration.h"
#include "appmgr.h"

Check warning on line 6 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "appmgr.h" not found.

#include <DConfig>

Check warning on line 8 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DConfig> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <DDBusSender>
#include <DDesktopEntry>

Check warning on line 9 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DDesktopEntry> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <DStandardPaths>

Check warning on line 10 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DStandardPaths> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <DDesktopServices>

Check warning on line 11 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DDesktopServices> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QDir>

Check warning on line 12 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDir> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QFileInfo>

Check warning on line 13 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QFileInfo> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QRect>

Check warning on line 14 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QRect> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QGuiApplication>

Check warning on line 15 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QGuiApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QLoggingCategory>

Check warning on line 16 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QLoggingCategory> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <appinfo.h>
#include <appmgr.h>

#include <xdgactivation.h>

Expand All @@ -25,6 +26,7 @@

namespace {
Q_LOGGING_CATEGORY(logDesktopIntegration, "org.deepin.dde.launchpad.desktop")

}

QString DesktopIntegration::currentDE()
Expand Down Expand Up @@ -69,7 +71,7 @@

void DesktopIntegration::setDisableScale(const QString &desktopId, double disableScale)
{
return AppMgr::setDisableScale(desktopId, disableScale);
AppMgr::setDisableScale(desktopId, disableScale);
}

void DesktopIntegration::showFolder(QStandardPaths::StandardLocation location)
Expand Down Expand Up @@ -188,7 +190,7 @@
// only affect the one in XDG_CONFIG_HOME, don't care about the system one (even if there is one).
void DesktopIntegration::setAutoStart(const QString &desktopId, bool on)
{
return AppMgr::setAutoStart(desktopId, on);
AppMgr::setAutoStart(desktopId, on);
}

bool DesktopIntegration::shouldSkipConfirmUninstallDialog(const QString &desktopId) const
Expand Down
10 changes: 5 additions & 5 deletions qml/windowed/AnalysisView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Control {
FrequentlyUsedProxyModel {
id: freqUsedModel
sourceModel: AppsModel
desktopIdRole: AppItem.DesktopIdRole
launchedTimesRole: AppItem.LaunchedTimesRole
lastLaunchedTimeRole: AppItem.LastLaunchedTimeRole
desktopIdRole: AppsModel.DesktopIdRole
launchedTimesRole: AppsModel.LaunchedTimesRole
lastLaunchedTimeRole: AppsModel.LastLaunchedTimeRole
}

FrequentlyUsedView {
Expand All @@ -44,8 +44,8 @@ Control {
id: recentlyInstalledView
model: RecentlyInstalledProxyModel {
sourceModel: AppsModel
installedTimeRole: AppItem.InstalledTimeRole
lastLaunchedTimeRole: AppItem.LastLaunchedTimeRole
installedTimeRole: AppsModel.InstalledTimeRole
lastLaunchedTimeRole: AppsModel.LastLaunchedTimeRole
}
visible: count > 0
Layout.topMargin: -(Helper.frequentlyUsed.cellPaddingRows / 2)
Expand Down
11 changes: 8 additions & 3 deletions qml/windowed/AppListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ FocusScope {

function scrollToAlphabetCategory(character) {
for (let i = 0; i < model.count; i++) {
let transliterated1st = model.model.data(model.modelIndex(i), AppsModel.TransliteratedRole)[0].toUpperCase()
let transliterated = model.model.data(model.modelIndex(i), AppsModel.TransliteratedRole)
if (!transliterated || transliterated.length === 0)
continue
let transliterated1st = transliterated[0].toUpperCase()
if (character === transliterated1st) {
listView.currentIndex = i
scrollToIndex(listView.currentIndex, 35) // the height of a section heading
Expand All @@ -45,7 +48,7 @@ FocusScope {

function scrollToDDECategory(category) {
for (let i = 0; i < model.count; i++) {
let value = model.model.data(model.modelIndex(i), AppItem.DDECategoryRole)
let value = model.model.data(model.modelIndex(i), AppsModel.DDECategoryRole)
if (category === value) {
listView.currentIndex = i
scrollToIndex(listView.currentIndex, 35) // the height of a section heading
Expand Down Expand Up @@ -81,6 +84,8 @@ FocusScope {
} else if (CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.DDECategory) {
sections = CategorizedSortProxyModel.DDECategorySections()
}
if (!sections || sections.length === 0)
return false
if (String(sections[0]) === section.toUpperCase())
return false
else
Expand Down Expand Up @@ -373,7 +378,7 @@ FocusScope {
Connections {
target: CategorizedSortProxyModel
function onCategoryTypeChanged() {
listView.currentIndex = 0
root.resetViewState()
}
}

Expand Down
31 changes: 29 additions & 2 deletions shell-launcher-applet/launcheritem.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#include "launcheritem.h"
#include "pluginfactory.h"
#include "../launchercontroller.h"
#include <appsmodel.h>
#include <blurhashimageprovider.h>

#include <DDBusSender>
#include <QLoggingCategory>
#include <QDBusConnection>

#include <applet.h>
#include <appletbridge.h>
#include <qmlengine.h>

DS_USE_NAMESPACE
Expand All @@ -27,6 +29,31 @@ LauncherItem::LauncherItem(QObject *parent)
qCDebug(logApplet) << "Initializing LauncherItem applet";
}

bool LauncherItem::load()
{
DAppletBridge bridge(QStringLiteral("org.deepin.ds.dde-apps"));
auto applet = bridge.applet();
if (!applet) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

org.deepin.ds.dde-apps 这个 applet,与launchpad的applet加载顺序,能确定么,这里会不会拿不到啊,要不改到init里吧,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

能确定 ,dde-shell是先加载的根节点, launchpad 的节点在dock下面,而dde-apps是是根节点

@18202781743 18202781743 Aug 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dde-apps也不是dock的节点,他们是平级的,而且dde-shell加载是一颗颗树加载的,没有进行广度优先加载呀,要是先加载的是dock,这会等到launchpad加载完后再去加载dde-apps的,
现在没问题可能是安装字典排序的吧,先加载的是d,dock的是o开头,
看之后dde-shell支持depends依赖吧,

qCWarning(logApplet) << "Unable to load launchpad without the dde-apps applet";
return false;
}

auto model = applet->property("appModel").value<QAbstractItemModel *>();
if (!model) {
qCWarning(logApplet) << "dde-apps did not provide an application model";
return false;
}

auto &appsModel = AppsModel::instance();
appsModel.setSourceModel(model);
appsModel.setReady(applet->property("appModelReady").toBool());
appsModel.setDdeCategories(applet->property("ddeCategories").toMap());
connect(applet, SIGNAL(appModelReadyChanged(bool)), &appsModel, SLOT(setReady(bool)));

qCInfo(logApplet) << "Using dde-shell shared application model";
return DApplet::load();
}

bool LauncherItem::init()
{
DApplet::init();
Expand Down
3 changes: 2 additions & 1 deletion shell-launcher-applet/launcheritem.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -15,6 +15,7 @@ class LauncherItem : public DS_NAMESPACE::DApplet
Q_PROPERTY(QString iconName MEMBER m_iconName NOTIFY iconNameChanged FINAL)
public:
explicit LauncherItem(QObject *parent = nullptr);
bool load() override;
virtual bool init() override;

Q_SIGNALS:
Expand Down
20 changes: 10 additions & 10 deletions shell-launcher-applet/package/launcheritem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -126,25 +126,25 @@ AppletItem {

function getCategoryName(section) {
switch (Number(section)) {
case AppItem.Internet:
case AppsModel.ddeCategories.Internet:
return qsTr("Internet");
case AppItem.Chat:
case AppsModel.ddeCategories.Chat:
return qsTr("Chat");
case AppItem.Music:
case AppsModel.ddeCategories.Music:
return qsTr("Music");
case AppItem.Video:
case AppsModel.ddeCategories.Video:
return qsTr("Video");
case AppItem.Graphics:
case AppsModel.ddeCategories.Graphics:
return qsTr("Graphics");
case AppItem.Game:
case AppsModel.ddeCategories.Game:
return qsTr("Games");
case AppItem.Office:
case AppsModel.ddeCategories.Office:
return qsTr("Office");
case AppItem.Reading:
case AppsModel.ddeCategories.Reading:
return qsTr("Reading");
case AppItem.Development:
case AppsModel.ddeCategories.Development:
return qsTr("Development");
case AppItem.System:
case AppsModel.ddeCategories.System:
return qsTr("System");
default:
return qsTr("Others");
Expand Down
24 changes: 1 addition & 23 deletions src/ddeintegration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,39 +86,18 @@ PROPERTIES
NO_NAMESPACE ON
)

set_source_files_properties(
${CMAKE_CURRENT_LIST_DIR}/xml/org.desktopspec.ApplicationManager1.Application.xml
PROPERTIES
CLASSNAME AppManager1Application
INCLUDE types/amglobaltypes.h
NO_NAMESPACE ON
)

set_source_files_properties(
${CMAKE_CURRENT_LIST_DIR}/xml/org.desktopspec.ObjectManager1.xml
PROPERTIES
CLASSNAME AppManager1ApplicationObjectManager
INCLUDE types/amglobaltypes.h
NO_NAMESPACE ON
)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(DBusCPP_SRC "")

dtk_add_dbus_interface(DBusCPP_SRC ${CMAKE_CURRENT_LIST_DIR}/xml/org.deepin.dde.daemon.Dock1.xml DaemonDock1)
dtk_add_dbus_interface(DBusCPP_SRC ${CMAKE_CURRENT_LIST_DIR}/xml/org.deepin.dde.daemon.Launcher1.xml DaemonLauncher1)
dtk_add_dbus_interface(DBusCPP_SRC ${CMAKE_CURRENT_LIST_DIR}/xml/org.deepin.dde.Appearance1.xml Appearance1)
dtk_add_dbus_interface(DBusCPP_SRC ${CMAKE_CURRENT_LIST_DIR}/xml/org.desktopspec.ApplicationManager1.Application.xml AppManager1Application)
dtk_add_dbus_interface(DBusCPP_SRC ${CMAKE_CURRENT_LIST_DIR}/xml/org.desktopspec.ObjectManager1.xml AppManager1ApplicationObjectManager)

message(INFO ${DBusCPP_SRC})

add_library(dde-integration-dbus OBJECT
${DBusCPP_SRC}
types/qrect.h
types/objectmap.h
types/amglobaltypes.h

appwiz.cpp
ddedock.cpp
Expand All @@ -142,11 +121,10 @@ PUBLIC
)
target_link_libraries(dde-integration-dbus
PUBLIC
Qt::Concurrent
Qt::Concurrent Qt::DBus
PRIVATE
Qt::Core Qt::Gui ${DTK_NS}::Core ${ASQT_NS} launcher-utils)

if (HAVE_DDE_API_EVENTLOGGER)
target_compile_definitions(dde-integration-dbus PRIVATE HAVE_DDE_API_EVENTLOGGER)
target_link_libraries(dde-integration-dbus PRIVATE DDEAPI::EventLogger)
endif()
Loading
Loading