fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kio / kio / knfsshare.h
blob27bad16d46b505b2c14ff34d163910cd371639a8
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.
19 #ifndef knfsshare_h
20 #define knfsshare_h
22 #include <QtCore/QObject>
24 #include <kio/kio_export.h>
26 /**
27 * Similar functionality like KFileShare,
28 * but works only for NFS and do not need
29 * any suid script.
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
35 Q_OBJECT
36 public:
37 /**
38 * Returns the one and only instance of KNFSShare
40 static KNFSShare* instance();
42 /**
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;
49 /**
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;
56 /**
57 * KNFSShare destructor.
58 * Do not call!
59 * The instance is destroyed automatically!
60 */
61 virtual ~KNFSShare();
63 /**
64 * Returns the path to the used exports file,
65 * or null if no exports file was found
67 QString exportsPath() const;
69 Q_SIGNALS:
70 /**
71 * Emitted when the /etc/exports file has changed
73 void changed();
75 private:
76 KNFSShare();
77 class KNFSSharePrivate;
78 KNFSSharePrivate * const d;
80 Q_PRIVATE_SLOT( d, void _k_slotFileChange(const QString&) )
83 #endif