diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index ae0433002..8f207fe64 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -60,7 +60,6 @@ AppItem::AppItem(const QGSettings *appSettings, const QGSettings *activeAppSetti , m_drag(nullptr) , m_dragging(false) , m_retryTimes(0) - , m_lastShowDay(0) , m_iconValid(false) , m_lastclickTimes(0) , m_appIcon(QPixmap()) @@ -116,10 +115,10 @@ AppItem::AppItem(const QGSettings *appSettings, const QGSettings *activeAppSetti connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &AppItem::onThemeTypeChanged); + /** 日历 1S定时判断是否刷新icon的处理 */ connect(m_refershIconTimer, &QTimer::timeout, this, [ = ]() { - m_curDate = QDate::currentDate(); - if (m_curDate.day() != m_lastShowDay) { - m_lastShowDay = m_curDate.day(); + if (QDate::currentDate() != m_curDate) { + m_curDate = QDate::currentDate(); refreshIcon(); } }); diff --git a/frame/item/appitem.h b/frame/item/appitem.h index 50fccb5b7..a4a009d9c 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -120,7 +120,6 @@ private: bool m_dragging; bool m_active; int m_retryTimes; - int m_lastShowDay; bool m_iconValid; unsigned long m_lastclickTimes; @@ -134,9 +133,9 @@ private: QTimer *m_updateIconGeometryTimer; QTimer *m_retryObtainIconTimer; - QTimer *m_refershIconTimer; + QTimer *m_refershIconTimer; // 当APP为日历时定时(1S)检测是否刷新ICON - QDate m_curDate; + QDate m_curDate; // 保存当前icon的日期来判断是否需要更新日历APP的ICON QFutureWatcher *m_smallWatcher; QFutureWatcher *m_largeWatcher;