File indexing completed on 2022-11-23 12:18:32

0001 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0002 // SPDX-FileCopyrightText: 2021 Harald Sitter <sitter@kde.org>
0003 
0004 #include "simulationdevicenotifier.h"
0005 
0006 #include <QDir>
0007 #include <QDirIterator>
0008 
0009 #include "device.h"
0010 
0011 void SimulationDeviceNotifier::start()
0012 {
0013     loadData();
0014 }
0015 void SimulationDeviceNotifier::loadData()
0016 {
0017     QDirIterator it(QStringLiteral(":/plasma-disks/fixtures/"), {QStringLiteral("*.json")});
0018     while (it.hasNext()) {
0019         it.next();
0020         const auto info = it.fileInfo();
0021         Q_EMIT addDevice(new Device(info.fileName(), info.fileName(), info.absoluteFilePath()));
0022     }
0023 }