KDE 4.5 PyKDE API Reference

- KDE's Python API

# KFileShare Namespace Reference

`from PyKDE4.kio.KFileShare import *`

## Detailed Description

Common functionality for the file sharing (communication with the backend)

## Enumerations
Authorization | { NotInitialized, ErrorNotFound, Authorized, UserNotAllowed }
ShareMode | { Simple, Advanced }
## Functions
KFileShare.Authorization | authorization ()
QString | fileShareGroup ()
bool | isDirectoryShared (QString path)
bool | isRestricted ()
bool | nfsEnabled ()
| readConfig ()
| readShareList ()
bool | sambaEnabled ()
bool | setShared (QString path, bool shared)
KFileShare.ShareMode | shareMode ()
bool | sharingEnabled ()

## Enumeration Documentation

Authorization

Enumerator:

  NotInitialized |
  ErrorNotFound |
  Authorized |
  UserNotAllowed |

ShareMode

The used share mode. Simple means that the simple sharing dialog is used and users can share only folders from there HOME folder. Advanced means that the advanced sharing dialog is used and users can share any folder.

Enumerator:

  Simple |
  Advanced |

## Function Documentation

KFileShare.Authorization authorization | ( |  | ) |

Call this to know if the current user is authorized to share directories

QString fileShareGroup | ( |  | ) |

Returns the group that is used for file sharing. That is, all users in that group are allowed to share files if file sharing is restricted.

bool isDirectoryShared | ( | QString | path
| ) |  |  |

Call this to know if a directory is currently shared

bool isRestricted | ( |  | ) |

Returns whether file sharing is restricted. If it is not restricted every user can shar files. If it is restricted only users in the configured file share group can share files.

bool nfsEnabled | ( |  | ) |

Returns whether NFS is enabled

readConfig | ( |  | ) |

Reads the file share configuration file

readShareList | ( |  | ) |

Reads the list of shared folders

bool sambaEnabled | ( |  | ) |

Returns whether Samba is enabled

bool setShared | ( | QString | path,
|  | bool | shared
| ) |  |  |

Uses a suid perl script to share the given path with NFS and Samba

Parameters:

  | path | the path to share
  | shared | whether the path should be shared or not

Returns:
  whether the perl script was successful

KFileShare.ShareMode shareMode | ( |  | ) |

Returns the configured share mode

bool sharingEnabled | ( |  | ) |

Returns whether sharing is enabled If this is false, file sharing is disabled and nobody can share files.