Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/lightdm-deepin-greeter/greeterworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,11 @@ void GreeterWorker::prepareShutdownSound()
{
QDBusInterface soundPlayerInter("org.deepin.dde.SoundThemePlayer1", "/org/deepin/dde/SoundThemePlayer1",
"org.deepin.dde.SoundThemePlayer1", QDBusConnection::systemBus());
soundPlayerInter.call("PrepareShutdownSound", static_cast<int>(m_model->currentUser()->uid()));
if (!soundPlayerInter.isValid() || !m_model->currentUser()) {
qCWarning(DDE_SHELL) << "Sound player interface is not valid or current user is null:" << soundPlayerInter.isValid();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Improve warning log to distinguish invalid interface vs null user

Log both conditions separately, for example include both soundPlayerInter.isValid() and whether m_model->currentUser() is null in the warning.

Suggested change
qCWarning(DDE_SHELL) << "Sound player interface is not valid or current user is null:" << soundPlayerInter.isValid();
qCWarning(DDE_SHELL) << "Cannot prepare shutdown sound, interface valid? " << soundPlayerInter.isValid()
<< ", current user null? " << (m_model->currentUser() == nullptr);

return;
}

//soundPlayerInter.call("PrepareShutdownSound", static_cast<int>(m_model->currentUser()->uid()));
}
#endif
Loading