From ef7315b3c97417adde982707e277a3afddcfa787 Mon Sep 17 00:00:00 2001 From: youdiansaodongxi Date: Mon, 17 Jun 2024 14:26:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(src/libappdata):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=88=96=E5=8D=B8=E8=BD=BD=E5=BA=94=E7=94=A8=E6=97=B6=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libappdata/app-category-plugin.cpp | 13 +++++++++++++ src/libappdata/app-list-model.cpp | 3 +++ src/libappdata/app-list-plugin.h | 1 + 3 files changed, 17 insertions(+) diff --git a/src/libappdata/app-category-plugin.cpp b/src/libappdata/app-category-plugin.cpp index 645c70f..e60b861 100644 --- a/src/libappdata/app-category-plugin.cpp +++ b/src/libappdata/app-category-plugin.cpp @@ -68,6 +68,19 @@ AppCategoryPlugin::AppCategoryPlugin(QObject *parent) : AppListPluginInterface(p EventTrack::instance()->sendClickEvent("switch_app_view", "AppView", map); }); + connect(m_categoryModel, &AppCategoryModel::rowsInserted, this, [=] { + Q_EMIT labelChanged(); + }); + connect(m_categoryModel, &AppCategoryModel::rowsRemoved, this, [=] { + Q_EMIT labelChanged(); + }); + connect(m_recentlyModel, &RecentlyInstalledModel::rowsInserted, this, [=] { + Q_EMIT labelChanged(); + }); + connect(m_recentlyModel, &RecentlyInstalledModel::rowsRemoved, this, [=] { + Q_EMIT labelChanged(); + }); + m_actions.append(categoryAction); m_actions.append(firstLatterAction); diff --git a/src/libappdata/app-list-model.cpp b/src/libappdata/app-list-model.cpp index 8b051ac..2ea92d3 100644 --- a/src/libappdata/app-list-model.cpp +++ b/src/libappdata/app-list-model.cpp @@ -128,6 +128,9 @@ void AppListModel::installPlugin(AppListPluginInterface *plugin) connect(m_plugin, &AppListPluginInterface::titleChanged, this, [this, plugin] { m_header->setTitle(plugin->title()); }); + connect(m_plugin, &AppListPluginInterface::labelChanged, this, [this, plugin] { + Q_EMIT labelBottleChanged(); + }); Q_EMIT labelBottleChanged(); } diff --git a/src/libappdata/app-list-plugin.h b/src/libappdata/app-list-plugin.h index 057503f..d06eda9 100644 --- a/src/libappdata/app-list-plugin.h +++ b/src/libappdata/app-list-plugin.h @@ -104,6 +104,7 @@ public: Q_SIGNALS: void titleChanged(); + void labelChanged(); }; } // UkuiMenu