Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make the device library shared.
  • Loading branch information
adenexter committed Sep 14, 2016
1 parent ca76bc3 commit 98082ca
Show file tree
Hide file tree
Showing 89 changed files with 209 additions and 1,699 deletions.
24 changes: 21 additions & 3 deletions rpm/nemo-qml-plugin-devicelock.spec
Expand Up @@ -23,18 +23,28 @@ Requires: nemo-devicelock-daemon
%package -n nemo-devicelock-daemon-cli
Summary: The default command line lock code device lock daemon for Nemo Mobile
Group: System/GUI/Other
Requires: %{name} = %{version}
Provides: nemo-devicelock-daemon

%description -n nemo-devicelock-daemon-cli
%{summary}.

%package devel
Summary: Development libraries for device lock QML plugins
Summary: Development libraries for device lock
Group: Development/Libraries
Requires: %{name} = %{version}

%description devel
%{summary}.

%package host-devel
Summary: Development libraries for device lock daemons
Group: Development/Libraries
Requires: %{name}-devel = %{version}

%description host-devel
%{summary}.

%prep
%setup -q -n %{name}-%{version}

Expand All @@ -48,6 +58,7 @@ rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_libdir}/libnemodevicelock.so.*
%dir %{_libdir}/qt5/qml/org/nemomobile/devicelock
%{_libdir}/qt5/qml/org/nemomobile/devicelock/libnemodevicelockplugin.so
%{_libdir}/qt5/qml/org/nemomobile/devicelock/qmldir
Expand All @@ -60,10 +71,17 @@ rm -rf %{buildroot}
%{_sysconfdir}/dbus-1/system.d/org.nemomobile.devicelock.conf

%files devel
%defattr(-,root,root,-)
%dir %{_includedir}/nemo-devicelock
%{_includedir}/nemo-devicelock/*.h
%{_includedir}/nemo-devicelock/private/*.h
%{_includedir}/nemo-devicelock/host/*.h
%{_libdir}/libnemodevicelock.a
%{_libdir}/libnemodevicelock-host.a
%{_libdir}/libnemodevicelock.so
%{_libdir}/pkgconfig/nemodevicelock.pc

%files host-devel
%defattr(-,root,root,-)
%dir %{_includedir}/nemo-devicelock/host
%{_includedir}/nemo-devicelock/host/*.h
%{_libdir}/libnemodevicelock-host.a
%{_libdir}/pkgconfig/nemodevicelock-host.pc
19 changes: 8 additions & 11 deletions src/daemon/daemon.pro
Expand Up @@ -13,23 +13,20 @@ PKGCONFIG += \
mlite5

INCLUDEPATH += \
$$PWD/../lib \
$$PWD/../lib/private \
$$PWD/../hostlib \
$$PWD/../hostlib/cli \
$$PWD/../hostlib/mce
$$PWD/../ \
$$PWD/../nemo-devicelock/host \
$$PWD/../nemo-devicelock/host/cli

DEPENDPATH += \
$$PWD/../lib \
$$PWD/../hostlib
$$PWD/../nemo-devicelock \
$$PWD/../nemo-devicelock/host

PRE_TARGETDEPS += \ \
$$PWD/../lib/libnemodevicelock.a
$$PWD/../lib/libnemodevicelock-host.a
$$PWD/../nemo-devicelock/host/libnemodevicelock-host.a

LIBS += \
-L$$OUT_PWD/../lib -lnemodevicelock\
-L$$OUT_PWD/../hostlib -lnemodevicelock-host
-L$$OUT_PWD/../nemo-devicelock -lnemodevicelock\
-L$$OUT_PWD/../nemo-devicelock/host -lnemodevicelock-host

SOURCES = \
main.cpp
Expand Down
File renamed without changes.
19 changes: 10 additions & 9 deletions src/lib/authenticator.h → src/nemo-devicelock/authenticator.h
Expand Up @@ -30,14 +30,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

#ifndef AUTHENTICATOR_H
#define AUTHENTICATOR_H
#ifndef NEMODEVICELOCK_AUTHENTICATOR_H
#define NEMODEVICELOCK_AUTHENTICATOR_H

#include <QDBusAbstractAdaptor>
#include <QDBusObjectPath>
#include <QSharedDataPointer>

#include <connection.h>
#include <nemo-devicelock/global.h>
#include <nemo-devicelock/private/connection.h>

namespace NemoDeviceLock {

Expand All @@ -59,7 +60,7 @@ public slots:
};

class SettingsWatcher;
class Authenticator : public QObject, private ConnectionClient
class NEMODEVICELOCK_EXPORT Authenticator : public QObject, private ConnectionClient
{
Q_OBJECT
Q_PROPERTY(Methods availableMethods READ availableMethods NOTIFY availableMethodsChanged)
Expand Down Expand Up @@ -129,12 +130,12 @@ class Authenticator : public QObject, private ConnectionClient
private:
friend class AuthenticatorAdaptor;

void connected();
void disconnected();
inline void connected();
inline void disconnected();

void handleAuthentication(const QVariant &authenticationToken);
void handleFeedback(Feedback feedback, int attemptsRemaining, Methods utilizedMethods);
void handleError(Error error);
inline void handleAuthentication(const QVariant &authenticationToken);
inline void handleFeedback(Feedback feedback, int attemptsRemaining, Methods utilizedMethods);
inline void handleError(Error error);

AuthenticatorAdaptor m_adaptor;
QExplicitlySharedDataPointer<SettingsWatcher> m_settings;
Expand Down
File renamed without changes.
Expand Up @@ -30,16 +30,16 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

#ifndef AUTHENTICATION_H
#define AUTHENTICATION_H
#ifndef NEMODEVICELOCK_AUTHENTICATION_H
#define NEMODEVICELOCK_AUTHENTICATION_H

#include <authenticator.h>
#include <nemo-devicelock/authenticator.h>

#include <QVariant>

namespace NemoDeviceLock {

class Authorization : public QObject
class NEMODEVICELOCK_EXPORT Authorization : public QObject
{
Q_OBJECT
Q_ENUMS(Status)
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions src/lib/devicelock.h → src/nemo-devicelock/devicelock.h
Expand Up @@ -13,15 +13,15 @@
**
****************************************************************************/

#ifndef DEVICELOCK_H
#define DEVICELOCK_H
#ifndef NEMODEVICELOCK_DEVICELOCK_H
#define NEMODEVICELOCK_DEVICELOCK_H

#include <clientauthorization.h>
#include <nemo-devicelock/private/clientauthorization.h>

namespace NemoDeviceLock
{

class DeviceLock : public QObject, private ConnectionClient
class NEMODEVICELOCK_EXPORT DeviceLock : public QObject, private ConnectionClient
{
Q_OBJECT
Q_ENUMS(LockState)
Expand Down Expand Up @@ -59,7 +59,7 @@ class DeviceLock : public QObject, private ConnectionClient
void unlockError();

private:
void connected();
inline void connected();

ClientAuthorization m_authorization;
ClientAuthorizationAdaptor m_authorizationAdaptor;
Expand Down
Expand Up @@ -143,6 +143,11 @@ bool DeviceLockSettings::currentCodeIsDigitOnly() const
return m_settings->currentCodeIsDigitOnly;
}

bool DeviceLockSettings::isHomeEncrypted() const
{
return m_settings->isHomeEncrypted;
}

void DeviceLockSettings::changeSetting(
const QVariant &authenticationToken, const QString &key, const QVariant &value)
{
Expand Down
Expand Up @@ -30,17 +30,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

#ifndef DEVICELOCKSETTINGS_H
#define DEVICELOCKSETTINGS_H
#ifndef NEMODEVICELOCK_DEVICELOCKSETTINGS_H
#define NEMODEVICELOCK_DEVICELOCKSETTINGS_H

#include <clientauthorization.h>
#include <nemo-devicelock/private/clientauthorization.h>

namespace NemoDeviceLock
{

class SettingsWatcher;

class DeviceLockSettings : public QObject, private ConnectionClient
class NEMODEVICELOCK_EXPORT DeviceLockSettings : public QObject, private ConnectionClient
{
Q_OBJECT
Q_PROPERTY(NemoDeviceLock::Authorization *authorization READ authorization CONSTANT)
Expand Down Expand Up @@ -95,7 +95,7 @@ class DeviceLockSettings : public QObject, private ConnectionClient
void changeSetting(const QVariant &authenticationToken, const QString &key, const QVariant &value);

private:
void connected();
inline void connected();

ClientAuthorization m_authorization;
ClientAuthorizationAdaptor m_authorizationAdaptor;
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions src/lib/devicereset.h → src/nemo-devicelock/devicereset.h
Expand Up @@ -30,15 +30,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

#ifndef DEVICERESET_H
#define DEVICERESET_H
#ifndef NEMODEVICELOCK_DEVICERESET_H
#define NEMODEVICELOCK_DEVICERESET_H

#include <clientauthorization.h>
#include <nemo-devicelock/private/clientauthorization.h>

namespace NemoDeviceLock
{

class DeviceReset : public QObject, private ConnectionClient
class NEMODEVICELOCK_EXPORT DeviceReset : public QObject, private ConnectionClient
{
Q_OBJECT
Q_PROPERTY(NemoDeviceLock::Authorization *authorization READ authorization CONSTANT)
Expand All @@ -61,7 +61,7 @@ class DeviceReset : public QObject, private ConnectionClient
void clearDeviceError();

private:
void connected();
inline void connected();

ClientAuthorization m_authorization;
ClientAuthorizationAdaptor m_authorizationAdaptor;
Expand Down
File renamed without changes.
Expand Up @@ -30,17 +30,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

#ifndef ENCRYPTIONSETTINGS_H
#define ENCRYPTIONSETTINGS_H
#ifndef NEMODEVICELOCK_ENCRYPTIONSETTINGS_H
#define NEMODEVICELOCK_ENCRYPTIONSETTINGS_H

#include <clientauthorization.h>
#include <nemo-devicelock/private/clientauthorization.h>

namespace NemoDeviceLock
{

class SettingsWatcher;

class EncryptionSettings : public QObject, private ConnectionClient
class NEMODEVICELOCK_EXPORT EncryptionSettings : public QObject, private ConnectionClient
{
Q_OBJECT
Q_PROPERTY(NemoDeviceLock::Authorization *authorization READ authorization CONSTANT)
Expand All @@ -60,7 +60,7 @@ class EncryptionSettings : public QObject, private ConnectionClient
void encryptHomeError();

private:
void connected();
inline void connected();

ClientAuthorization m_authorization;
ClientAuthorizationAdaptor m_authorizationAdaptor;
Expand Down
File renamed without changes.
Expand Up @@ -30,10 +30,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

#ifndef FINGERPRINTSETTINGS_H
#define FINGERPRINTSETTINGS_H
#ifndef NEMODEVICELOCK_FINGERPRINTSETTINGS_H
#define NEMODEVICELOCK_FINGERPRINTSETTINGS_H

#include <clientauthorization.h>
#include <nemo-devicelock/private/clientauthorization.h>

#include <QAbstractListModel>
#include <QDateTime>
Expand All @@ -53,7 +53,7 @@ struct Fingerprint
QDateTime acquisitionDate;
};

class FingerprintModel : public QAbstractListModel, private ConnectionClient
class NEMODEVICELOCK_EXPORT FingerprintModel : public QAbstractListModel, private ConnectionClient
{
Q_OBJECT
Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
Expand Down Expand Up @@ -82,7 +82,7 @@ class FingerprintModel : public QAbstractListModel, private ConnectionClient
void countChanged();

private:
void connected();
inline void connected();

ClientAuthorization m_authorization;
ClientAuthorizationAdaptor m_authorizationAdaptor;
Expand All @@ -108,15 +108,15 @@ public slots:
FingerprintSettings *m_settings;
};

class FingerprintSettings : public QObject, private ConnectionClient
class NEMODEVICELOCK_EXPORT FingerprintSettings : public QObject, private ConnectionClient
{
Q_OBJECT
Q_PROPERTY(int samplesRemaining READ samplesRemaining NOTIFY samplesRemainingChanged)
Q_PROPERTY(int samplesRequired READ samplesRequired NOTIFY samplesRequiredChanged)
Q_PROPERTY(bool hasSensor READ hasSensor NOTIFY hasSensorChanged)
Q_PROPERTY(bool acquiring READ isAcquiring NOTIFY acquiringChanged)
Q_PROPERTY(NemoDeviceLock::Authorization *authorization READ authorization CONSTANT)
Q_PROPERTY(FingerprintModel *fingers READ fingers CONSTANT)
Q_PROPERTY(NemoDeviceLock::FingerprintModel *fingers READ fingers CONSTANT)
Q_ENUMS(Feedback)
Q_ENUMS(Error)
public:
Expand Down Expand Up @@ -165,12 +165,12 @@ class FingerprintSettings : public QObject, private ConnectionClient
private:
friend class FingerprintSettingsAdaptor;

void connected();
inline void connected();

void handleSampleAcquired(int samplesRemaining);
void handleAcquisitionCompleted();
void handleError(Error error);
void handleCanceled();
inline void handleSampleAcquired(int samplesRemaining);
inline void handleAcquisitionCompleted();
inline void handleError(Error error);
inline void handleCanceled();

ClientAuthorization m_authorization;
ClientAuthorizationAdaptor m_authorizationAdaptor;
Expand All @@ -186,7 +186,7 @@ class FingerprintSettings : public QObject, private ConnectionClient
Q_DECLARE_METATYPE(NemoDeviceLock::Fingerprint)
Q_DECLARE_METATYPE(QVector<NemoDeviceLock::Fingerprint>)

QDBusArgument &operator<<(QDBusArgument &argument, const NemoDeviceLock::Fingerprint &fingerprint);
const QDBusArgument &operator>>(const QDBusArgument &argument, NemoDeviceLock::Fingerprint &fingerprint);
NEMODEVICELOCK_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const NemoDeviceLock::Fingerprint &fingerprint);
NEMODEVICELOCK_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, NemoDeviceLock::Fingerprint &fingerprint);

#endif

0 comments on commit 98082ca

Please sign in to comment.