KSambaShare Class

This class lists Samba user shares and monitors them for addition, update and removal. More...

Header: #include <KSambaShare>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KF6::KIOCore)
Inherits: QObject

Public Functions

(since 5.74) bool areGuestsAllowed() const
KSambaShareData getShareByName(const QString &name) const
QList<KSambaShareData> getSharesByPath(const QString &path) const
bool isDirectoryShared(const QString &path) const
bool isShareNameAvailable(const QString &name) const
(since 5.74) QString lastSystemErrorString() const
QStringList shareNames() const
QStringList sharedDirectories() const

Signals

void changed()

Static Public Members

KSambaShare *instance()

Detailed Description

Singleton class, call instance() to get an instance.

Member Function Documentation

[since 5.74] bool KSambaShare::areGuestsAllowed() const

Check whether usershares may enable guests. System-level configuration may disable usershare guests and prevent saving KSambaShareData with UserGuestPermission set.

Returns true when usershares may allow guest access

This function was introduced in 5.74.

[signal] void KSambaShare::changed()

Emitted when a share is updated, added or removed

KSambaShareData KSambaShare::getShareByName(const QString &name) const

Returns the KSambaShareData object of the share name.

name the share name.

Returns the KSambaShareData object that matches the name or an empty KSambaShareData object if there is no match for the name.

QList<KSambaShareData> KSambaShare::getSharesByPath(const QString &path) const

Returns a list of KSambaShareData matching the path.

path the path that wants to get KSambaShareData object.

Returns the QList of KSambaShareData objects that matches the path or an empty QList if there aren't matches for the given path.

[static] KSambaShare *KSambaShare::instance()

Returns the one and only instance of KSambaShare.

bool KSambaShare::isDirectoryShared(const QString &path) const

Whether or not the given path is shared by Samba.

path the path to check if it is shared by Samba.

bool KSambaShare::isShareNameAvailable(const QString &name) const

Tests that a share name is valid and does not conflict with system users names or shares.

name the share name.

Returns whether the given name is already being used or not.

[since 5.74] QString KSambaShare::lastSystemErrorString() const

Used to obtain UserShareSystemError error strings. This is usually the verbatim stderr of internal helper commands and may contain newlines. Do not use this to obtain error strings for other error types!

Returns QString containing the most relevant last stderr

This function was introduced in 5.74.

QStringList KSambaShare::shareNames() const

Returns the list of available shares.

Returns a QStringList containing the user shares names or empty list if there aren't user shared directories.

QStringList KSambaShare::sharedDirectories() const

Returns a list of all directories shared by local users in Samba. The resulting list is not sorted.