From 77cd96038f9ba86e48e9aa43222903887517d7a9 Mon Sep 17 00:00:00 2001 From: peijiankang Date: Fri, 30 Jun 2023 17:41:11 +0800 Subject: [PATCH] fix userinfo error in sidebar --- .../ukui-quick-operation-panel/accountinformation.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/ukui-quick-operation-panel/accountinformation.cpp b/src/plugins/ukui-quick-operation-panel/accountinformation.cpp index 6adfa5f..778b5e7 100644 --- a/src/plugins/ukui-quick-operation-panel/accountinformation.cpp +++ b/src/plugins/ukui-quick-operation-panel/accountinformation.cpp @@ -71,8 +71,15 @@ QStringList AccountInformation::getUserObjectPath() QStringList users; QDBusReply > reply = m_pSystemUserIface->call("ListCachedUsers"); if (reply.isValid()) { - for (QDBusObjectPath op : reply.value()) + bool currentflag = false; + QString currentpath = "/org/freedesktop/Accounts/User" + QString::number(getuid()); + for (QDBusObjectPath op : reply.value()){ users << op.path(); + if(!op.path().compare(currentpath, Qt::CaseSensitive)) + currentflag=true; + } + if(!currentflag) + users << currentpath; } return users; } -- 2.33.0