add test support of several active profiles to gui, library and helper

This commit is contained in:
arcan1s
2014-08-16 21:47:22 +04:00
parent f238ba3a6a
commit 87376f1a5c
11 changed files with 156 additions and 48 deletions

View File

@ -86,7 +86,7 @@ public:
* @brief method which returns active profile name
* @return profile name or ""
*/
QString getActiveProfile();
QStringList getActiveProfile();
/**
* @brief method which returns active profile name from netctl-auto
* @return profile name or ""

View File

@ -147,17 +147,15 @@ QString Netctl::getCmdOutput(const bool sudo, const QString command, const QStri
/**
* @fn getActiveProfile
*/
QString Netctl::getActiveProfile()
QStringList Netctl::getActiveProfile()
{
if (debug) qDebug() << PDEBUG;
QString profile = QString("");
QStringList profile;
QList<netctlProfileInfo> fullProfilesInfo = getProfileList();
for (int i=0; i<fullProfilesInfo.count(); i++)
if (fullProfilesInfo[i].active) {
profile = fullProfilesInfo[i].name;
break;
}
if (fullProfilesInfo[i].active)
profile.append(fullProfilesInfo[i].name);
return profile;
}