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 QString method = m_device->property(QStringLiteral("GPHOTO2_DRIVER")).toString();
23
24 if (!method.isEmpty()) {
25 return {method.toLower()};
26 }
27
28 return {};
29}
30
31QStringList Camera::supportedDrivers(QString /*protocol*/) const
32{
33 if (!supportedProtocols().isEmpty()) {
34 return {QStringLiteral("gphoto")};
35 }
36
37 return {};
38}
39
40QVariant Camera::driverHandle(const QString &driver) const
41{
42 if (driver == QLatin1String("gphoto") && m_device->property(QStringLiteral("SUBSYSTEM")).toString() == QLatin1String("usb")) {
43 return QVariantList{
44 QStringLiteral("usb"),
45 m_device->property(QStringLiteral("ID_VENDOR_ID")),
46 m_device->property(QStringLiteral("ID_MODEL_ID")),
47 };
48 }
49
50 return {};
51}
52
53#include "moc_udevcamera.cpp"
char * toString(const EngineQuery &query)
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 Sat Dec 21 2024 17:03:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.