forked from quickshell/quickshell
		
	bluetooth: do not try to enable rfkilled devices
Bluez will not do this and reports a property change failure.
This commit is contained in:
		
							parent
							
								
									91c9db581e
								
							
						
					
					
						commit
						1644ed5e19
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -53,6 +53,12 @@ QString BluetoothAdapter::adapterId() const {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void BluetoothAdapter::setEnabled(bool enabled) {
 | 
					void BluetoothAdapter::setEnabled(bool enabled) {
 | 
				
			||||||
	if (enabled == this->bEnabled) return;
 | 
						if (enabled == this->bEnabled) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (enabled && this->bState == BluetoothAdapterState::Blocked) {
 | 
				
			||||||
 | 
							qCCritical(logAdapter) << "Cannot enable adapter because it is blocked by rfkill.";
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this->bEnabled = enabled;
 | 
						this->bEnabled = enabled;
 | 
				
			||||||
	this->pEnabled.write();
 | 
						this->pEnabled.write();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue