diff --git a/frame/controller/dockitemmanager.cpp b/frame/controller/dockitemmanager.cpp index b8ba222f4..522c3a4a3 100644 --- a/frame/controller/dockitemmanager.cpp +++ b/frame/controller/dockitemmanager.cpp @@ -109,7 +109,7 @@ void DockItemManager::startLoadPlugins() const void DockItemManager::refershItemsIcon() { for (auto item : m_itemList) { - item->refershIcon(); + item->refreshIcon(); item->update(); } } diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index b7f78ee29..9d8def293 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -110,15 +110,15 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent) connect(m_itemEntryInter, &DockEntryInter::IsActiveChanged, this, &AppItem::activeChanged); connect(m_itemEntryInter, &DockEntryInter::IsActiveChanged, this, static_cast(&AppItem::update)); connect(m_itemEntryInter, &DockEntryInter::WindowInfosChanged, this, &AppItem::updateWindowInfos, Qt::QueuedConnection); - connect(m_itemEntryInter, &DockEntryInter::IconChanged, this, &AppItem::refershIcon); + connect(m_itemEntryInter, &DockEntryInter::IconChanged, this, &AppItem::refreshIcon); connect(m_updateIconGeometryTimer, &QTimer::timeout, this, &AppItem::updateWindowIconGeometries, Qt::QueuedConnection); - connect(m_retryObtainIconTimer, &QTimer::timeout, this, &AppItem::refershIcon, Qt::QueuedConnection); + connect(m_retryObtainIconTimer, &QTimer::timeout, this, &AppItem::refreshIcon, Qt::QueuedConnection); connect(this, &AppItem::requestUpdateEntryGeometries, this, &AppItem::updateWindowIconGeometries); updateWindowInfos(m_itemEntryInter->windowInfos()); - refershIcon(); + refreshIcon(); connect(GSettingsByApp(), &QGSettings::changed, this, &AppItem::onGSettingsChanged); connect(GSettingsByDockApp(), &QGSettings::changed, this, &AppItem::onGSettingsChanged); @@ -130,7 +130,7 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent) m_curDate = QDate::currentDate(); if (m_curDate.day() != m_lastShowDay) { m_lastShowDay = m_curDate.day(); - refershIcon(); + refreshIcon(); } }); } @@ -395,7 +395,7 @@ void AppItem::resizeEvent(QResizeEvent *e) { DockItem::resizeEvent(e); - refershIcon(); + refreshIcon(); } void AppItem::dragEnterEvent(QDragEnterEvent *e) @@ -463,7 +463,7 @@ void AppItem::showEvent(QShowEvent *e) onGSettingsChanged("enable"); }); - refershIcon(); + refreshIcon(); } void AppItem::showHoverTips() @@ -597,7 +597,7 @@ void AppItem::updateWindowInfos(const WindowInfoMap &info) update(); } -void AppItem::refershIcon() +void AppItem::refreshIcon() { if (!isVisible()) return; diff --git a/frame/item/appitem.h b/frame/item/appitem.h index 435058fd6..f28b704eb 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -91,7 +91,7 @@ private: private slots: void updateWindowInfos(const WindowInfoMap &info); - void refershIcon() override; + void refreshIcon() override; void activeChanged(); void showPreview(); void playSwingEffect(); diff --git a/frame/item/dockitem.h b/frame/item/dockitem.h index 8dc9d568a..7b98e5e27 100644 --- a/frame/item/dockitem.h +++ b/frame/item/dockitem.h @@ -62,7 +62,7 @@ public: virtual QString accessibleName(); public slots: - virtual void refershIcon() {} + virtual void refreshIcon() {} void showPopupApplet(QWidget *const applet); void hidePopup(); diff --git a/frame/item/launcheritem.cpp b/frame/item/launcheritem.cpp index f0fd4469e..9e10f7ccf 100644 --- a/frame/item/launcheritem.cpp +++ b/frame/item/launcheritem.cpp @@ -53,7 +53,13 @@ LauncherItem::LauncherItem(QGSettingsInterface *interface, QWidget *parent) } } -void LauncherItem::refershIcon() +LauncherItem::~LauncherItem() +{ + delete m_gsettings; + m_gsettings = nullptr; +} + +void LauncherItem::refreshIcon() { const int iconSize = qMin(width(), height()); if (DockDisplayMode == Efficient) @@ -94,7 +100,7 @@ void LauncherItem::resizeEvent(QResizeEvent *e) { DockItem::resizeEvent(e); - refershIcon(); + refreshIcon(); } void LauncherItem::mousePressEvent(QMouseEvent *e) diff --git a/frame/item/launcheritem.h b/frame/item/launcheritem.h index c1bbed994..1dec3f6e2 100644 --- a/frame/item/launcheritem.h +++ b/frame/item/launcheritem.h @@ -37,10 +37,11 @@ class LauncherItem : public DockItem public: explicit LauncherItem(QGSettingsInterface *interface, QWidget *parent = nullptr); + ~ LauncherItem() override; inline ItemType itemType() const override {return Launcher;} - void refershIcon() override; + void refreshIcon() override; protected: void showEvent(QShowEvent* event) override; diff --git a/frame/item/pluginsitem.cpp b/frame/item/pluginsitem.cpp index 8141daaa6..29145d72f 100644 --- a/frame/item/pluginsitem.cpp +++ b/frame/item/pluginsitem.cpp @@ -125,7 +125,7 @@ QSize PluginsItem::sizeHint() const return m_centralWidget->sizeHint(); } -void PluginsItem::refershIcon() +void PluginsItem::refreshIcon() { m_pluginInter->refreshIcon(m_itemKey); } diff --git a/frame/item/pluginsitem.h b/frame/item/pluginsitem.h index cee9a859c..f5642d484 100644 --- a/frame/item/pluginsitem.h +++ b/frame/item/pluginsitem.h @@ -54,7 +54,7 @@ public: virtual void setDraging(bool bDrag) override; public slots: - void refershIcon() override; + void refreshIcon() override; void onGSettingsChanged(const QString &key); protected: