Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Shutdown plugin miss menu function #222

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

yixinshark
Copy link
Contributor

as title

Log: as title
Bug: BUG-294875

as title

Log: as title
Bug: BUG-294875
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. PluginItem::handleShutDownMenu函数中,menuId.size() <= Dock::SHUTDOWN_MENU_FLAG.size()这个条件判断可能不正确,因为menuId应该包含SHUTDOWN_MENU_FLAG,所以这个条件判断应该改为menuId.size() < Dock::SHUTDOWN_MENU_FLAG.size()

  2. PluginItem::handleShutDownMenu函数中,QString type = menuId.right(menuId.size() - Dock::SHUTDOWN_MENU_FLAG.size());这行代码可能会抛出异常,如果menuId不包含SHUTDOWN_MENU_FLAG,那么menuId.size() - Dock::SHUTDOWN_MENU_FLAG.size()的结果会是负数,应该先检查menuId是否包含SHUTDOWN_MENU_FLAG

  3. PluginItem::handleShutDownMenu函数中,Q_EMIT sigRequestShutdown(type);这行代码应该改为Q_EMIT sigRequestShutdown(type);,因为sigRequestShutdown函数的参数类型是const QString &

  4. WidgetPlugin::initConnections函数中,connect(pluginItem, &PluginItem::sigRequestshutdown, plugin, &Plugin::EmbedPlugin::pluginRequestShutdown);这行代码应该改为connect(pluginItem, &PluginItem::sigRequestShutdown, plugin, &Plugin::EmbedPlugin::pluginRequestShutdown);,因为sigRequestShutdown函数的参数类型是const QString &

  5. tray-wayland-integration/plugin.h文件中,void pluginRequestShutdown();函数应该改为void pluginRequestShutdown(const QString &type);,因为pluginRequestShutdown函数的参数类型是const QString &

  6. tray-wayland-integration/pluginsurface.cpp文件中,connect(m_plugin, &EmbedPlugin::pluginRequestShutdown, this, [this] { request_shutdown(); });这行代码应该改为connect(m_plugin, &EmbedPlugin::pluginRequestShutdown, this, [this](const QString &type) { request_shutdown(type); });,因为pluginRequestShutdown函数的参数类型是const QString &

  7. protocol/plugin-manager-v1.xml文件中,<request name="request_shutdown"/>应该改为<request name="request_shutdown"><arg name="type" type="string"/></request>,因为request_shutdown函数的参数类型是const QString &

  8. plugins/dde-dock/shutdown/shutdownplugin.cpp文件中,shutdown["itemId"] = SHUTDOWN_MENU_FLAG + "Shutdown";这行代码应该改为shutdown["itemId"] = SHUTDOWN_MENU_FLAG + "Shutdown";,因为SHUTDOWN_MENU_FLAG是一个const QString,应该使用+运算符进行字符串连接。

  9. plugins/dde-dock/shutdown/shutdownplugin.cpp文件中,map["itemId"] = SHUTDOWN_MENU_FLAG + "UpdateAndShutdown";这行代码应该改为map["itemId"] = SHUTDOWN_MENU_FLAG + "UpdateAndShutdown";,因为SHUTDOWN_MENU_FLAG是一个const QString,应该使用+运算符进行字符串连接。

  10. plugins/dde-dock/shutdown/shutdownplugin.cpp文件中,reboot["itemId"] = SHUTDOWN_MENU_FLAG + "Restart";这行代码应该改为reboot["itemId"] = SHUTDOWN_MENU_FLAG + "Restart";,因为SHUTDOWN_MENU_FLAG是一个const QString,应该使用+运算符进行字符串连接。

  11. plugins/dde-dock/shutdown/shutdownplugin.cpp文件中,map["itemId"] = SHUTDOWN_MENU_FLAG + "UpdateAndReboot";这行代码应该改为map["itemId"] = SHUTDOWN_MENU_FLAG + "UpdateAndReboot";,因为SHUTDOWN_MENU_FLAG是一个const QString,应该使用+运算符进行字符串连接。

  12. plugins/dde-dock/shutdown/shutdownplugin.cpp文件中,suspend["itemId"] = SHUTDOWN_MENU_FLAG + "Suspend";这行代码应该改为suspend["itemId"] = SHUTDOWN_MENU_FLAG + "Suspend";,因为SHUTDOWN_MENU_FLAG是一个const QString,应该使用+运算符进行字符串连接。

  13. plugins/dde-dock/shutdown/shutdownplugin.cpp文件中,hibernate["itemId"] = SHUTDOWN_MENU_FLAG + "Hibernate";这行代码应该改为hibernate["itemId"] = SHUTDOWN_MENU_FLAG + "Hibernate";,因为SHUTDOWN_MENU_FLAG是一个const QString,应该使用+运算符进行字符串连接。

  14. plugins/dde-dock/shutdown/shutdownplugin.cpp文件中,lock["itemId"] = SHUTDOWN_MENU_FLAG + "Lock";这行代码应该改为lock["itemId"] = SHUTDOWN_MENU_FLAG + "Lock";,因为SHUTDOWN_MENU_FLAG是一个const QString,应该使用+运算符进行字符串连接。

  15. plugins/dde-dock/shutdown/shutdownplugin.cpp文件中,logout["itemId"] = SHUTDOWN_MENU_FLAG + "Logout";这行代码应该改为logout["itemId"] = SHUTDOWN_MENU_FLAG + "Logout";,因为SHUTDOWN_MENU_FLAG是一个const QString,应该使用+运算符进行字符串连接。

  16. plugins/dde-dock/shutdown/shutdownplugin.cpp文件中,switchUser["itemId"] = SHUTDOWN_MENU_FLAG + "SwitchUser";这行代码应该改为switchUser["itemId"] = SHUTDOWN_MENU_FLAG + "SwitchUser";,因为SHUTDOWN_MENU_FLAG是一个const QString,应该使用+运算符进行字符串连接。

  17. src/loader/pluginitem.cpp文件中,Q_EMIT sigRequestshutdown();这行代码应该改为Q_EMIT sigRequestShutdown(QString());,因为sigRequestShutdown函数的参数类型是const QString &

  18. src/loader/pluginitem.h文件中,void sigRequestshutdown();函数应该改为void sigRequestShutdown(const QString &type);,因为sigRequestShutdown函数的参数类型是const QString &

  19. src/loader/widgetplugin.cpp文件中,connect(pluginItem, &PluginItem::sigRequestshutdown, plugin, &Plugin::EmbedPlugin::pluginRequestShutdown);这行代码应该改为connect(pluginItem, &PluginItem::sigRequestShutdown, plugin, &Plugin::EmbedPlugin::pluginRequestShutdown);,因为sigRequestShutdown函数的参数类型是const QString &

  20. src/tray-wayland-integration/plugin.h文件中,void pluginRequestShutdown();函数应该改为void pluginRequestShutdown(const QString &type);,因为pluginRequestShutdown函数的参数类型是const QString &

  21. src/tray-wayland-integration/pluginsurface.cpp文件中,connect(m_plugin, &EmbedPlugin::pluginRequestShutdown, this, [this] { request_shutdown(); });这行代码应该改为connect(m_plugin, &EmbedPlugin::pluginRequestShutdown, this, [this](const QString &type) { request_shutdown(type); });,因为pluginRequestShutdown函数的参数类型是const QString &

  22. src/protocol/plugin-manager-v1.xml文件中,<request name="request_shutdown"/>应该改为<request name="request_shutdown"><arg name="type" type="string"/></request>,因为request_shutdown函数的参数类型是const QString &

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, yixinshark

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yixinshark
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Dec 17, 2024

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 98ee7e2 into linuxdeepin:master Dec 17, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants