KSambaShareData
#include <KSambaShareData>
Public Member Functions | |
KSambaShareData (const KSambaShareData &other) | |
QString | acl () const |
QString | comment () const |
KSambaShareData::GuestPermission | guestPermission () const |
QString | name () const |
bool | operator!= (const KSambaShareData &other) const |
KSambaShareData & | operator= (const KSambaShareData &other) |
bool | operator== (const KSambaShareData &other) const |
QString | path () const |
KSambaShareData::UserShareError | remove () |
KSambaShareData::UserShareError | save () |
KSambaShareData::UserShareError | setAcl (const QString &acl) |
KSambaShareData::UserShareError | setComment (const QString &comment) |
KSambaShareData::UserShareError | setGuestPermission (const GuestPermission &permission=KSambaShareData::GuestsNotAllowed) |
KSambaShareData::UserShareError | setName (const QString &name) |
KSambaShareData::UserShareError | setPath (const QString &path) |
Detailed Description
This class represents a Samba user share.
It is possible to share a directory with one or more different names, update the share details or remove.
- Since
- 4.7
Definition at line 27 of file ksambasharedata.h.
Member Enumeration Documentation
◆ GuestPermission
enum KSambaShareData::GuestPermission |
Definition at line 30 of file ksambasharedata.h.
◆ UserShareError
enum KSambaShareData::UserShareError |
Definition at line 35 of file ksambasharedata.h.
Constructor & Destructor Documentation
◆ KSambaShareData() [1/2]
KSambaShareData::KSambaShareData | ( | ) |
Definition at line 22 of file ksambasharedata.cpp.
◆ KSambaShareData() [2/2]
KSambaShareData::KSambaShareData | ( | const KSambaShareData & | other | ) |
Definition at line 27 of file ksambasharedata.cpp.
◆ ~KSambaShareData()
KSambaShareData::~KSambaShareData | ( | ) |
Definition at line 32 of file ksambasharedata.cpp.
Member Function Documentation
◆ acl()
QString KSambaShareData::acl | ( | ) | const |
Returns a containing
a string describing the permission added to the users, such as "[DOMAIN\]username1:X,[DOMAIN\]username2:X,...".
X stands for "F" (full control), "R" (read-only) and "D" (deny). By default the acl is Everyone:R.
- Returns
the
share acl.
Definition at line 51 of file ksambasharedata.cpp.
◆ comment()
QString KSambaShareData::comment | ( | ) | const |
- Returns
the
share comment.
Definition at line 46 of file ksambasharedata.cpp.
◆ guestPermission()
KSambaShareData::GuestPermission KSambaShareData::guestPermission | ( | ) | const |
- Returns
whether
guest access to the share is allowed or not.
Definition at line 56 of file ksambasharedata.cpp.
◆ name()
QString KSambaShareData::name | ( | ) | const |
- Returns
the
share name.
Definition at line 36 of file ksambasharedata.cpp.
◆ operator!=()
bool KSambaShareData::operator!= | ( | const KSambaShareData & | other | ) | const |
Definition at line 151 of file ksambasharedata.cpp.
◆ operator=()
KSambaShareData & KSambaShareData::operator= | ( | const KSambaShareData & | other | ) |
Definition at line 137 of file ksambasharedata.cpp.
◆ operator==()
bool KSambaShareData::operator== | ( | const KSambaShareData & | other | ) | const |
Definition at line 146 of file ksambasharedata.cpp.
◆ path()
QString KSambaShareData::path | ( | ) | const |
- Returns
the
share path.
Definition at line 41 of file ksambasharedata.cpp.
◆ remove()
KSambaShareData::UserShareError KSambaShareData::remove | ( | ) |
Unshare the folder held by the object.
- Returns
UserShareOk
if the share was removed or other errors as applicable. Also see UserShareSystemError.
Definition at line 128 of file ksambasharedata.cpp.
◆ save()
KSambaShareData::UserShareError KSambaShareData::save | ( | ) |
Share the folder with the information that has been set.
- Returns
UserShareOk
if the share was added or other errors as applicable. Also see UserShareSystemError.
Definition at line 117 of file ksambasharedata.cpp.
◆ setAcl()
KSambaShareData::UserShareError KSambaShareData::setAcl | ( | const QString & | acl | ) |
Sets the acl to the share.
- Parameters
-
acl the acl that will be given to the share.
- Returns
UserShareAclOk
if the acl is valid.-
UserShareAclInvalid
if the acl has invalid format. -
UserShareAclUserNotValid
if one of the users in the acl is invalid.
Definition at line 97 of file ksambasharedata.cpp.
◆ setComment()
KSambaShareData::UserShareError KSambaShareData::setComment | ( | const QString & | comment | ) |
Sets the comment for the share.
- Parameters
-
comment the comment that will be given to the share.
- Returns
UserShareCommentOk
always.
Definition at line 90 of file ksambasharedata.cpp.
◆ setGuestPermission()
KSambaShareData::UserShareError KSambaShareData::setGuestPermission | ( | const GuestPermission & | permission = KSambaShareData::GuestsNotAllowed | ) |
Flags if guest is allowed or not to access the share.
- Parameters
-
permission the permission that will be given to the share.
- Returns
UserShareGuestsOk
if the permission was set.-
UserShareGuestsNotAllowed
if the system does not allow guest access to the shares.
Definition at line 107 of file ksambasharedata.cpp.
◆ setName()
KSambaShareData::UserShareError KSambaShareData::setName | ( | const QString & | name | ) |
Sets the share name.
If the share name is changed and valid it will remove the existing share and will create a new share. The share name cannot use a name of a system user or containing the forbidden characters '%, <, >, *, ?, |, /, \, +, =, ;, :, ",,. To check if the name is available or valid use the method KSambaShare::isShareNameAvailable().
- Parameters
-
name the name that will be given to the share.
- Returns
UserShareNameOk
if the name is valid.-
UserShareNameInvalid
if the name contains invalid characters. -
UserShareNameInUse
if the name is already in use by another shared folder or a by a system user.
Definition at line 61 of file ksambasharedata.cpp.
◆ setPath()
KSambaShareData::UserShareError KSambaShareData::setPath | ( | const QString & | path | ) |
Set the path for the share.
- Parameters
-
path the path that will be given to the share.
- Returns
UserSharePathOk
if valid.-
UserSharePathInvalid
if the path is in invalid format. -
UserSharePathNotExists
if the path does not exists. -
UserSharePathNotDirectory
if the path points to file instead of a directory. -
UserSharePathNotAbsolute
if the path is not is absolute form. -
UserSharePathNotAllowed
if the path is not owner by the user.
Definition at line 80 of file ksambasharedata.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.