diff --git a/applets/kicker/package/contents/ui/main.qml b/applets/kicker/package/contents/ui/main.qml --- a/applets/kicker/package/contents/ui/main.qml +++ b/applets/kicker/package/contents/ui/main.qml @@ -76,6 +76,8 @@ Kicker.RootModel { id: rootModel + autoPopulate: false + appNameFormat: plasmoid.configuration.appNameFormat flat: isDash ? true : plasmoid.configuration.limitDepth sorted: plasmoid.configuration.alphaSort @@ -101,6 +103,7 @@ Component.onCompleted: { favoritesModel.favorites = plasmoid.configuration.favoriteApps; + rootModel.refresh(); } } diff --git a/applets/kicker/plugin/rootmodel.h b/applets/kicker/plugin/rootmodel.h --- a/applets/kicker/plugin/rootmodel.h +++ b/applets/kicker/plugin/rootmodel.h @@ -54,6 +54,8 @@ Q_OBJECT Q_INTERFACES(QQmlParserStatus) + Q_PROPERTY(bool autoPopulate READ autoPopulate WRITE setAutoPopulate NOTIFY autoPopulateChanged) + Q_PROPERTY(QObject* systemFavoritesModel READ systemFavoritesModel NOTIFY systemFavoritesModelChanged) Q_PROPERTY(bool showAllApps READ showAllApps WRITE setShowAllApps NOTIFY showAllAppsChanged) Q_PROPERTY(bool showRecentApps READ showRecentApps WRITE setShowRecentApps NOTIFY showRecentAppsChanged) @@ -69,6 +71,9 @@ Q_INVOKABLE virtual bool trigger(int row, const QString &actionId, const QVariant &argument); + bool autoPopulate() const; + void setAutoPopulate(bool populate); + bool showAllApps() const; void setShowAllApps(bool show); @@ -93,6 +98,7 @@ Q_SIGNALS: void refreshed() const; void systemFavoritesModelChanged() const; + void autoPopulateChanged() const; void showAllAppsChanged() const; void showRecentAppsChanged() const; void showRecentDocsChanged() const; @@ -109,6 +115,8 @@ FavoritesModel *m_favorites; SystemModel *m_systemModel; + bool m_autoPopulate; + bool m_showAllApps; bool m_showRecentApps; bool m_showRecentDocs; diff --git a/applets/kicker/plugin/rootmodel.cpp b/applets/kicker/plugin/rootmodel.cpp --- a/applets/kicker/plugin/rootmodel.cpp +++ b/applets/kicker/plugin/rootmodel.cpp @@ -66,6 +66,7 @@ , m_complete(false) , m_favorites(new FavoritesModel(this)) , m_systemModel(nullptr) +, m_autoPopulate(true) , m_showAllApps(false) , m_showRecentApps(true) , m_showRecentDocs(true) @@ -143,6 +144,19 @@ return AppsModel::trigger(row, actionId, argument); } +bool RootModel::autoPopulate() const +{ + return m_autoPopulate; +} + +void RootModel::setAutoPopulate(bool populate) +{ + if (m_autoPopulate != populate) { + m_autoPopulate = populate; + + emit autoPopulateChanged(); + } +} bool RootModel::showAllApps() const { @@ -246,7 +260,9 @@ { m_complete = true; - refresh(); + if (m_autoPopulate) { + refresh(); + } } void RootModel::refresh()