Merge pull request !54 from 杨敏/openkylin/nile
This commit is contained in:
杨敏 2023-12-13 11:34:31 +00:00 committed by Gitee
commit 6510f9054e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 19 additions and 24 deletions

View File

@ -31,6 +31,7 @@
#include <QProcess> #include <QProcess>
#include <QStandardPaths> #include <QStandardPaths>
#include <QString> #include <QString>
#include "global_utils.h"
SwitchUserUtils::SwitchUserUtils() SwitchUserUtils::SwitchUserUtils()
{ {
@ -279,32 +280,26 @@ int SwitchUserUtils::SwitchToUserSession(QString seatPath, UserDisplayIfInfo &to
} }
return 0; return 0;
} else if (!toUDII.strUserName.isEmpty()) { } else if (!toUDII.strUserName.isEmpty()) {
// if (GreeterService::instance()->isServiceActivatable()) { if (!isGreeterMode()) {
// GreeterService::instance()->SwitchToGreeterUser(toUDII.strUserName); QDBusMessage result = ifaceDM.call("SwitchToUser", toUDII.strUserName, toUDII.strSessionPath);
// QDBusMessage result = ifaceDM.call("SwitchToGreeter"); if(result.type() == QDBusMessage::ErrorMessage) {
// if(result.type() == QDBusMessage::ErrorMessage) { qWarning() << "SwitchUser SwitchToUser failed:" << result.errorMessage();
// qWarning() << "SwitchUser SwitchToGreeter failed:" << result.errorMessage(); return 2;
// return -2; }
// } } else {
// return 2; return 4;
// } else { }
// QDBusMessage result = ifaceDM.call("SwitchToUser", toUDII.strUserName, toUDII.strSessionPath); } else {
// if(result.type() == QDBusMessage::ErrorMessage) { if (!isGreeterMode()) {
// qWarning() << "SwitchUser SwitchToUser failed:" << result.errorMessage(); QDBusMessage result = ifaceDM.call("SwitchToGreeter");
// return -2; if(result.type() == QDBusMessage::ErrorMessage) {
// } qWarning() << "SwitchUser SwitchToGreeter failed:" << result.errorMessage();
// return 1; return 2;
// } }
return 4;
} else { } else {
// QDBusMessage result = ifaceDM.call("SwitchToGreeter");
// if(result.type() == QDBusMessage::ErrorMessage) {
// qWarning() << "SwitchUser SwitchToGreeter failed:" << result.errorMessage();
// return -2;
// }
// return 2;
return 5; return 5;
} }
}
return 0; return 0;
} }