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