Solid::NetworkShare Class

class Solid::NetworkShare

This device interface is available for network share volumes. More...

Header: #include <Solid/NetworkShare>
CMake: find_package(KF6 REQUIRED COMPONENTS Solid)
target_link_libraries(mytarget PRIVATE KF6::Solid)
Inherits: Solid::DeviceInterface

Public Types

enum ShareType { Unknown, Nfs, Cifs, Smb3 }

Properties

Public Functions

Solid::NetworkShare::ShareType type() const
QUrl url() const

Static Public Members

Solid::DeviceInterface::Type deviceInterfaceType()

Detailed Description

Used to acquire a list of network device types.

 const auto devices = Solid::Device::listFromType(Solid::DeviceInterface::NetworkShare);
 for (const auto &device : devices) {
     switch (device.as<Solid::NetworkShare>()->type()) {
     case Solid::NetworkShare::Cifs:
         hasCifsShare = true;
         continue;
     case Solid::NetworkShare::Smb3:
         hasSmb3Share = true;
         continue;
     case Solid::NetworkShare::Nfs:
         hasNfsShare = true;
         continue;
     default:
         continue;
     }
 }

Member Type Documentation

enum NetworkShare::ShareType

This enum type defines the type of networkShare device can be.

ConstantValueDescription
Solid::NetworkShare::Unknown0An unsupported network protocol
Solid::NetworkShare::Nfs1NFS protocol
Solid::NetworkShare::Cifs2Samba protocol
Solid::NetworkShare::Smb33Samba protocol (version 3)

Property Documentation

[read-only] type : ShareType

Access functions:

Solid::NetworkShare::ShareType type() const

[read-only] url : QUrl

Access functions:

QUrl url() const

Member Function Documentation

[static] Solid::DeviceInterface::Type NetworkShare::deviceInterfaceType()

Returns the Solid::DeviceInterface::Type of the NetworkShare device interface.

See also Solid::DeviceInterface::Type.

Solid::NetworkShare::ShareType NetworkShare::type() const

Returns the type of network share.

Note: Getter function for property type.

QUrl NetworkShare::url() const

Returns the url of network share.

Note: Getter function for property url.