Commit c5e4d4b8 authored by Karel Slaný's avatar Karel Slaný

Added Locker class stub.

parent 3c233026
......@@ -89,6 +89,7 @@ SOURCES += \
src/io/filesystem.cpp \
src/io/sqlite/db.cpp \
src/io/sqlite/table.cpp \
src/locker.cpp \
src/log/log.cpp \
src/main.cpp \
src/messages.cpp \
......@@ -118,6 +119,7 @@ HEADERS += \
src/io/filesystem.h \
src/io/sqlite/db.h \
src/io/sqlite/table.h \
src/locker.h \
src/log/log.h \
src/messages.h \
src/models/accountmodel.h \
......
/*
* Copyright (C) 2014-2017 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#include <QDebug>
#include "src/locker.h"
Locker::Locker(QObject *parent)
: QObject(parent)
{
}
void Locker::processNewState(Qt::ApplicationState state)
{
qDebug() << "New state" << state;
}
/*
* Copyright (C) 2014-2017 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#ifndef _LOCKER_H_
#define _LOCKER_H_
#include <QObject>
class Locker : public QObject {
Q_OBJECT
public:
Locker(QObject *parent = Q_NULLPTR);
public slots:
void processNewState(Qt::ApplicationState state);
signals:
void lockApp(void);
};
#endif /* _LOCKER_H_ */
......@@ -32,6 +32,7 @@
#include "src/accounts.h"
#include "src/common.h"
#include "src/files.h"
#include "src/locker.h"
#include "src/net/isds_wrapper.h"
#include "src/models/accountmodel.h"
#include "src/models/filemodel.h"
......@@ -241,6 +242,12 @@ int main(int argc, char *argv[])
/* show PIN screen if needed */
emit settings.showPinScreen(!globSet.pinCode.isEmpty());
/* Register application state changes. */
class Locker locker;
QObject::connect(&app,
SIGNAL(applicationStateChanged(Qt::ApplicationState)),
&locker, SLOT(processNewState(Qt::ApplicationState)));
/* Run app main event loop */
int ret = app.exec();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment