\section{KFile\-Share Class Reference}
\label{classKFileShare}\index{KFileShare@{KFileShare}}
Common functionality for the file sharing (communication with the backend) \begin{Desc}
\item[Since:]3.1. \end{Desc}
 


{\tt \#include $<$kfileshare.h$>$}

Collaboration diagram for KFile\-Share:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=113pt]{classKFileShare__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Authorization} \{ {\bf Not\-Initialized}, 
{\bf Error\-Not\-Found}, 
{\bf Authorized}, 
{\bf User\-Not\-Allowed}
 \}
\item 
enum {\bf Share\-Mode} \{ {\bf Simple}, 
{\bf Advanced}
 \}
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static void {\bf read\-Config} ()
\item 
static void {\bf read\-Share\-List} ()
\item 
static bool {\bf is\-Directory\-Shared} (const {\bf QString} \&path)
\item 
static Authorization {\bf authorization} ()
\item 
static {\bf QString} {\bf find\-Exe} (const char $\ast$exe\-Name)\label{classKFileShare_e4}

\item 
static bool {\bf set\-Shared} (const {\bf QString} \&path, bool shared)
\item 
static bool {\bf sharing\-Enabled} ()
\item 
static bool {\bf is\-Restricted} ()
\item 
static {\bf QString} {\bf file\-Share\-Group} ()
\item 
static {\bf Share\-Mode} {\bf share\-Mode} ()
\item 
static bool {\bf samba\-Enabled} ()
\item 
static bool {\bf nfs\-Enabled} ()
\end{CompactItemize}


\subsection{Detailed Description}
Common functionality for the file sharing (communication with the backend) \begin{Desc}
\item[Since:]3.1. \end{Desc}




Definition at line 51 of file kfileshare.h.

\subsection{Member Enumeration Documentation}
\index{KFileShare@{KFile\-Share}!ShareMode@{ShareMode}}
\index{ShareMode@{ShareMode}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KFile\-Share::Share\-Mode}}\label{classKFileShare_w7}


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 96 of file kfileshare.h.

\subsection{Member Function Documentation}
\index{KFileShare@{KFile\-Share}!readConfig@{readConfig}}
\index{readConfig@{readConfig}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Share::read\-Config ()\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e0}


Reads the file share configuration file. 



Definition at line 86 of file kfileshare.cpp.

References KConfig\-Base::read\-Entry(), and KUser\-Group::users().

Referenced by authorization(), file\-Share\-Group(), is\-Restricted(), nfs\-Enabled(), samba\-Enabled(), share\-Mode(), and sharing\-Enabled().\index{KFileShare@{KFile\-Share}!readShareList@{readShareList}}
\index{readShareList@{readShareList}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Share::read\-Share\-List ()\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e1}


Reads the list of shared folders. 



Definition at line 165 of file kfileshare.cpp.

References endl(), QString::is\-Empty(), kd\-Debug(), kd\-Error(), KProc\-IO::readln(), KStatic\-Deleter$<$ type $>$::set\-Object(), and KProc\-IO::start().

Referenced by KFile\-Share\-Props\-Plugin::apply\-Changes(), and is\-Directory\-Shared().\index{KFileShare@{KFile\-Share}!isDirectoryShared@{isDirectoryShared}}
\index{isDirectoryShared@{isDirectoryShared}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Share::is\-Directory\-Shared (const {\bf QString} \& {\em path})\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e2}


Call this to know if a directory is currently shared. 



Definition at line 203 of file kfileshare.cpp.

References QString::length(), and read\-Share\-List().\index{KFileShare@{KFile\-Share}!authorization@{authorization}}
\index{authorization@{authorization}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KFile\-Share::Authorization KFile\-Share::authorization ()\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e3}


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



Definition at line 214 of file kfileshare.cpp.

References read\-Config().\index{KFileShare@{KFile\-Share}!setShared@{setShared}}
\index{setShared@{setShared}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Share::set\-Shared (const {\bf QString} \& {\em path}, bool {\em shared})\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e5}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em path}]the path to share \item[{\em shared}]whether the path should be shared or not \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]whether the perl script was successful \end{Desc}


Definition at line 232 of file kfileshare.cpp.

References endl(), KProcess::exit\-Status(), QString::is\-Empty(), kd\-Debug(), KProcess::normal\-Exit(), share\-Mode(), sharing\-Enabled(), and KProcess::start().\index{KFileShare@{KFile\-Share}!sharingEnabled@{sharingEnabled}}
\index{sharingEnabled@{sharingEnabled}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Share::sharing\-Enabled ()\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e6}


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



Definition at line 128 of file kfileshare.cpp.

References read\-Config().

Referenced by set\-Shared().\index{KFileShare@{KFile\-Share}!isRestricted@{isRestricted}}
\index{isRestricted@{isRestricted}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Share::is\-Restricted ()\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e7}


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. 

Definition at line 135 of file kfileshare.cpp.

References read\-Config().\index{KFileShare@{KFile\-Share}!fileShareGroup@{fileShareGroup}}
\index{fileShareGroup@{fileShareGroup}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Share::file\-Share\-Group ()\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e8}


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 142 of file kfileshare.cpp.

References read\-Config().\index{KFileShare@{KFile\-Share}!shareMode@{shareMode}}
\index{shareMode@{shareMode}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Share::Share\-Mode} KFile\-Share::share\-Mode ()\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e9}


Returns the configured share mode. 



Definition at line 121 of file kfileshare.cpp.

References read\-Config().

Referenced by set\-Shared().\index{KFileShare@{KFile\-Share}!sambaEnabled@{sambaEnabled}}
\index{sambaEnabled@{sambaEnabled}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Share::samba\-Enabled ()\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e10}


Returns whether Samba is enabled. 



Definition at line 150 of file kfileshare.cpp.

References read\-Config().\index{KFileShare@{KFile\-Share}!nfsEnabled@{nfsEnabled}}
\index{nfsEnabled@{nfsEnabled}!KFileShare@{KFile\-Share}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Share::nfs\-Enabled ()\hspace{0.3cm}{\tt  [static]}}\label{classKFileShare_e11}


Returns whether NFS is enabled. 



Definition at line 157 of file kfileshare.cpp.

References read\-Config().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kfileshare.h\item 
kfileshare.cpp\end{CompactItemize}
