Add a bit of documentation about device scanner.
This commit is contained in:
parent
37d3639bfe
commit
f19c6b39f6
26
README.md
26
README.md
|
@ -70,3 +70,29 @@ back to a default backend suitable for the current platform.
|
||||||
|
|
||||||
Calling KPMcore functions before the library is initialized will
|
Calling KPMcore functions before the library is initialized will
|
||||||
result in undefined behavior.
|
result in undefined behavior.
|
||||||
|
|
||||||
|
### Devices [FIXME: WIP]
|
||||||
|
|
||||||
|
After the backend is initialized you can scan for available devices.
|
||||||
|
If you want only devices from the loaded backend you can call
|
||||||
|
|
||||||
|
```
|
||||||
|
QList<Device*> devices = backend->scanDevices( excludeReadOnly );
|
||||||
|
```
|
||||||
|
|
||||||
|
where bool option `excludeReadOnly` specified whether to exclude
|
||||||
|
read only devices.
|
||||||
|
|
||||||
|
#### KPMcore device scanner
|
||||||
|
|
||||||
|
Alternatively, you can use KPMcore device scanner which also finds
|
||||||
|
LVM Volume Groups.
|
||||||
|
|
||||||
|
```
|
||||||
|
DeviceScanner *deviceScanner = new DeviceScanner(this, operationStack()))
|
||||||
|
deviceScanner->start();
|
||||||
|
```
|
||||||
|
|
||||||
|
The `deviceScanner` scans for the devices in a background thread. After
|
||||||
|
scanning is complete `DeviceScanner::finished()` signal will be emitted.
|
||||||
|
Then the devices can accessed using `operationStack().previewDevices()`.
|
||||||
|
|
Loading…
Reference in New Issue