kio Library API Documentation

KFileShare Class Reference

Common functionality for the file sharing (communication with the backend)
Since:
3.1.
More...

#include <kfileshare.h>

Collaboration diagram for KFileShare:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Authorization { NotInitialized, ErrorNotFound, Authorized, UserNotAllowed }
enum  ShareMode { Simple, Advanced }

Static Public Member Functions

void readConfig ()
void readShareList ()
bool isDirectoryShared (const QString &path)
Authorization authorization ()
QString findExe (const char *exeName)
bool setShared (const QString &path, bool shared)
bool sharingEnabled ()
bool isRestricted ()
QString fileShareGroup ()
ShareMode shareMode ()
bool sambaEnabled ()
bool nfsEnabled ()

Detailed Description

Common functionality for the file sharing (communication with the backend)
Since:
3.1.

Definition at line 49 of file kfileshare.h.


Member Enumeration Documentation

enum KFileShare::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. Definition at line 94 of file kfileshare.h.

Referenced by shareMode().


Member Function Documentation

void KFileShare::readConfig  )  [static]
 

Reads the file share configuration file.

Definition at line 85 of file kfileshare.cpp.

References KConfigBase::readEntry(), and KUserGroup::users().

Referenced by authorization(), fileShareGroup(), isRestricted(), nfsEnabled(), sambaEnabled(), shareMode(), and sharingEnabled().

void KFileShare::readShareList  )  [static]
 

Reads the list of shared folders.

Definition at line 164 of file kfileshare.cpp.

References endl(), kdDebug(), kdError(), KProcIO::readln(), and KProcIO::start().

Referenced by KFileSharePropsPlugin::applyChanges(), and isDirectoryShared().

bool KFileShare::isDirectoryShared const QString path  )  [static]
 

Call this to know if a directory is currently shared.

Definition at line 202 of file kfileshare.cpp.

References readShareList().

KFileShare::Authorization KFileShare::authorization  )  [static]
 

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

Definition at line 213 of file kfileshare.cpp.

References readConfig().

bool KFileShare::setShared const QString path,
bool  shared
[static]
 

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

Parameters:
path the path to share
wether the path should be shared or not
Returns:
wether the perl script was successful
Definition at line 231 of file kfileshare.cpp.

References endl(), KProcess::exitStatus(), kdDebug(), KProcess::normalExit(), shareMode(), sharingEnabled(), and KProcess::start().

bool KFileShare::sharingEnabled  )  [static]
 

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

Definition at line 127 of file kfileshare.cpp.

References readConfig().

Referenced by setShared().

bool KFileShare::isRestricted  )  [static]
 

Returns wether 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. Definition at line 134 of file kfileshare.cpp.

References readConfig().

QString KFileShare::fileShareGroup  )  [static]
 

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. Definition at line 141 of file kfileshare.cpp.

References readConfig().

KFileShare::ShareMode KFileShare::shareMode  )  [static]
 

Returns the configured share mode.

Definition at line 120 of file kfileshare.cpp.

References readConfig(), and ShareMode.

Referenced by setShared().

bool KFileShare::sambaEnabled  )  [static]
 

Returns wether Samba is enabled.

Definition at line 149 of file kfileshare.cpp.

References readConfig().

bool KFileShare::nfsEnabled  )  [static]
 

Returns wether NFS is enabled.

Definition at line 156 of file kfileshare.cpp.

References readConfig().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kio Library Version 3.3.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 17 11:30:01 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003