kpmcore/src/core/devicescanner.h

62 lines
2.2 KiB
C
Raw Permalink Normal View History

/*************************************************************************
* Copyright (C) 2010 by Volker Lanz <vl@fidra.de> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 3 of *
* the License, 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 KPMCORE_DEVICESCANNER_H
#define KPMCORE_DEVICESCANNER_H
2016-05-06 22:36:24 +01:00
#include "util/libpartitionmanagerexport.h"
#include <QThread>
class OperationStack;
/** Thread to scan for all available Devices on this computer.
2015-07-13 15:16:36 +01:00
This class is used to find all Devices on the computer and to create new Device instances for each of them. It's subclassing QThread to run asynchronously.
2015-07-13 15:16:36 +01:00
@author Volker Lanz <vl@fidra.de>
*/
class LIBKPMCORE_EXPORT DeviceScanner : public QThread
{
2015-07-13 15:16:36 +01:00
Q_OBJECT
public:
DeviceScanner(QObject* parent, OperationStack& ostack);
public:
void clear(); /**< clear Devices and the OperationStack */
void scan(); /**< do the actual scanning; blocks if called directly */
void setupConnections();
Q_SIGNALS:
void progress(const QString& deviceNode, int progress);
2015-07-13 15:16:36 +01:00
protected:
2016-05-17 18:01:31 +01:00
void run() override;
2015-07-13 15:16:36 +01:00
OperationStack& operationStack() {
return m_OperationStack;
}
const OperationStack& operationStack() const {
return m_OperationStack;
}
private:
OperationStack& m_OperationStack;
};
#endif