Warning, file /system/kpmcore/src/core/devicescanner.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2010 Volker Lanz <vl@fidra.de>
0003     SPDX-FileCopyrightText: 2014-2016 Andrius Štikonas <andrius@stikonas.eu>
0004     SPDX-FileCopyrightText: 2015 Chris Campbell <c.j.campbell@ed.ac.uk>
0005     SPDX-FileCopyrightText: 2016 Chantara Tith <tith.chantara@gmail.com>
0006 
0007     SPDX-License-Identifier: GPL-3.0-or-later
0008 */
0009 
0010 #ifndef KPMCORE_DEVICESCANNER_H
0011 #define KPMCORE_DEVICESCANNER_H
0012 
0013 #include "util/libpartitionmanagerexport.h"
0014 
0015 #include <QThread>
0016 
0017 class OperationStack;
0018 
0019 /** Thread to scan for all available Devices on this computer.
0020 
0021     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.
0022 
0023     @author Volker Lanz <vl@fidra.de>
0024 */
0025 class LIBKPMCORE_EXPORT DeviceScanner : public QThread
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     DeviceScanner(QObject* parent, OperationStack& ostack);
0031 
0032 public:
0033     void clear(); /**< clear Devices and the OperationStack */
0034     void scan(); /**< do the actual scanning; blocks if called directly */
0035     void setupConnections();
0036 
0037 Q_SIGNALS:
0038     void progress(const QString& deviceNode, int progress);
0039 
0040 protected:
0041     void run() override;
0042     OperationStack& operationStack() {
0043         return m_OperationStack;
0044     }
0045     const OperationStack& operationStack() const {
0046         return m_OperationStack;
0047     }
0048 
0049 private:
0050     OperationStack& m_OperationStack;
0051 };
0052 
0053 #endif