Skip to content

Commit

Permalink
Fix LiriLocalDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
plfiorini committed Dec 3, 2023
1 parent 0ba9dbd commit 7fdecfd
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 124 deletions.
59 changes: 0 additions & 59 deletions src/imports/device/plugin.cpp

This file was deleted.

59 changes: 0 additions & 59 deletions src/imports/device/plugins.qmltypes

This file was deleted.

4 changes: 0 additions & 4 deletions src/imports/device/qmldir

This file was deleted.

3 changes: 2 additions & 1 deletion src/localdevice/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ liri_add_module(LocalDevice
PUBLIC_LIBRARIES
Qt6::Core
Qt6::DBus
Qt6::QmlIntegration
Qt6::Qml
PKGCONFIG_DEPENDENCIES
Qt6Core
Qt6DBus
Qt6Qml
)

liri_finalize_module(LocalDevice)
8 changes: 8 additions & 0 deletions src/localdevice/localdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,4 +560,12 @@ void LocalDevice::hybridSleep()
d->upower->hybridSleep();
}

LocalDevice *LocalDevice::create(QQmlEngine *engine, QJSEngine *jsEngine)
{
Q_UNUSED(engine);
Q_UNUSED(jsEngine);

return new LocalDevice();
}

} // namespace Liri
5 changes: 4 additions & 1 deletion src/localdevice/localdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include <QObject>
#include <QtQmlIntegration>
#include <QQmlEngine>

#include <LiriLocalDevice/OsRelease>

Expand Down Expand Up @@ -34,6 +34,7 @@ class LIRILOCALDEVICE_EXPORT LocalDevice : public QObject
Q_PROPERTY(bool canHybridSleep READ canHybridSleep NOTIFY canHybridSleepdChanged)
Q_PROPERTY(OsRelease *osRelease READ osRelease CONSTANT)
QML_ELEMENT
QML_SINGLETON
public:
enum Chassis {
UnknownChassis = 0,
Expand Down Expand Up @@ -80,6 +81,8 @@ class LIRILOCALDEVICE_EXPORT LocalDevice : public QObject
bool canHibernate() const;
bool canHybridSleep() const;

static LocalDevice *create(QQmlEngine *engine, QJSEngine *jsEngine);

Q_SIGNALS:
void powerSourceChanged();
void lidPresentChanged();
Expand Down
1 change: 1 addition & 0 deletions src/localdevice/osrelease.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class LIRILOCALDEVICE_EXPORT OsRelease : public QObject
Q_PROPERTY(QString variantId READ variantId NOTIFY variantIdChanged)
Q_PROPERTY(QString logoIconName READ logoIconName NOTIFY logoIconNameChanged)
QML_ELEMENT
QML_UNCREATABLE("Cannot create OsRelease")
public:
explicit OsRelease(QObject *parent = nullptr);
~OsRelease();
Expand Down

0 comments on commit 7fdecfd

Please sign in to comment.