1 /* This file is part of the KDE project
2 Copyright (c) 2004 Jan Schaefer <j_schaef@informatik.uni-kl.de>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
22 #include <QtCore/QObject>
24 #include <kio/kio_export.h>
27 * Similar functionality like KFileShare,
28 * but works only for NFS and do not need
30 * It parses the /etc/exports file to get its information.
31 * Singleton class, call instance() to get an instance.
33 class KIO_EXPORT KNFSShare
: public QObject
38 * Returns the one and only instance of KNFSShare
40 static KNFSShare
* instance();
43 * Whether or not the given path is shared by NFS.
44 * @param path the path to check if it is shared by NFS.
45 * @return whether the given path is shared by NFS.
47 bool isDirectoryShared( const QString
& path
) const;
50 * Returns a list of all directories shared by NFS.
51 * The resulting list is not sorted.
52 * @return a list of all directories shared by NFS.
54 QStringList
sharedDirectories() const;
57 * KNFSShare destructor.
59 * The instance is destroyed automatically!
64 * Returns the path to the used exports file,
65 * or null if no exports file was found
67 QString
exportsPath() const;
71 * Emitted when the /etc/exports file has changed
77 class KNFSSharePrivate
;
78 KNFSSharePrivate
* const d
;
80 Q_PRIVATE_SLOT( d
, void _k_slotFileChange(const QString
&) )