Skip to content

Commit

Permalink
Fix thread logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Jan 16, 2024
1 parent 98dbe2f commit 45747b3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion applications/system-service/keyboarddevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ KeyboardDevice::KeyboardDevice(QThread* handler, event_device device)
device(device),
sys("/sys/class/input/" + devName() + "/device/")
{
moveToThread(handler);
_name = sys.strProperty("name").c_str();
device.lock();
notifier = new QSocketNotifier(device.fd, QSocketNotifier::Read, this);
Expand Down
4 changes: 1 addition & 3 deletions applications/system-service/keyboardhandler.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include "keyboardhandler.h"
#include "eventlistener.h"
#include "buttonhandler.h"

#include <QFileInfo>
#include <QKeyEvent>
Expand All @@ -12,6 +10,7 @@ KeyboardHandler* KeyboardHandler::init(){
return instance;
}
instance = new KeyboardHandler();
instance->moveToThread(instance);
instance->start();
return instance;
}
Expand Down Expand Up @@ -662,7 +661,6 @@ void KeyboardHandler::reloadDevices(){
}
if(!hasDevice(device) && device.fd != -1){
auto keyboard = new KeyboardDevice(this, device);
keyboard->moveToThread(this);
O_DEBUG(keyboard->name() << "added");
devices.append(keyboard);
keyboard->readEvents();
Expand Down

0 comments on commit 45747b3

Please sign in to comment.