Cherry-picking upstream version 0.9.0+20150911.
This commit is contained in:
parent
b0cd9cf7a8
commit
96fe9b9a42
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,11 +1,11 @@
|
||||
liblxqt (0.9.0+20150901-1) unstable; urgency=medium
|
||||
liblxqt (0.9.0+20150911-1) unstable; urgency=medium
|
||||
|
||||
* Cherry-picked upstream version 0.9.0+20150911.
|
||||
* Fixed copyright, only LGPL2.1+ is used
|
||||
* Cherry-picking upstream version 0.9.0-20150901
|
||||
* Fixed Symbols
|
||||
* Fixed license
|
||||
|
||||
-- Alf Gaida <agaida@siduction.org> Wed, 09 Sep 2015 20:06:10 +0200
|
||||
-- Alf Gaida <agaida@siduction.org> Fri, 11 Sep 2015 23:01:56 +0200
|
||||
|
||||
liblxqt (0.9.0+20150806-3) unstable; urgency=medium
|
||||
|
||||
|
@ -34,8 +34,10 @@
|
||||
using namespace LXQt;
|
||||
|
||||
Power::Power(QObject *parent) :
|
||||
QObject(parent)
|
||||
QObject(parent),
|
||||
mScreenSaver(this)
|
||||
{
|
||||
connect(&mScreenSaver, SIGNAL(done()), &mLoop, SLOT(quit()));
|
||||
mProviders.append(new CustomProvider(this));
|
||||
mProviders.append(new SystemdProvider(this));
|
||||
mProviders.append(new UPowerProvider(this));
|
||||
@ -66,11 +68,18 @@ bool Power::doAction(Power::Action action)
|
||||
{
|
||||
foreach(PowerProvider* provider, mProviders)
|
||||
{
|
||||
if (provider->canAction(action) &&
|
||||
provider->doAction(action)
|
||||
)
|
||||
if (provider->canAction(action))
|
||||
{
|
||||
return true;
|
||||
if (action == PowerSuspend || action == PowerHibernate)
|
||||
{
|
||||
mScreenSaver.lockScreen();
|
||||
mLoop.exec();
|
||||
}
|
||||
if (provider->doAction(action))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -31,6 +31,8 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
#include <QEventLoop>
|
||||
#include "lxqtscreensaver.h"
|
||||
#include "lxqtglobals.h"
|
||||
|
||||
namespace LXQt
|
||||
@ -101,6 +103,8 @@ public slots:
|
||||
|
||||
private:
|
||||
QList<PowerProvider*> mProviders;
|
||||
LXQt::ScreenSaver mScreenSaver;
|
||||
QEventLoop mLoop;
|
||||
};
|
||||
|
||||
} // namespace LXQt
|
||||
|
Loading…
x
Reference in New Issue
Block a user