File indexing completed on 2024-09-15 03:38:33
0001 /* 0002 SPDX-FileCopyrightText: 2010 Rodrigo Belem <rclbelem@gmail.com> 0003 SPDX-FileCopyrightText: 2020 Harald Sitter <sitter@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0006 */ 0007 0008 #ifndef ksambashare_p_h 0009 #define ksambashare_p_h 0010 0011 #include <QMap> 0012 0013 #include "ksambasharedata.h" 0014 0015 class QString; 0016 class KSambaShare; 0017 0018 class KSambaSharePrivate 0019 { 0020 public: 0021 explicit KSambaSharePrivate(KSambaShare *parent); 0022 ~KSambaSharePrivate(); 0023 0024 static bool isSambaInstalled(); 0025 void setUserSharePath(); 0026 0027 static int runProcess(const QString &progName, const QStringList &args, QByteArray &stdOut, QByteArray &stdErr); 0028 static QString testparmParamValue(const QString ¶meterName); 0029 0030 QByteArray getNetUserShareInfo(); 0031 QStringList shareNames() const; 0032 QStringList sharedDirs() const; 0033 KSambaShareData getShareByName(const QString &shareName) const; 0034 QList<KSambaShareData> getSharesByPath(const QString &path) const; 0035 0036 bool isShareNameValid(const QString &name) const; 0037 bool isDirectoryShared(const QString &path) const; 0038 bool isShareNameAvailable(const QString &name) const; 0039 bool areGuestsAllowed() const; 0040 KSambaShareData::UserShareError isPathValid(const QString &path) const; 0041 KSambaShareData::UserShareError isAclValid(const QString &acl) const; 0042 KSambaShareData::UserShareError guestsAllowed(const KSambaShareData::GuestPermission &guestok) const; 0043 0044 KSambaShareData::UserShareError add(const KSambaShareData &shareData); 0045 KSambaShareData::UserShareError remove(const KSambaShareData &shareName); 0046 static QMap<QString, KSambaShareData> parse(const QByteArray &usershareData); 0047 0048 void slotFileChange(const QString &path); 0049 0050 private: 0051 KSambaShare *const q_ptr; 0052 Q_DECLARE_PUBLIC(KSambaShare) 0053 0054 QMap<QString, KSambaShareData> data; 0055 QString smbConf; 0056 QString userSharePath; 0057 bool skipUserShare; 0058 QByteArray m_stdErr; 0059 }; 0060 0061 #endif