netctlgui  1.4.2
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 
37 class NetctlProfile : public QObject
38 {
39  Q_OBJECT
40 
41 public:
50  explicit NetctlProfile(const bool debugCmd = false,
51  const QMap<QString, QString> settings = QMap<QString, QString>());
62  bool copyProfile(const QString oldPath);
69  QString createProfile(const QString profile, const QMap<QString, QString> settings);
74  static QMap<QString, QString> getRecommendedConfiguration();
80  QMap<QString, QString> getSettingsFromProfile(const QString profile);
87  QString getValueFromProfile(const QString profile, const QString key);
94  QStringList getValuesFromProfile(const QString profile, const QStringList keys);
101  bool removeProfile(const QString profile);
102 
103 private:
107  bool debug = false;
111  bool useSuid = true;
115  QDir *profileDirectory = nullptr;
119  QString sudoCommand = QString("/usr/bin/kdesu");
120 };
121 
122 
123 #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:37
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