KDE 4.9 PyKDE API Reference

- KDE's Python API

# KSambaShare Class Reference

`from PyKDE4.kio import *`

Inherits: QObject

## Detailed Description

This class lists Samba user shares and monitors them for addition, update and removal. Singleton class, call instance() to get an instance.

## Signals

| changed ()

## Methods

| __init__ (self)
KSambaShareData | getShareByName (self, QString name)
[KSambaShareData] | getSharesByPath (self, QString path)
bool | isDirectoryShared (self, QString path)
bool | isShareNameAvailable (self, QString name)
QStringList | shareNames (self)
QStringList | sharedDirectories (self)
QString | smbConfPath (self)

## Static Methods

KSambaShare | instance ()

## Signal Documentation

changed | ( |  | ) |

Emitted when a share is updated, added or removed

Signal syntax:
  `QObject.connect(source, SIGNAL("changed()"), target_slot)`

## Method Documentation

__init__ | ( |  | self ) |

KSambaShareData getShareByName | ( | self, |
|  | QString | name
| ) |  |  |

Returns the KSambaShareData object of the share name.

Parameters:

  | name | the share name.

Returns:
  the KSambaShareData object that matches the name.

Returns:
  an empty KSambaShareData object if there isn't match for the name.

Since:
  4.7

[KSambaShareData] getSharesByPath | ( | self, |
|  | QString | path
| ) |  |  |

Returns a list of KSambaShareData matching the path.

Parameters:

  | path | the path that wants to get KSambaShareData object.

Returns:
  the QList of KSambaShareData objects that matches the path.

Returns:
  an empty QList if there aren't matches for the given path.

Since:
  4.7

bool isDirectoryShared | ( | self, |
|  | QString | path
| ) |  |  |

Whether or not the given path is shared by Samba.

Parameters:

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

Returns:
  whether the given path is shared by Samba.

bool isShareNameAvailable | ( | self, |
|  | QString | name
| ) |  |  |

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

Parameters:

  | name | the share name.

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

Since:
  4.7

QStringList shareNames | ( |  | self ) |

Returns the list of available shares.

Returns:
  a QStringList containing the user shares names.

Returns:
  an empty list if there aren't user shared directories.

Since:
  4.7

QStringList sharedDirectories | ( |  | self ) |

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

Returns:
  a list of all directories shared by Samba.

QString smbConfPath | ( |  | self ) |

Returns the path to the used smb.conf file or empty string if no file was found

Returns:
  the path to the smb.conf file

Deprecated:

## Static Method Documentation

KSambaShare instance | ( |  | ) |

Returns:
  the one and only instance of KSambaShare.