author | benmeyer <benmeyer> | 2002-10-28 19:54:38 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-28 19:54:38 (UTC) |
commit | e9d8023028b7c996d8ff2a68b87dfde19fcfa892 (patch) (unidiff) | |
tree | 08468bce6771710d32534291ad6e9333f8879490 | |
parent | 0abe89f1b470f94f25f3ab5bb3a9fbc7a0ec9d2f (diff) | |
download | opie-e9d8023028b7c996d8ff2a68b87dfde19fcfa892.zip opie-e9d8023028b7c996d8ff2a68b87dfde19fcfa892.tar.gz opie-e9d8023028b7c996d8ff2a68b87dfde19fcfa892.tar.bz2 |
removed return statment that shouldn't be there
-rw-r--r-- | noncore/net/networksetup/wlan/wlanimp.cpp | 1 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.cpp | 1 |
2 files changed, 0 insertions, 2 deletions
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp index 7c902e0..a466020 100644 --- a/noncore/net/networksetup/wlan/wlanimp.cpp +++ b/noncore/net/networksetup/wlan/wlanimp.cpp | |||
@@ -64,97 +64,96 @@ void WLANImp::readConfig() | |||
64 | keyRadio1->setChecked( true ); | 64 | keyRadio1->setChecked( true ); |
65 | break; | 65 | break; |
66 | case 2: | 66 | case 2: |
67 | keyRadio2->setChecked( true ); | 67 | keyRadio2->setChecked( true ); |
68 | break; | 68 | break; |
69 | case 3: | 69 | case 3: |
70 | keyRadio3->setChecked( true ); | 70 | keyRadio3->setChecked( true ); |
71 | break; | 71 | break; |
72 | } | 72 | } |
73 | keyLineEdit0->setText(config->readEntry( "dot11WEPDefaultKey0" )); | 73 | keyLineEdit0->setText(config->readEntry( "dot11WEPDefaultKey0" )); |
74 | keyLineEdit1->setText(config->readEntry( "dot11WEPDefaultKey1" )); | 74 | keyLineEdit1->setText(config->readEntry( "dot11WEPDefaultKey1" )); |
75 | keyLineEdit2->setText(config->readEntry( "dot11WEPDefaultKey2" )); | 75 | keyLineEdit2->setText(config->readEntry( "dot11WEPDefaultKey2" )); |
76 | keyLineEdit3->setText(config->readEntry( "dot11WEPDefaultKey3" )); | 76 | keyLineEdit3->setText(config->readEntry( "dot11WEPDefaultKey3" )); |
77 | return; | 77 | return; |
78 | } | 78 | } |
79 | 79 | ||
80 | bool WLANImp::writeConfig() | 80 | bool WLANImp::writeConfig() |
81 | { | 81 | { |
82 | qWarning( "WLANImp::writeConfig() called." ); | 82 | qWarning( "WLANImp::writeConfig() called." ); |
83 | config->setGroup( "Properties" ); | 83 | config->setGroup( "Properties" ); |
84 | if( essNon->isChecked() ) { | 84 | if( essNon->isChecked() ) { |
85 | config->writeEntry( "SSID", "any" ); | 85 | config->writeEntry( "SSID", "any" ); |
86 | } else { | 86 | } else { |
87 | config->writeEntry( "SSID", essSpecificLineEdit->text() ); | 87 | config->writeEntry( "SSID", essSpecificLineEdit->text() ); |
88 | } | 88 | } |
89 | if( networkInfrastructure->isChecked() ){ | 89 | if( networkInfrastructure->isChecked() ){ |
90 | config->writeEntry( "Mode", "Managed" ); | 90 | config->writeEntry( "Mode", "Managed" ); |
91 | } else if( network802->isChecked() ){ | 91 | } else if( network802->isChecked() ){ |
92 | config->writeEntry( "Mode", "adhoc" ); | 92 | config->writeEntry( "Mode", "adhoc" ); |
93 | } | 93 | } |
94 | config->writeEntry( "CHANNEL", networkChannel->value() ); | 94 | config->writeEntry( "CHANNEL", networkChannel->value() ); |
95 | // config->readEntry( "RATE", "auto" ); | 95 | // config->readEntry( "RATE", "auto" ); |
96 | wepEnabled->isChecked() ? config->writeEntry( "dot11PrivacyInvoked", "true" ) : config->writeEntry( "dot11PrivacyInvoked", "false" ); | 96 | wepEnabled->isChecked() ? config->writeEntry( "dot11PrivacyInvoked", "true" ) : config->writeEntry( "dot11PrivacyInvoked", "false" ); |
97 | authOpen->isChecked() ? config->writeEntry( "AuthType", "opensystem" ) : config->writeEntry( "AuthType", "sharedkey" ); | 97 | authOpen->isChecked() ? config->writeEntry( "AuthType", "opensystem" ) : config->writeEntry( "AuthType", "sharedkey" ); |
98 | key40->isChecked() ? config->writeEntry( "PRIV_KEY128", "false" ) : config->writeEntry( "PRIV_KEY128", "true" ); | 98 | key40->isChecked() ? config->writeEntry( "PRIV_KEY128", "false" ) : config->writeEntry( "PRIV_KEY128", "true" ); |
99 | if( keyRadio0->isChecked() ){ | 99 | if( keyRadio0->isChecked() ){ |
100 | config->writeEntry( "dot11WEPDefaultKeyID", 0 ); | 100 | config->writeEntry( "dot11WEPDefaultKeyID", 0 ); |
101 | } else if( keyRadio1->isChecked() ){ | 101 | } else if( keyRadio1->isChecked() ){ |
102 | config->writeEntry( "dot11WEPDefaultKeyID", 1 ); | 102 | config->writeEntry( "dot11WEPDefaultKeyID", 1 ); |
103 | } else if( keyRadio2->isChecked() ){ | 103 | } else if( keyRadio2->isChecked() ){ |
104 | config->writeEntry( "dot11WEPDefaultKeyID", 2 ); | 104 | config->writeEntry( "dot11WEPDefaultKeyID", 2 ); |
105 | } else if( keyRadio3->isChecked() ){ | 105 | } else if( keyRadio3->isChecked() ){ |
106 | config->writeEntry( "dot11WEPDefaultKeyID", 3 ); | 106 | config->writeEntry( "dot11WEPDefaultKeyID", 3 ); |
107 | } | 107 | } |
108 | config->writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() ); | 108 | config->writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() ); |
109 | config->writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() ); | 109 | config->writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() ); |
110 | config->writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() ); | 110 | config->writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() ); |
111 | config->writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() ); | 111 | config->writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() ); |
112 | return true; | ||
113 | return writeWirelessOpts( ); | 112 | return writeWirelessOpts( ); |
114 | } | 113 | } |
115 | 114 | ||
116 | /** | 115 | /** |
117 | */ | 116 | */ |
118 | void WLANImp::accept() | 117 | void WLANImp::accept() |
119 | { | 118 | { |
120 | if ( writeConfig() ){ | 119 | if ( writeConfig() ){ |
121 | interfaceSetup->saveChanges(); | 120 | interfaceSetup->saveChanges(); |
122 | QDialog::accept(); | 121 | QDialog::accept(); |
123 | } | 122 | } |
124 | } | 123 | } |
125 | 124 | ||
126 | bool WLANImp::writeWirelessOpts( QString scheme ) | 125 | bool WLANImp::writeWirelessOpts( QString scheme ) |
127 | { | 126 | { |
128 | qWarning( "WLANImp::writeWirelessOpts entered." ); | 127 | qWarning( "WLANImp::writeWirelessOpts entered." ); |
129 | QString prev = "/etc/pcmcia/wireless.opts"; | 128 | QString prev = "/etc/pcmcia/wireless.opts"; |
130 | QFile prevFile(prev); | 129 | QFile prevFile(prev); |
131 | if ( !prevFile.open( IO_ReadOnly ) ) | 130 | if ( !prevFile.open( IO_ReadOnly ) ) |
132 | return false; | 131 | return false; |
133 | 132 | ||
134 | QString tmp = "/etc/pcmcia/wireless.opts-qpe-new"; | 133 | QString tmp = "/etc/pcmcia/wireless.opts-qpe-new"; |
135 | QFile tmpFile(tmp); | 134 | QFile tmpFile(tmp); |
136 | if ( !tmpFile.open( IO_WriteOnly ) ) | 135 | if ( !tmpFile.open( IO_WriteOnly ) ) |
137 | return false; | 136 | return false; |
138 | 137 | ||
139 | bool retval = true; | 138 | bool retval = true; |
140 | 139 | ||
141 | QTextStream in( &prevFile ); | 140 | QTextStream in( &prevFile ); |
142 | QTextStream out( &tmpFile ); | 141 | QTextStream out( &tmpFile ); |
143 | 142 | ||
144 | config->setGroup("Properties"); | 143 | config->setGroup("Properties"); |
145 | 144 | ||
146 | QString line; | 145 | QString line; |
147 | bool found=false; | 146 | bool found=false; |
148 | bool done=false; | 147 | bool done=false; |
149 | while ( !in.atEnd() ) { | 148 | while ( !in.atEnd() ) { |
150 | QString line = in.readLine(); | 149 | QString line = in.readLine(); |
151 | QString wline = line.simplifyWhiteSpace(); | 150 | QString wline = line.simplifyWhiteSpace(); |
152 | if ( !done ) { | 151 | if ( !done ) { |
153 | if ( found ) { | 152 | if ( found ) { |
154 | // skip existing entry for this scheme, and write our own. | 153 | // skip existing entry for this scheme, and write our own. |
155 | if ( wline == ";;" ) { | 154 | if ( wline == ";;" ) { |
156 | found = false; | 155 | found = false; |
157 | continue; | 156 | continue; |
158 | } else { | 157 | } else { |
159 | continue; | 158 | continue; |
160 | } | 159 | } |
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index 7c902e0..a466020 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp | |||
@@ -64,97 +64,96 @@ void WLANImp::readConfig() | |||
64 | keyRadio1->setChecked( true ); | 64 | keyRadio1->setChecked( true ); |
65 | break; | 65 | break; |
66 | case 2: | 66 | case 2: |
67 | keyRadio2->setChecked( true ); | 67 | keyRadio2->setChecked( true ); |
68 | break; | 68 | break; |
69 | case 3: | 69 | case 3: |
70 | keyRadio3->setChecked( true ); | 70 | keyRadio3->setChecked( true ); |
71 | break; | 71 | break; |
72 | } | 72 | } |
73 | keyLineEdit0->setText(config->readEntry( "dot11WEPDefaultKey0" )); | 73 | keyLineEdit0->setText(config->readEntry( "dot11WEPDefaultKey0" )); |
74 | keyLineEdit1->setText(config->readEntry( "dot11WEPDefaultKey1" )); | 74 | keyLineEdit1->setText(config->readEntry( "dot11WEPDefaultKey1" )); |
75 | keyLineEdit2->setText(config->readEntry( "dot11WEPDefaultKey2" )); | 75 | keyLineEdit2->setText(config->readEntry( "dot11WEPDefaultKey2" )); |
76 | keyLineEdit3->setText(config->readEntry( "dot11WEPDefaultKey3" )); | 76 | keyLineEdit3->setText(config->readEntry( "dot11WEPDefaultKey3" )); |
77 | return; | 77 | return; |
78 | } | 78 | } |
79 | 79 | ||
80 | bool WLANImp::writeConfig() | 80 | bool WLANImp::writeConfig() |
81 | { | 81 | { |
82 | qWarning( "WLANImp::writeConfig() called." ); | 82 | qWarning( "WLANImp::writeConfig() called." ); |
83 | config->setGroup( "Properties" ); | 83 | config->setGroup( "Properties" ); |
84 | if( essNon->isChecked() ) { | 84 | if( essNon->isChecked() ) { |
85 | config->writeEntry( "SSID", "any" ); | 85 | config->writeEntry( "SSID", "any" ); |
86 | } else { | 86 | } else { |
87 | config->writeEntry( "SSID", essSpecificLineEdit->text() ); | 87 | config->writeEntry( "SSID", essSpecificLineEdit->text() ); |
88 | } | 88 | } |
89 | if( networkInfrastructure->isChecked() ){ | 89 | if( networkInfrastructure->isChecked() ){ |
90 | config->writeEntry( "Mode", "Managed" ); | 90 | config->writeEntry( "Mode", "Managed" ); |
91 | } else if( network802->isChecked() ){ | 91 | } else if( network802->isChecked() ){ |
92 | config->writeEntry( "Mode", "adhoc" ); | 92 | config->writeEntry( "Mode", "adhoc" ); |
93 | } | 93 | } |
94 | config->writeEntry( "CHANNEL", networkChannel->value() ); | 94 | config->writeEntry( "CHANNEL", networkChannel->value() ); |
95 | // config->readEntry( "RATE", "auto" ); | 95 | // config->readEntry( "RATE", "auto" ); |
96 | wepEnabled->isChecked() ? config->writeEntry( "dot11PrivacyInvoked", "true" ) : config->writeEntry( "dot11PrivacyInvoked", "false" ); | 96 | wepEnabled->isChecked() ? config->writeEntry( "dot11PrivacyInvoked", "true" ) : config->writeEntry( "dot11PrivacyInvoked", "false" ); |
97 | authOpen->isChecked() ? config->writeEntry( "AuthType", "opensystem" ) : config->writeEntry( "AuthType", "sharedkey" ); | 97 | authOpen->isChecked() ? config->writeEntry( "AuthType", "opensystem" ) : config->writeEntry( "AuthType", "sharedkey" ); |
98 | key40->isChecked() ? config->writeEntry( "PRIV_KEY128", "false" ) : config->writeEntry( "PRIV_KEY128", "true" ); | 98 | key40->isChecked() ? config->writeEntry( "PRIV_KEY128", "false" ) : config->writeEntry( "PRIV_KEY128", "true" ); |
99 | if( keyRadio0->isChecked() ){ | 99 | if( keyRadio0->isChecked() ){ |
100 | config->writeEntry( "dot11WEPDefaultKeyID", 0 ); | 100 | config->writeEntry( "dot11WEPDefaultKeyID", 0 ); |
101 | } else if( keyRadio1->isChecked() ){ | 101 | } else if( keyRadio1->isChecked() ){ |
102 | config->writeEntry( "dot11WEPDefaultKeyID", 1 ); | 102 | config->writeEntry( "dot11WEPDefaultKeyID", 1 ); |
103 | } else if( keyRadio2->isChecked() ){ | 103 | } else if( keyRadio2->isChecked() ){ |
104 | config->writeEntry( "dot11WEPDefaultKeyID", 2 ); | 104 | config->writeEntry( "dot11WEPDefaultKeyID", 2 ); |
105 | } else if( keyRadio3->isChecked() ){ | 105 | } else if( keyRadio3->isChecked() ){ |
106 | config->writeEntry( "dot11WEPDefaultKeyID", 3 ); | 106 | config->writeEntry( "dot11WEPDefaultKeyID", 3 ); |
107 | } | 107 | } |
108 | config->writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() ); | 108 | config->writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() ); |
109 | config->writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() ); | 109 | config->writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() ); |
110 | config->writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() ); | 110 | config->writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() ); |
111 | config->writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() ); | 111 | config->writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() ); |
112 | return true; | ||
113 | return writeWirelessOpts( ); | 112 | return writeWirelessOpts( ); |
114 | } | 113 | } |
115 | 114 | ||
116 | /** | 115 | /** |
117 | */ | 116 | */ |
118 | void WLANImp::accept() | 117 | void WLANImp::accept() |
119 | { | 118 | { |
120 | if ( writeConfig() ){ | 119 | if ( writeConfig() ){ |
121 | interfaceSetup->saveChanges(); | 120 | interfaceSetup->saveChanges(); |
122 | QDialog::accept(); | 121 | QDialog::accept(); |
123 | } | 122 | } |
124 | } | 123 | } |
125 | 124 | ||
126 | bool WLANImp::writeWirelessOpts( QString scheme ) | 125 | bool WLANImp::writeWirelessOpts( QString scheme ) |
127 | { | 126 | { |
128 | qWarning( "WLANImp::writeWirelessOpts entered." ); | 127 | qWarning( "WLANImp::writeWirelessOpts entered." ); |
129 | QString prev = "/etc/pcmcia/wireless.opts"; | 128 | QString prev = "/etc/pcmcia/wireless.opts"; |
130 | QFile prevFile(prev); | 129 | QFile prevFile(prev); |
131 | if ( !prevFile.open( IO_ReadOnly ) ) | 130 | if ( !prevFile.open( IO_ReadOnly ) ) |
132 | return false; | 131 | return false; |
133 | 132 | ||
134 | QString tmp = "/etc/pcmcia/wireless.opts-qpe-new"; | 133 | QString tmp = "/etc/pcmcia/wireless.opts-qpe-new"; |
135 | QFile tmpFile(tmp); | 134 | QFile tmpFile(tmp); |
136 | if ( !tmpFile.open( IO_WriteOnly ) ) | 135 | if ( !tmpFile.open( IO_WriteOnly ) ) |
137 | return false; | 136 | return false; |
138 | 137 | ||
139 | bool retval = true; | 138 | bool retval = true; |
140 | 139 | ||
141 | QTextStream in( &prevFile ); | 140 | QTextStream in( &prevFile ); |
142 | QTextStream out( &tmpFile ); | 141 | QTextStream out( &tmpFile ); |
143 | 142 | ||
144 | config->setGroup("Properties"); | 143 | config->setGroup("Properties"); |
145 | 144 | ||
146 | QString line; | 145 | QString line; |
147 | bool found=false; | 146 | bool found=false; |
148 | bool done=false; | 147 | bool done=false; |
149 | while ( !in.atEnd() ) { | 148 | while ( !in.atEnd() ) { |
150 | QString line = in.readLine(); | 149 | QString line = in.readLine(); |
151 | QString wline = line.simplifyWhiteSpace(); | 150 | QString wline = line.simplifyWhiteSpace(); |
152 | if ( !done ) { | 151 | if ( !done ) { |
153 | if ( found ) { | 152 | if ( found ) { |
154 | // skip existing entry for this scheme, and write our own. | 153 | // skip existing entry for this scheme, and write our own. |
155 | if ( wline == ";;" ) { | 154 | if ( wline == ";;" ) { |
156 | found = false; | 155 | found = false; |
157 | continue; | 156 | continue; |
158 | } else { | 157 | } else { |
159 | continue; | 158 | continue; |
160 | } | 159 | } |