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
19 changes: 8 additions & 11 deletions src/dde-session/impl/sessionmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ SessionManager::SessionManager(QObject *parent)
// 处理异常退出的情况
handleOSSignal();

// 播放登录提示音
if (canPlayEvent("desktop-login")) {
playLoginSound();
}

auto appearanceConfig = DConfig::create("org.deepin.dde.appearance", "org.deepin.dde.appearance", QString(), this);
m_soundTheme = appearanceConfig->value("Sound_Theme", "deepin").toString();
connect(appearanceConfig, &DConfig::valueChanged, this, [this, appearanceConfig] (const QString &key) {
if (key == "Sound_Theme") {
m_soundTheme = appearanceConfig->value("Sound_Theme", "deepin").toString();
}
});

// 播放登录提示音
if (canPlayEvent("desktop-login")) {
playLoginSound();
}
}

SessionManager::~SessionManager()
Expand Down Expand Up @@ -704,13 +704,10 @@ bool SessionManager::canPlayEvent(const QString &event)
const QString methodInterface = "org.deepin.dde.SoundEffect1";

QDBusInterface dbusInterface(service, path, interface, QDBusConnection::sessionBus());
if (!dbusInterface.isValid()) {
return false;
}

QDBusReply<bool> enabledReply = dbusInterface.call("Get", service, "Enabled");
QDBusReply<QDBusVariant> enabledReply = dbusInterface.call("Get", service, "Enabled");
if (enabledReply.isValid()) {
if (!enabledReply.value()) {
QVariant result = enabledReply.value().variant();
if (!result.toBool()) {
return false;
}
} else {
Expand Down