From b29643728891d69d2d4c90d673f6ee3263cfd92b Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 15 Apr 2020 12:50:36 +0300 Subject: [PATCH] do not reload views for default indicators --when default indicators are reinstalled then views do not have to be reload its sources. The user is expected in such cases to restart Latte. At the same time installing Latte multiple times does not create too many views recreations with no real reason --- app/view/indicator/indicator.cpp | 5 +++++ app/view/indicator/indicator.h | 2 ++ app/view/view.cpp | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/view/indicator/indicator.cpp b/app/view/indicator/indicator.cpp index 4c7140e0c..c95722f38 100644 --- a/app/view/indicator/indicator.cpp +++ b/app/view/indicator/indicator.cpp @@ -122,6 +122,11 @@ void Indicator::setEnabledForApplets(bool enabled) emit enabledForAppletsChanged(); } +bool Indicator::isCustomIndicator() const +{ + return m_corona->indicatorFactory()->isCustomType(type()); +} + bool Indicator::latteTasksArePresent() { return m_view->latteTasksArePresent(); diff --git a/app/view/indicator/indicator.h b/app/view/indicator/indicator.h index c15a15c29..7c95d00dd 100644 --- a/app/view/indicator/indicator.h +++ b/app/view/indicator/indicator.h @@ -96,6 +96,8 @@ public: bool enabledForApplets() const; void setEnabledForApplets(bool enabled); + bool isCustomIndicator() const; + bool latteTasksArePresent(); bool providesConfigUi() const; diff --git a/app/view/view.cpp b/app/view/view.cpp index 36b270c51..4762dc548 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -280,7 +280,7 @@ void View::init() }); connect(this, &View::indicatorPluginChanged, this, [&](const QString &indicatorId) { - if (m_indicator && m_indicator->type() == indicatorId) { + if (m_indicator && m_indicator->isCustomIndicator() && m_indicator->type() == indicatorId) { reloadSource(); } });