Solid

fakenetworkshare.cpp
1/*
2 SPDX-FileCopyrightText: 2011 Mario Bensi <mbensi@ipsquad.net>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "fakenetworkshare.h"
8#include <QVariant>
9
10using namespace Solid::Backends::Fake;
11
12FakeNetworkShare::FakeNetworkShare(FakeDevice *device)
13 : FakeDeviceInterface(device)
14{
15}
16
17FakeNetworkShare::~FakeNetworkShare()
18{
19}
20
21Solid::NetworkShare::ShareType FakeNetworkShare::type() const
22{
23 QString type = fakeDevice()->property(QStringLiteral("type")).toString();
24 if (type == QLatin1String("nfs")) {
25 return Solid::NetworkShare::Nfs;
26 } else if (type == QLatin1String("cifs")) {
27 return Solid::NetworkShare::Cifs;
28 } else if (type == QLatin1String("smb3")) {
29 return Solid::NetworkShare::Smb3;
30 } else {
31 return Solid::NetworkShare::Unknown;
32 }
33}
34
35QUrl FakeNetworkShare::url() const
36{
37 QString url = fakeDevice()->property(QStringLiteral("url")).toString();
38 return QUrl(url);
39}
40
41#include "moc_fakenetworkshare.cpp"
ShareType
This enum type defines the type of networkShare device can be.
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.