Skip to content

Commit a715465

Browse files
committed
fix: startdde gsettings is gone
Log:
1 parent 5c730bd commit a715465

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

Diff for: src/dde-session/impl/sessionmanager.cpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ void SessionManager::RequestHibernate()
411411
qWarning() << "failed to hibernate, error: " << reply.error().name();
412412
}
413413

414-
if (Utils::SettingValue("com.deepin.dde.startdde", QByteArray(), "quick-black-screen", false).toBool()) {
414+
// NOTE: do we need it anymore?
415+
if (Dconf::SetValue("com.deepin.dde.startdde", "", "quick-black-screen", false)) {
415416
setDPMSMode(false);
416417
}
417418
}
@@ -453,7 +454,7 @@ void SessionManager::RequestSuspend()
453454
}
454455

455456
// 使用窗管接口进行黑屏处理
456-
if (Utils::SettingValue("com.deepin.dde.startdde", QByteArray(), "quick-black-screen", false).toBool()) {
457+
if (Dconf::SetValue("com.deepin.dde.startdde", "", "quick-black-screen", QVariant(false))) {
457458
QDBusInterface inter("org.kde.KWin", "/BlackScreen", "org.kde.kwin.BlackScreen", QDBusConnection::sessionBus(), this);
458459
const QDBusMessage &msg = inter.call("setActive", true);
459460
if (!msg.errorName().isEmpty())
@@ -814,7 +815,8 @@ void SessionManager::shutdown(bool force)
814815
qWarning() << "failed to power off, error: " << reply.error().name();
815816
}
816817

817-
if (Utils::SettingValue("com.deepin.dde.startdde", QByteArray(), "quick-black-screen", false).toBool()) {
818+
//NOTE: do we need it anymore?
819+
if (Dconf::SetValue("com.deepin.dde.startdde", "", "quick-black-screen", false)) {
818820
setDPMSMode(false);
819821
}
820822

@@ -831,15 +833,11 @@ void SessionManager::reboot(bool force)
831833
qWarning() << "failed to reboot, error: " << reply.error().name();
832834
}
833835

834-
if (Utils::SettingValue("com.deepin.dde.startdde", QByteArray(), "quick-black-screen", false).toBool()) {
836+
// NOTE: do we need it anymore?
837+
if (Dconf::SetValue("com.deepin.dde.startdde", "", "quick-black-screen", QVariant(false))) {
835838
setDPMSMode(false);
836839
}
837840

838-
QDBusPendingReply<> reply2 = m_login1SessionInter->Terminate();
839-
if (reply2.isError()) {
840-
qWarning() << "self session failed to terminate, error: " << reply2.error().name();
841-
}
842-
843841
qApp->quit();
844842
}
845843

Diff for: src/utils/dconf.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Dconf::~Dconf()
1919

2020
DConfig *Dconf::connectDconf(const QString &name, const QString &subpath, QObject *parent)
2121
{
22-
DConfig *config = DConfig::create("dde-session", name, subpath, parent);
22+
// TODO: move it to dde-session
23+
DConfig *config = DConfig::create("dde-application-manager", name, subpath, parent);
2324
if (config == nullptr) {
2425
qDebug() << "Cannot find dconfigs, name:" << name;
2526
return nullptr;
@@ -58,4 +59,4 @@ bool Dconf::SetValue(const QString &name, const QString &subPath, const QString
5859
qDebug() << "Cannot find dconfigs, name:" << name
5960
<< " subPath:" << subPath << " key:" << key;
6061
return false;
61-
}
62+
}

0 commit comments

Comments
 (0)