File indexing completed on 2024-04-14 15:05:28

0001 /***************************************************************************
0002     These are the private helper classes of the Smb4KGlobal namespace.
0003                              -------------------
0004     begin                : Di Jul 24 2007
0005     copyright            : (C) 2007-2019 by Alexander Reinholdt
0006     email                : alexander.reinholdt@kdemail.net
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *   This program is free software; you can redistribute it and/or modify  *
0011  *   it under the terms of the GNU General Public License as published by  *
0012  *   the Free Software Foundation; either version 2 of the License, or     *
0013  *   (at your option) any later version.                                   *
0014  *                                                                         *
0015  *   This program is distributed in the hope that it will be useful, but   *
0016  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
0017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
0018  *   General Public License for more details.                              *
0019  *                                                                         *
0020  *   You should have received a copy of the GNU General Public License     *
0021  *   along with this program; if not, write to the                         *
0022  *   Free Software Foundation, Inc., 51 Franklin Street, Suite 500, Boston,*
0023  *   MA 02110-1335, USA                                                    *
0024  ***************************************************************************/
0025 
0026 #ifndef SMB4KGLOBAL_P_H
0027 #define SMB4KGLOBAL_P_H
0028 
0029 // application specific includes
0030 #include "smb4kworkgroup.h"
0031 #include "smb4khost.h"
0032 #include "smb4kshare.h"
0033 
0034 // Qt includes
0035 #include <QList>
0036 #include <QMap>
0037 #include <QObject>
0038 #include <QSharedPointer>
0039 #include <QFileSystemWatcher>
0040 
0041 /**
0042  * This class is a private helper for the Smb4KGlobal namespace.
0043  *
0044  * @author Alexander Reinholdt <alexander.reinholdt@kdemail.net>
0045  */
0046 
0047 class Smb4KGlobalPrivate : public QObject
0048 {
0049   Q_OBJECT
0050   
0051   public:
0052     /**
0053      * Constructor
0054      */
0055     Smb4KGlobalPrivate();
0056 
0057     /**
0058      * Destructor
0059      */
0060     ~Smb4KGlobalPrivate();
0061 
0062     /**
0063      * This is the global workgroup list.
0064      */
0065     QList<QSharedPointer<Smb4KWorkgroup>> workgroupsList;
0066 
0067     /**
0068      * This is the global host list.
0069      */
0070     QList<QSharedPointer<Smb4KHost>> hostsList;
0071 
0072     /**
0073      * This is global list of mounted shares.
0074      */
0075     QList<QSharedPointer<Smb4KShare>> mountedSharesList;
0076 
0077     /**
0078      * This is the global list of shares.
0079      */
0080     QList<QSharedPointer<Smb4KShare>> sharesList;
0081     
0082     /**
0083      * The global options defined in smb.conf
0084      */
0085     const QMap<QString,QString> &globalSambaOptions(bool read = false);
0086 
0087     /**
0088      * Boolean that is TRUE when only foreign shares
0089      * are in the list of mounted shares
0090      */
0091     bool onlyForeignShares;
0092 
0093     /**
0094      * Boolean that is TRUE if the core classes have
0095      * been initialized
0096      */
0097     bool coreInitialized;
0098     
0099     /**
0100      * Boolean that determines if the core classes should set
0101      * a busy cursor when they are doing something or not.
0102      */
0103     bool modifyCursor;
0104     
0105 #ifdef Q_OS_LINUX
0106     /**
0107      * This list contains all whitelisted arguments for the mount.cifs binary and
0108      * is only present under the Linux operating system.
0109      */
0110     QStringList whitelistedMountArguments;
0111 #endif
0112 
0113   protected Q_SLOTS:
0114     /**
0115      * This slot does last things before the application quits
0116      */
0117     void slotAboutToQuit();
0118     
0119     /**
0120      * Called when the smb.conf file is modified
0121      */
0122     void slotSmbConfModified(const QString &file);
0123     
0124   private:
0125     QMap<QString,QString> m_sambaOptions;
0126     bool m_sambaConfigMissing;
0127     QFileSystemWatcher *m_watcher;
0128 };
0129 
0130 #endif