netctlgui  1.4.7
Qt library which interacts with netctl
netctlprofile.h
Go to the documentation of this file.
1 /***************************************************************************
2  * This file is part of netctl-gui *
3  * *
4  * netctl-gui is free software: you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation, either version 3 of the *
7  * License, or (at your option) any later version. *
8  * *
9  * netctl-gui is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
16  ***************************************************************************/
26 #ifndef NETCTLPROFILE_H
27 #define NETCTLPROFILE_H
28 
29 #include <QDir>
30 #include <QMap>
31 #include <QObject>
32 
33 #include "version.h"
34 
35 
39 class NetctlProfile : public QObject
40 {
41  Q_OBJECT
42 
43 public:
52  explicit NetctlProfile(const bool debugCmd = false,
53  const QMap<QString, QString> settings = QMap<QString, QString>());
64  bool copyProfile(const QString oldPath);
71  QString createProfile(const QString profile, const QMap<QString, QString> settings);
76  static QMap<QString, QString> getRecommendedConfiguration();
82  QMap<QString, QString> getSettingsFromProfile(const QString profile);
89  QString getValueFromProfile(const QString profile, const QString key);
96  QStringList getValuesFromProfile(const QString profile, const QStringList keys);
103  bool removeProfile(const QString profile);
104 
105 private:
109  bool debug = false;
113  bool useSuid = true;
117  QDir *profileDirectory = nullptr;
121  QString sudoCommand = QString(SUDO_PATH);
122 };
123 
124 
125 #endif /* NETCTLPROFILE_H */
QString createProfile(const QString profile, const QMap< QString, QString > settings)
method which creates temporary profile
QMap< QString, QString > getSettingsFromProfile(const QString profile)
method which reads settings from profile
QString getValueFromProfile(const QString profile, const QString key)
method which return value from profile by key
NetctlProfile(const bool debugCmd=false, const QMap< QString, QString > settings=QMap< QString, QString >())
NetctlProfile class constructor.
The NetctlProfile class interacts with netctl profiles.
Definition: netctlprofile.h:39
static QMap< QString, QString > getRecommendedConfiguration()
method which check system configuration and return recommended values to keys
~NetctlProfile()
Netctl class destructor.
bool copyProfile(const QString oldPath)
method which copies temporary profile to PROFILE_DIR
bool removeProfile(const QString profile)
method which removes profile
QStringList getValuesFromProfile(const QString profile, const QStringList keys)
method which return values from profile by keys