Skip to content

Commit

Permalink
feat: move auto-exit settings to gsettings
Browse files Browse the repository at this point in the history
Change-Id: I059a92eb916192a86d312e48cb23551b283089d6
  • Loading branch information
sbwtw committed Apr 9, 2018
1 parent 16311a5 commit c11c1da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
4 changes: 0 additions & 4 deletions config.pri
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ isEqual(DCC_DISABLE_GRUB, YES){
DEFINES+=DCC_DISABLE_GRUB
}

isEqual(DCC_AUTO_EXIT, YES) {
DEFINES += DCC_AUTO_EXIT
}

isEqual(DCC_DISABLE_KBLAYOUT, YES){
DEFINES+=DCC_DISABLE_KBLAYOUT
}
Expand Down
19 changes: 10 additions & 9 deletions frame/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <QApplication>
#include <QKeyEvent>
#include <QScreen>
#include <QGSettings>

Frame::Frame(QWidget *parent)
: DBlurEffectWidget(parent),
Expand Down Expand Up @@ -197,13 +198,14 @@ void Frame::prepareAllSettingsPage()

void Frame::onDelayKillerTimeout()
{
#ifdef DCC_AUTO_EXIT
if (isVisible())
return m_delayKillerTimer->start();
qWarning() << "Killer Timeout, now quiiting...";
qApp->quit();
#else

const QGSettings gsettings("com.deepin.dde.control-center", "/com/deepin/dde/control-center/");
if (gsettings.keys().contains("auto-exit") && gsettings.get("auto-exit").toBool())
{
if (isVisible())
return m_delayKillerTimer->start();
qWarning() << "Killer Timeout, now quiiting...";
qApp->quit();
} else {
#ifndef DCC_KEEP_SETTINGS_LIVE
Q_ASSERT(!m_allSettingsPage.isNull());

Expand All @@ -213,8 +215,7 @@ void Frame::onDelayKillerTimeout()

m_allSettingsPage->deleteLater();
#endif // DCC_KEEP_SETTINGS_LIVE

#endif // DCC_AUTO_EXIT
}
}

void Frame::showAllSettings()
Expand Down

0 comments on commit c11c1da

Please sign in to comment.