File indexing completed on 2024-05-12 04:01:51

0001 /*
0002     SPDX-FileCopyrightText: 2006-2007 Kevin Ottens <ervin@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include "opticaldrive.h"
0008 #include "opticaldrive_p.h"
0009 
0010 #include "soliddefs_p.h"
0011 #include <solid/devices/ifaces/opticaldrive.h>
0012 
0013 Solid::OpticalDrive::OpticalDrive(QObject *backendObject)
0014     : StorageDrive(*new OpticalDrivePrivate(), backendObject)
0015 {
0016     connect(backendObject, SIGNAL(ejectPressed(QString)), this, SIGNAL(ejectPressed(QString)));
0017     connect(backendObject, SIGNAL(ejectDone(Solid::ErrorType, QVariant, QString)), this, SIGNAL(ejectDone(Solid::ErrorType, QVariant, QString)));
0018     connect(backendObject, SIGNAL(ejectRequested(QString)), this, SIGNAL(ejectRequested(QString)));
0019 }
0020 
0021 Solid::OpticalDrive::~OpticalDrive()
0022 {
0023 }
0024 
0025 Solid::OpticalDrive::MediumTypes Solid::OpticalDrive::supportedMedia() const
0026 {
0027     Q_D(const OpticalDrive);
0028     return_SOLID_CALL(Ifaces::OpticalDrive *, d->backendObject(), MediumTypes(), supportedMedia());
0029 }
0030 
0031 int Solid::OpticalDrive::readSpeed() const
0032 {
0033     Q_D(const OpticalDrive);
0034     return_SOLID_CALL(Ifaces::OpticalDrive *, d->backendObject(), 0, readSpeed());
0035 }
0036 
0037 int Solid::OpticalDrive::writeSpeed() const
0038 {
0039     Q_D(const OpticalDrive);
0040     return_SOLID_CALL(Ifaces::OpticalDrive *, d->backendObject(), 0, writeSpeed());
0041 }
0042 
0043 QList<int> Solid::OpticalDrive::writeSpeeds() const
0044 {
0045     Q_D(const OpticalDrive);
0046     return_SOLID_CALL(Ifaces::OpticalDrive *, d->backendObject(), QList<int>(), writeSpeeds());
0047 }
0048 
0049 bool Solid::OpticalDrive::eject()
0050 {
0051     Q_D(OpticalDrive);
0052     return_SOLID_CALL(Ifaces::OpticalDrive *, d->backendObject(), false, eject());
0053 }
0054 
0055 #include "moc_opticaldrive.cpp"