52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
/*
|
|
* Copyright (C) 2021 KylinSoft Co., Ltd.
|
|
*
|
|
* Authors:
|
|
* Ding Jing dingjing@kylinos.cn
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
* the Free Software Foundation; either version 2.1, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
|
|
#ifndef USBMANAGE_H
|
|
#define USBMANAGE_H
|
|
|
|
#include <gio/gio.h>
|
|
|
|
#include <QObject>
|
|
|
|
class UsbManage : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit UsbManage(QObject *parent = nullptr);
|
|
~UsbManage();
|
|
|
|
private:
|
|
static void volumeConnectedCallback(GVolumeMonitor *monitor, GVolume *drive, gpointer pThis);
|
|
|
|
static void volumeDisconnectedCallback(GVolumeMonitor *monitor, GVolume *drive, gpointer pThis);
|
|
|
|
Q_SIGNALS:
|
|
|
|
void sigVolumeConnected(QString);
|
|
|
|
void sigVolumeDisconnected(QString);
|
|
|
|
private:
|
|
GVolumeMonitor *mGvolumeMonitor = nullptr;
|
|
};
|
|
|
|
#endif // USBMANAGE_H
|