Skip to content

Commit

Permalink
Remove subsystem from monitors if it's empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Oct 3, 2024
1 parent 08440df commit 3db8a72
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions shared/liboxide/udev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,14 @@ namespace Oxide {
}
void UDev::removeMonitor(QString subsystem, QString deviceType){
O_DEBUG("UDev::Removing" << subsystem << deviceType);
if(monitors.contains(subsystem)){
monitors[subsystem].removeAll(deviceType);
update = true;
if(!monitors.contains(subsystem)){
return;
}
monitors[subsystem].removeAll(deviceType);
if(monitors[subsystem].isEmpty()){
monitors.remove(subsystem);
}
update = true;
}

QList<UDev::Device> UDev::getDeviceList(const QString& subsystem){
Expand Down

0 comments on commit 3db8a72

Please sign in to comment.