fix(src/libappdata): 新增或卸载应用时刷新标签

This commit is contained in:
youdiansaodongxi 2024-06-17 14:26:18 +08:00
parent 32f473fb64
commit ef7315b3c9
3 changed files with 17 additions and 0 deletions

View File

@ -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);

View File

@ -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();
}

View File

@ -104,6 +104,7 @@ public:
Q_SIGNALS:
void titleChanged();
void labelChanged();
};
} // UkuiMenu