netctlgui  1.4.7
Qt library which interacts with netctl
Public Member Functions | Static Public Member Functions | List of all members
NetctlProfile Class Reference

The NetctlProfile class interacts with netctl profiles. More...

Inheritance diagram for NetctlProfile:

Public Member Functions

 NetctlProfile (const bool debugCmd=false, const QMap< QString, QString > settings=QMap< QString, QString >())
 NetctlProfile class constructor. More...
 
 ~NetctlProfile ()
 Netctl class destructor. More...
 
bool copyProfile (const QString oldPath)
 method which copies temporary profile to PROFILE_DIR More...
 
QString createProfile (const QString profile, const QMap< QString, QString > settings)
 method which creates temporary profile More...
 
QMap< QString, QString > getSettingsFromProfile (const QString profile)
 method which reads settings from profile More...
 
QString getValueFromProfile (const QString profile, const QString key)
 method which return value from profile by key More...
 
QStringList getValuesFromProfile (const QString profile, const QStringList keys)
 method which return values from profile by keys More...
 
bool removeProfile (const QString profile)
 method which removes profile More...
 

Static Public Member Functions

static QMap< QString, QString > getRecommendedConfiguration ()
 method which check system configuration and return recommended values to keys More...
 

Detailed Description

The NetctlProfile class interacts with netctl profiles.

Constructor & Destructor Documentation

NetctlProfile::NetctlProfile ( const bool  debugCmd = false,
const QMap< QString, QString >  settings = QMap< QString, QString >() 
)
explicit

NetctlProfile class constructor.

Parameters
debugCmdshow debug messages
settingsdefault settings. Needed keys are FORCE_SUDO (force to use sudo), PROFILE_DIR (path to directory which contains profiles), SUDO_PATH (path to sudo command)
NetctlProfile::~NetctlProfile ( )

Netctl class destructor.

Member Function Documentation

bool NetctlProfile::copyProfile ( const QString  oldPath)

method which copies temporary profile to PROFILE_DIR

Parameters
oldPathpath to temprorary profile
Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors
QString NetctlProfile::createProfile ( const QString  profile,
const QMap< QString, QString >  settings 
)

method which creates temporary profile

Parameters
profileprofile name
settingsprofile configuration. All available keys will be printed to the profile
Returns
temporary profile name
static QMap<QString, QString> NetctlProfile::getRecommendedConfiguration ( )
static

method which check system configuration and return recommended values to keys

Returns
recommended parametrs
QMap<QString, QString> NetctlProfile::getSettingsFromProfile ( const QString  profile)

method which reads settings from profile

Parameters
profileprofile name
Returns
settings from profile
QString NetctlProfile::getValueFromProfile ( const QString  profile,
const QString  key 
)

method which return value from profile by key

Parameters
profileprofile name
keyrequired key
Returns
value by key
QStringList NetctlProfile::getValuesFromProfile ( const QString  profile,
const QStringList  keys 
)

method which return values from profile by keys

Parameters
profileprofile name
keysrequired keys
Returns
values by keys
bool NetctlProfile::removeProfile ( const QString  profile)

method which removes profile

Parameters
profileprofile name
Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors

The documentation for this class was generated from the following file: