Solid

udevcamera.cpp
1/*
2 SPDX-FileCopyrightText: 2010 Kevin Ottens <ervin@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "udevcamera.h"
8
9using namespace Solid::Backends::UDev;
10
11Camera::Camera(UDevDevice *device)
12 : DeviceInterface(device)
13{
14}
15
16Camera::~Camera()
17{
18}
19
20QStringList Camera::supportedProtocols() const
21{
22 QStringList protocols;
23
24 QString method = m_device->property("GPHOTO2_DRIVER").toString();
25
26 if (!method.isEmpty()) {
27 protocols << method.toLower();
28 }
29
30 return protocols;
31}
32
33QStringList Camera::supportedDrivers(QString /*protocol*/) const
34{
35 QStringList res;
36
37 if (!supportedProtocols().isEmpty()) {
38 res << "gphoto";
39 }
40
41 return res;
42}
43
44QVariant Camera::driverHandle(const QString &driver) const
45{
46 if (driver == "gphoto" && m_device->property("SUBSYSTEM").toString() == "usb") {
47 QVariantList list;
48
49 list << "usb" << m_device->property("ID_VENDOR_ID") << m_device->property("ID_MODEL_ID");
50
51 return list;
52 }
53
54 return QVariant();
55}
56
57#include "moc_udevcamera.cpp"
KIOCORE_EXPORT QStringList list(const QString &fileClass)
bool isEmpty() const const
QString toLower() const const
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:47:59 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.