Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Oct 3, 2024
1 parent 757622b commit 98b58d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions applications/system-service/powerapi.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "powerapi.h"

#include <liboxide/udev.h>

PowerAPI* PowerAPI::singleton(PowerAPI* self){
static PowerAPI* instance;
if(self != nullptr){
Expand All @@ -23,8 +25,8 @@ PowerAPI::PowerAPI(QObject* parent)
});
Oxide::Sentry::sentry_span(t, "monitor", "Setup monitor", [this]{
if(deviceSettings.getDeviceType() == Oxide::DeviceSettings::RM1){
UDev::singleton()->addMonitor("platform", NULL);
UDev::singleton()->subsystem("power_supply", [this]{
Oxide::UDev::singleton()->addMonitor("platform", NULL);
Oxide::UDev::singleton()->subsystem("power_supply", [this]{
update();
});
}else{
Expand All @@ -46,19 +48,19 @@ PowerAPI::~PowerAPI(){
delete timer;
}else{
qDebug() << "Killing UDev monitor";
UDev::singleton()->stop();
Oxide::UDev::singleton()->stop();
}
}

void PowerAPI::setEnabled(bool enabled) {
if(enabled){
if(deviceSettings.getDeviceType() == Oxide::DeviceSettings::RM1){
UDev::singleton()->start();
Oxide::UDev::singleton()->start();
}else{
timer->start();
}
}else if(deviceSettings.getDeviceType() == Oxide::DeviceSettings::RM1){
UDev::singleton()->stop();
Oxide::UDev::singleton()->stop();
}else{
timer->stop();
}
Expand Down
1 change: 0 additions & 1 deletion applications/system-service/powerapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define BATTERYAPI_H

#include <liboxide.h>
#include <liboxide/udev.h>

#include <QObject>
#include <QDebug>
Expand Down

0 comments on commit 98b58d1

Please sign in to comment.