summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/wlan
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings/wlan') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/wlan/infoimp.h2
-rw-r--r--noncore/settings/networksettings/wlan/wextensions.cpp3
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp2
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.h2
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp4
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.h18
6 files changed, 15 insertions, 16 deletions
diff --git a/noncore/settings/networksettings/wlan/infoimp.h b/noncore/settings/networksettings/wlan/infoimp.h
index 5311bea..8f7f0d6 100644
--- a/noncore/settings/networksettings/wlan/infoimp.h
+++ b/noncore/settings/networksettings/wlan/infoimp.h
@@ -1,19 +1,19 @@
#ifndef INFOIMP_H
#define INFOIMP_H
#include "info.h"
class QTimer;
-class WExtensions;
+//class WExtensions;
class WlanInfoImp : public WlanInfo {
Q_OBJECT
public:
WlanInfoImp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
private slots:
void update();
private:
//WExtensions *wExtensions;
diff --git a/noncore/settings/networksettings/wlan/wextensions.cpp b/noncore/settings/networksettings/wlan/wextensions.cpp
index eb6fc42..6335ebc 100644
--- a/noncore/settings/networksettings/wlan/wextensions.cpp
+++ b/noncore/settings/networksettings/wlan/wextensions.cpp
@@ -7,26 +7,25 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <math.h>
#define PROCNETWIRELESS "/proc/net/wireless"
#define IW_LOWER 0
#define IW_UPPER 256
/**
* Constructor. Sets hasWirelessExtensions
*/
-WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false){
- interface = interfaceName;
+WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false), interface(interfaceName) {
fd = socket( AF_INET, SOCK_DGRAM, 0 );
if(fd == -1)
return;
const char* buffer[200];
memset( &iwr, 0, sizeof( iwr ) );
iwr.u.essid.pointer = (caddr_t) buffer;
iwr.u.essid.length = IW_ESSID_MAX_SIZE;
iwr.u.essid.flags = 0;
// check if it is an IEEE 802.11 standard conform
// wireless device by sending SIOCGIWESSID
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 689eae2..d4b4af9 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -35,25 +35,25 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W
}
file.close();
settingsFileText = QStringList::split("\n", line, true);
parseSettingFile();
}
else
qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1());
}
/**
* Change the profile for both wireless settings and network settings.
*/
-void WLANImp::setProfile(QString &profile){
+void WLANImp::setProfile(const QString &profile){
interfaceSetup->setProfile(profile);
parseSettingFile();
}
/**
* Parses the settings file that was read in and gets any setting from it.
*/
void WLANImp::parseSettingFile(){
bool foundCase = false;
bool found = false;
for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) {
QString line = (*it).simplifyWhiteSpace();
diff --git a/noncore/settings/networksettings/wlan/wlanimp.h b/noncore/settings/networksettings/wlan/wlanimp.h
index f88e550..df599af 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.h
+++ b/noncore/settings/networksettings/wlan/wlanimp.h
@@ -4,25 +4,25 @@
#include "wlan.h"
#include <qstringlist.h>
class InterfaceSetupImp;
class Interface;
class Config;
class WLANImp : public WLAN {
Q_OBJECT
public:
WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 );
- void setProfile(QString &profile);
+ void setProfile(const QString &profile);
protected:
void accept();
private:
void parseSettingFile();
void changeAndSaveSettingFile();
InterfaceSetupImp *interfaceSetup;
QStringList settingsFileText;
QString currentProfile;
};
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index b14fc0a..3979e60 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -17,25 +17,25 @@ WLANModule::WLANModule() : Module() {
/**
* Delete any interfaces that we own.
*/
WLANModule::~WLANModule(){
Interface *i;
for ( i=list.first(); i != 0; i=list.next() )
delete i;
}
/**
* Change the current profile
*/
-void WLANModule::setProfile(QString newProfile){
+void WLANModule::setProfile(const QString &newProfile){
profile = newProfile;
}
/**
* 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";
}
@@ -85,25 +85,25 @@ QWidget *WLANModule::information(Interface *i){
* 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 ){
+Interface *WLANModule::addNewInterface(const 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;
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.h b/noncore/settings/networksettings/wlan/wlanmodule.h
index a81ccff..3a54de6 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.h
+++ b/noncore/settings/networksettings/wlan/wlanmodule.h
@@ -3,33 +3,33 @@
#include "module.h"
class WLANModule : Module{
signals:
void updateInterface(Interface *i);
public:
WLANModule();
~WLANModule();
- virtual void setProfile(QString newProfile);
- virtual bool isOwner(Interface *);
- virtual QWidget *configure(Interface *i);
- virtual QWidget *information(Interface *i);
- virtual QList<Interface> getInterfaces();
- virtual void possibleNewInterfaces(QMap<QString, QString> &){};
- virtual Interface *addNewInterface(QString name);
- virtual bool remove(Interface* i);
- virtual QString getPixmapName(Interface* i);
+ void setProfile(const QString &newProfile);
+ bool isOwner(Interface *);
+ QWidget *configure(Interface *i);
+ QWidget *information(Interface *i);
+ QList<Interface> getInterfaces();
+ void possibleNewInterfaces(QMap<QString, QString> &){};
+ Interface *addNewInterface(const QString &name);
+ bool remove(Interface* i);
+ QString getPixmapName(Interface* i);
private:
QList<Interface> list;
QString profile;
};
extern "C"
{
void* create_plugin() {
return new WLANModule();
}