Skip to content

Commit

Permalink
fix: dock or undock abnormal function
Browse files Browse the repository at this point in the history
as title

Log: as title
Influence: dock or undock function
  • Loading branch information
yixinshark committed Jul 11, 2024
1 parent 5d3f843 commit a66879b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions panels/dock/tray/trayitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,12 @@ DockItemInfos TrayItem::dockItemInfos()
return m_itemInfos;
}

void TrayItem::setItemOnDock(const QString &settingKey, const QString &itemKey, bool visible)
void TrayItem::setItemOnDock(const QString &settingKey, const QString &surfaceId, bool visible)

Check warning on line 71 in panels/dock/tray/trayitem.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'setItemOnDock' is never used.
{
Q_UNUSED(settingKey)
QString pluginId;
for (const DockItemInfo &itemInfo : m_itemInfos) {
if (itemInfo.itemKey == itemKey) {
pluginId = itemInfo.name;
break;
}
}
visible ? TraySettings::instance()->addTrayItemOnDock(pluginId + "::" + itemKey) :
TraySettings::instance()->removeTrayItemOnDock(pluginId + "::" + itemKey);

visible ? TraySettings::instance()->addTrayItemOnDock(surfaceId) :
TraySettings::instance()->removeTrayItemOnDock(surfaceId);
}

D_APPLET_CLASS(TrayItem)
Expand Down
2 changes: 1 addition & 1 deletion panels/dock/tray/trayitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TrayItem : public DS_NAMESPACE::DApplet
void setTrayPluginModel(QAbstractItemModel *newTrayPluginModel);

Q_INVOKABLE DockItemInfos dockItemInfos();
Q_INVOKABLE void setItemOnDock(const QString &settingKey, const QString &itemKey, bool visible);
Q_INVOKABLE void setItemOnDock(const QString &settingKey, const QString &surfaceId, bool visible);

Q_SIGNALS:
void trayPluginModelChanged();
Expand Down

0 comments on commit a66879b

Please sign in to comment.