summaryrefslogtreecommitdiff
authorbenmeyer <benmeyer>2002-10-16 21:00:21 (UTC)
committer benmeyer <benmeyer>2002-10-16 21:00:21 (UTC)
commit8834d3ee866fe9f0c093bf50fa78b4e0f5d2018c (patch) (side-by-side diff)
tree6b0468933071ea8a0398ca3aaeb18cf8e2c23d86
parent47769211862108250127a0c5c413c38c530c8fd8 (diff)
downloadopie-8834d3ee866fe9f0c093bf50fa78b4e0f5d2018c.zip
opie-8834d3ee866fe9f0c093bf50fa78b4e0f5d2018c.tar.gz
opie-8834d3ee866fe9f0c093bf50fa78b4e0f5d2018c.tar.bz2
fix segfault
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/wlan/wlanimp.cpp4
-rw-r--r--noncore/net/networksetup/wlan/wlanmodule.cpp4
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp4
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp4
4 files changed, 8 insertions, 8 deletions
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp
index 60ffeeb..806643d 100644
--- a/noncore/net/networksetup/wlan/wlanimp.cpp
+++ b/noncore/net/networksetup/wlan/wlanimp.cpp
@@ -59,98 +59,98 @@ void WLANImp::readConfig()
}
keyLineEdit0->setText(config.readEntry( "dot11WEPDefaultKey0" ));
keyLineEdit1->setText(config.readEntry( "dot11WEPDefaultKey1" ));
keyLineEdit2->setText(config.readEntry( "dot11WEPDefaultKey2" ));
keyLineEdit3->setText(config.readEntry( "dot11WEPDefaultKey3" ));
return;
}
bool WLANImp::writeConfig()
{
qWarning( "WLANImp::writeConfig() called." );
config.setGroup( "Properties" );
if( essNon->isChecked() ) {
config.writeEntry( "SSID", "any" );
} else {
config.writeEntry( "SSID", essSpecificLineEdit->text() );
}
if( networkInfrastructure->isChecked() ){
config.writeEntry( "Mode", "Managed" );
} else if( network802->isChecked() ){
config.writeEntry( "Mode", "adhoc" );
}
config.writeEntry( "CHANNEL", networkChannel->value() );
// config.readEntry( "RATE", "auto" );
wepEnabled->isChecked() ? config.writeEntry( "dot11PrivacyInvoked", "true" ) : config.writeEntry( "dot11PrivacyInvoked", "false" );
authOpen->isChecked() ? config.writeEntry( "AuthType", "opensystem" ) : config.writeEntry( "AuthType", "sharedkey" );
key40->isChecked() ? config.writeEntry( "PRIV_KEY128", "false" ) : config.writeEntry( "PRIV_KEY128", "true" );
if( keyRadio0->isChecked() ){
config.writeEntry( "dot11WEPDefaultKeyID", 0 );
} else if( keyRadio1->isChecked() ){
config.writeEntry( "dot11WEPDefaultKeyID", 1 );
} else if( keyRadio2->isChecked() ){
config.writeEntry( "dot11WEPDefaultKeyID", 2 );
} else if( keyRadio3->isChecked() ){
config.writeEntry( "dot11WEPDefaultKeyID", 3 );
}
config.writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() );
config.writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() );
config.writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() );
config.writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() );
return writeWirelessOpts( config );
// return TRUE;
}
/**
*/
void WLANImp::accept()
{
- if ( writeConfig() )
- QDialog::accept();
+ if ( writeConfig() )
+ QDialog::accept();
}
void WLANImp::done ( int r )
{
QDialog::done ( r );
close ( );
}
bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
{
qWarning( "WLANImp::writeWirelessOpts entered." );
QString prev = "/etc/pcmcia/wireless.opts";
QFile prevFile(prev);
if ( !prevFile.open( IO_ReadOnly ) )
return FALSE;
QString tmp = "/etc/pcmcia/wireless.opts-qpe-new";
QFile tmpFile(tmp);
if ( !tmpFile.open( IO_WriteOnly ) )
return FALSE;
bool retval = TRUE;
QTextStream in( &prevFile );
QTextStream out( &tmpFile );
config.setGroup("Properties");
QString line;
bool found=FALSE;
bool done=FALSE;
while ( !in.atEnd() ) {
QString line = in.readLine();
QString wline = line.simplifyWhiteSpace();
if ( !done ) {
if ( found ) {
// skip existing entry for this scheme, and write our own.
if ( wline == ";;" ) {
found = FALSE;
continue;
} else {
continue;
}
} else {
if ( wline.left(scheme.length()+7) == scheme + ",*,*,*)" ) {
found=TRUE;
continue; // skip this line
} else if ( wline == "esac" || wline == "*,*,*,*)" ) {
diff --git a/noncore/net/networksetup/wlan/wlanmodule.cpp b/noncore/net/networksetup/wlan/wlanmodule.cpp
index 321fa11..98d2eb6 100644
--- a/noncore/net/networksetup/wlan/wlanmodule.cpp
+++ b/noncore/net/networksetup/wlan/wlanmodule.cpp
@@ -1,84 +1,84 @@
#include "wlanmodule.h"
#include <qpe/config.h>
#include "wlanimp.h"
/**
* Constructor, find all of the possible interfaces
*/
WLANModule::WLANModule() : Module() {
// get output from iwconfig
}
/**
* get the icon name for this device.
* @param Interface* can be used in determining the icon.
* @return QString the icon name (minus .png, .gif etc)
*/
QString WLANModule::getPixmapName(Interface* ){
return "wlan";
}
/**
* Check to see if the interface i is owned by this module.
* @param Interface* interface to check against
* @return bool true if i is owned by this module, false otherwise.
*/
bool WLANModule::isOwner(Interface *i){
if(i->getInterfaceName() == "eth0" || i->getInterfaceName() == "wlan0")
return true;
return false;
}
/**
* Create, set tabWiget and return the WLANConfigure Module
* @param tabWidget a pointer to the tab widget that this configure has.
* @return QWidget* pointer to the tab widget in this modules configure.
*/
QWidget *WLANModule::configure(QTabWidget **tabWidget){
- Config cfg("wireless");
- WLANImp *wlanconfig = new WLANImp(cfg);
+ Config *cfg = new Config("wireless");
+ WLANImp *wlanconfig = new WLANImp(*cfg);
(*tabWidget) = wlanconfig->tabWidget;
return wlanconfig;
}
/**
* Create, set tabWiget and return the Information Module
* @param tabWidget a pointer to the tab widget that this information has.
* @return QWidget* pointer to the tab widget in this modules info.
*/
QWidget *WLANModule::information(QTabWidget **tabWidget){
return NULL;
}
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/
QList<Interface> WLANModule::getInterfaces(){
return list;
}
/**
* Attempt to add a new interface as defined by name
* @param name the name of the type of interface that should be created given
* by possibleNewInterfaces();
* @return Interface* NULL if it was unable to be created.
*/
Interface *WLANModule::addNewInterface(QString ){
// We can't add a 802.11 interface, either the hardware will be there
// or it wont.
return NULL;
}
/**
* Attempts to remove the interface, doesn't delete i
* @return bool true if successfull, false otherwise.
*/
bool WLANModule::remove(Interface*){
// Can't remove a hardware device, you can stop it though.
return false;
}
// wlanmodule.cpp
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 60ffeeb..806643d 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -59,98 +59,98 @@ void WLANImp::readConfig()
}
keyLineEdit0->setText(config.readEntry( "dot11WEPDefaultKey0" ));
keyLineEdit1->setText(config.readEntry( "dot11WEPDefaultKey1" ));
keyLineEdit2->setText(config.readEntry( "dot11WEPDefaultKey2" ));
keyLineEdit3->setText(config.readEntry( "dot11WEPDefaultKey3" ));
return;
}
bool WLANImp::writeConfig()
{
qWarning( "WLANImp::writeConfig() called." );
config.setGroup( "Properties" );
if( essNon->isChecked() ) {
config.writeEntry( "SSID", "any" );
} else {
config.writeEntry( "SSID", essSpecificLineEdit->text() );
}
if( networkInfrastructure->isChecked() ){
config.writeEntry( "Mode", "Managed" );
} else if( network802->isChecked() ){
config.writeEntry( "Mode", "adhoc" );
}
config.writeEntry( "CHANNEL", networkChannel->value() );
// config.readEntry( "RATE", "auto" );
wepEnabled->isChecked() ? config.writeEntry( "dot11PrivacyInvoked", "true" ) : config.writeEntry( "dot11PrivacyInvoked", "false" );
authOpen->isChecked() ? config.writeEntry( "AuthType", "opensystem" ) : config.writeEntry( "AuthType", "sharedkey" );
key40->isChecked() ? config.writeEntry( "PRIV_KEY128", "false" ) : config.writeEntry( "PRIV_KEY128", "true" );
if( keyRadio0->isChecked() ){
config.writeEntry( "dot11WEPDefaultKeyID", 0 );
} else if( keyRadio1->isChecked() ){
config.writeEntry( "dot11WEPDefaultKeyID", 1 );
} else if( keyRadio2->isChecked() ){
config.writeEntry( "dot11WEPDefaultKeyID", 2 );
} else if( keyRadio3->isChecked() ){
config.writeEntry( "dot11WEPDefaultKeyID", 3 );
}
config.writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() );
config.writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() );
config.writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() );
config.writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() );
return writeWirelessOpts( config );
// return TRUE;
}
/**
*/
void WLANImp::accept()
{
- if ( writeConfig() )
- QDialog::accept();
+ if ( writeConfig() )
+ QDialog::accept();
}
void WLANImp::done ( int r )
{
QDialog::done ( r );
close ( );
}
bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
{
qWarning( "WLANImp::writeWirelessOpts entered." );
QString prev = "/etc/pcmcia/wireless.opts";
QFile prevFile(prev);
if ( !prevFile.open( IO_ReadOnly ) )
return FALSE;
QString tmp = "/etc/pcmcia/wireless.opts-qpe-new";
QFile tmpFile(tmp);
if ( !tmpFile.open( IO_WriteOnly ) )
return FALSE;
bool retval = TRUE;
QTextStream in( &prevFile );
QTextStream out( &tmpFile );
config.setGroup("Properties");
QString line;
bool found=FALSE;
bool done=FALSE;
while ( !in.atEnd() ) {
QString line = in.readLine();
QString wline = line.simplifyWhiteSpace();
if ( !done ) {
if ( found ) {
// skip existing entry for this scheme, and write our own.
if ( wline == ";;" ) {
found = FALSE;
continue;
} else {
continue;
}
} else {
if ( wline.left(scheme.length()+7) == scheme + ",*,*,*)" ) {
found=TRUE;
continue; // skip this line
} else if ( wline == "esac" || wline == "*,*,*,*)" ) {
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index 321fa11..98d2eb6 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -1,84 +1,84 @@
#include "wlanmodule.h"
#include <qpe/config.h>
#include "wlanimp.h"
/**
* Constructor, find all of the possible interfaces
*/
WLANModule::WLANModule() : Module() {
// get output from iwconfig
}
/**
* get the icon name for this device.
* @param Interface* can be used in determining the icon.
* @return QString the icon name (minus .png, .gif etc)
*/
QString WLANModule::getPixmapName(Interface* ){
return "wlan";
}
/**
* Check to see if the interface i is owned by this module.
* @param Interface* interface to check against
* @return bool true if i is owned by this module, false otherwise.
*/
bool WLANModule::isOwner(Interface *i){
if(i->getInterfaceName() == "eth0" || i->getInterfaceName() == "wlan0")
return true;
return false;
}
/**
* Create, set tabWiget and return the WLANConfigure Module
* @param tabWidget a pointer to the tab widget that this configure has.
* @return QWidget* pointer to the tab widget in this modules configure.
*/
QWidget *WLANModule::configure(QTabWidget **tabWidget){
- Config cfg("wireless");
- WLANImp *wlanconfig = new WLANImp(cfg);
+ Config *cfg = new Config("wireless");
+ WLANImp *wlanconfig = new WLANImp(*cfg);
(*tabWidget) = wlanconfig->tabWidget;
return wlanconfig;
}
/**
* Create, set tabWiget and return the Information Module
* @param tabWidget a pointer to the tab widget that this information has.
* @return QWidget* pointer to the tab widget in this modules info.
*/
QWidget *WLANModule::information(QTabWidget **tabWidget){
return NULL;
}
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/
QList<Interface> WLANModule::getInterfaces(){
return list;
}
/**
* Attempt to add a new interface as defined by name
* @param name the name of the type of interface that should be created given
* by possibleNewInterfaces();
* @return Interface* NULL if it was unable to be created.
*/
Interface *WLANModule::addNewInterface(QString ){
// We can't add a 802.11 interface, either the hardware will be there
// or it wont.
return NULL;
}
/**
* Attempts to remove the interface, doesn't delete i
* @return bool true if successfull, false otherwise.
*/
bool WLANModule::remove(Interface*){
// Can't remove a hardware device, you can stop it though.
return false;
}
// wlanmodule.cpp