File indexing completed on 2024-09-15 04:48:48
0001 /* 0002 * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com> 0003 * SPDX-FileCopyrightText: 2021 Nate Graham <nate@kde.org> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #pragma once 0009 0010 #include <QObject> 0011 0012 #include <KSharedConfig> 0013 0014 #include <BluezQt/Types> 0015 0016 class KFilePlacesModel; 0017 0018 class BlueDevilDaemon; 0019 0020 class DeviceMonitor : public QObject 0021 { 0022 Q_OBJECT 0023 0024 public: 0025 explicit DeviceMonitor(BlueDevilDaemon *daemon); 0026 0027 void saveState(); 0028 0029 private Q_SLOTS: 0030 void bluetoothOperationalChanged(bool operational); 0031 void adapterAdded(BluezQt::AdapterPtr adapter); 0032 void deviceAdded(BluezQt::DevicePtr device); 0033 0034 void deviceConnectedChanged(bool connected); 0035 void login1PrepareForSleep(bool active); 0036 0037 private: 0038 void restoreState(); 0039 void restoreAdapter(BluezQt::AdapterPtr adapter); 0040 0041 void clearPlaces(); 0042 void updateDevicePlace(BluezQt::DevicePtr device); 0043 0044 KFilePlacesModel *places(); 0045 0046 BluezQt::Manager *m_manager; 0047 bool m_isParentValid; 0048 KFilePlacesModel *m_places = nullptr; 0049 KSharedConfig::Ptr m_config; 0050 };