Diffstat (limited to 'noncore/settings/networksettings/wlan/wlanimp2.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp index d36a702..5cb78cf 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp | |||
@@ -95,49 +95,48 @@ void WLANImp::parseOpts() { | |||
95 | opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace(); | 95 | opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace(); |
96 | 96 | ||
97 | for ( int i = 0; i < mode->count(); i++) | 97 | for ( int i = 0; i < mode->count(); i++) |
98 | if ( mode->text( i ) == opt ) mode->setCurrentItem( i ); | 98 | if ( mode->text( i ) == opt ) mode->setCurrentItem( i ); |
99 | 99 | ||
100 | opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace(); | 100 | opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace(); |
101 | if (! opt.isNull()) { | 101 | if (! opt.isNull()) { |
102 | specifyAp->setChecked(true); | 102 | specifyAp->setChecked(true); |
103 | macEdit->setText(opt); | 103 | macEdit->setText(opt); |
104 | } | 104 | } |
105 | 105 | ||
106 | opt = interfaces->getInterfaceOption("wireless_channel", error).simplifyWhiteSpace(); | 106 | opt = interfaces->getInterfaceOption("wireless_channel", error).simplifyWhiteSpace(); |
107 | if (! opt.isNull()) { | 107 | if (! opt.isNull()) { |
108 | specifyChan->setChecked(true); | 108 | specifyChan->setChecked(true); |
109 | networkChannel->setValue(opt.toInt()); | 109 | networkChannel->setValue(opt.toInt()); |
110 | } | 110 | } |
111 | 111 | ||
112 | opt = interfaces->getInterfaceOption("wireless_key", error).simplifyWhiteSpace(); | 112 | opt = interfaces->getInterfaceOption("wireless_key", error).simplifyWhiteSpace(); |
113 | if (opt.isNull()) | 113 | if (opt.isNull()) |
114 | opt = interfaces->getInterfaceOption("wireless_enc", error).simplifyWhiteSpace(); | 114 | opt = interfaces->getInterfaceOption("wireless_enc", error).simplifyWhiteSpace(); |
115 | parseKeyStr(opt); | 115 | parseKeyStr(opt); |
116 | } | 116 | } |
117 | 117 | ||
118 | void WLANImp::parseKeyStr(QString keystr) { | 118 | void WLANImp::parseKeyStr(QString keystr) { |
119 | int loc = 0; | ||
120 | int index = 1; | 119 | int index = 1; |
121 | QString key; | 120 | QString key; |
122 | QStringList keys = QStringList::split(QRegExp("\\s+"), keystr); | 121 | QStringList keys = QStringList::split(QRegExp("\\s+"), keystr); |
123 | int enc = -1; // encryption state | 122 | int enc = -1; // encryption state |
124 | 123 | ||
125 | for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) { | 124 | for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) { |
126 | if ((*it).left(3) == "off") { | 125 | if ((*it).left(3) == "off") { |
127 | // encryption disabled | 126 | // encryption disabled |
128 | enc = 0; | 127 | enc = 0; |
129 | } else if ((*it).left(2) == "on") { | 128 | } else if ((*it).left(2) == "on") { |
130 | // encryption enabled | 129 | // encryption enabled |
131 | enc = 1; | 130 | enc = 1; |
132 | } else if ((*it).left(4) == "open") { | 131 | } else if ((*it).left(4) == "open") { |
133 | // open mode, accept non encrypted packets | 132 | // open mode, accept non encrypted packets |
134 | acceptNonEnc->setChecked(true); | 133 | acceptNonEnc->setChecked(true); |
135 | } else if ((*it).left(10) == "restricted") { | 134 | } else if ((*it).left(10) == "restricted") { |
136 | // restricted mode, only accept encrypted packets | 135 | // restricted mode, only accept encrypted packets |
137 | rejectNonEnc->setChecked(true); | 136 | rejectNonEnc->setChecked(true); |
138 | } else if ((*it).left(3) == "key") { | 137 | } else if ((*it).left(3) == "key") { |
139 | // new set of options | 138 | // new set of options |
140 | } else if ((*it).left(1) == "[") { | 139 | } else if ((*it).left(1) == "[") { |
141 | index = (*it).mid(1, 1).toInt(); | 140 | index = (*it).mid(1, 1).toInt(); |
142 | // switch current key to index | 141 | // switch current key to index |
143 | switch (index) { | 142 | switch (index) { |