summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/oglobalsettings.cpp6
-rw-r--r--libopie2/opienet/onetwork.cpp3
-rw-r--r--libopie2/opienet/onetwork.h8
3 files changed, 13 insertions, 4 deletions
diff --git a/libopie2/opiecore/oglobalsettings.cpp b/libopie2/opiecore/oglobalsettings.cpp
index 184ee69..1799529 100644
--- a/libopie2/opiecore/oglobalsettings.cpp
+++ b/libopie2/opiecore/oglobalsettings.cpp
@@ -451,51 +451,51 @@ void OGlobalSettings::initStatic() // should be called initPaths(). Don't put an
if ( (*s_autostartPath)[0] != '/' )
s_autostartPath->prepend( QDir::homeDirPath() + "/" );
*s_autostartPath = QDir::cleanDirPath( *s_autostartPath );
if ( s_autostartPath->right(1) != "/")
*s_autostartPath += "/";
*/
// Document Path
*s_documentPath = QString::null;
*s_documentPath = config->readEntry( "Documents" , *s_documentPath);
if ( (*s_documentPath)[0] != '/' )
s_documentPath->prepend( QDir::homeDirPath() + "/" );
*s_documentPath = QDir::cleanDirPath( *s_documentPath );
if ( s_documentPath->right(1) != "/")
*s_documentPath += "/";
//config->setDollarExpansion(dollarExpansion);
// Make sure this app gets the notifications about those paths
//if (kapp)
//kapp->addKipcEventMask(KIPC::SettingsChanged);
}
void OGlobalSettings::initColors()
{
- if ( not OpieHighlight ) OpieHighlight = new QColor( 156, 118, 32 );
- if ( not OpieAlternate ) OpieAlternate = new QColor( 238, 246, 255 );
- if ( not OpieGray ) OpieGray = new QColor( 220, 210, 215 );
+ if ( !OpieHighlight ) OpieHighlight = new QColor( 156, 118, 32 );
+ if ( !OpieAlternate ) OpieAlternate = new QColor( 238, 246, 255 );
+ if ( !OpieGray ) OpieGray = new QColor( 220, 210, 215 );
}
void OGlobalSettings::rereadFontSettings()
{
delete _generalFont;
_generalFont = 0L;
delete _fixedFont;
_fixedFont = 0L;
delete _menuFont;
_menuFont = 0L;
delete _toolBarFont;
_toolBarFont = 0L;
delete _windowTitleFont;
_windowTitleFont = 0L;
delete _taskbarFont;
_taskbarFont = 0L;
}
void OGlobalSettings::rereadPathSettings()
{
qDebug( "OGlobalSettings::rereadPathSettings" );
delete s_autostartPath;
s_autostartPath = 0L;
delete s_trashPath;
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 25c70e0..998b50e 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -30,48 +30,49 @@
Boston, MA 02111-1307, USA.
*/
/* OPIE */
#include <opie2/onetwork.h>
/* QT */
#include <qfile.h>
#include <qtextstream.h>
/* UNIX */
#include <arpa/inet.h>
#include <cerrno>
#include <cstring>
#include <cstdlib>
#include <math.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
+#include <linux/sockios.h>
#include <linux/wireless.h>
using namespace std;
/*======================================================================================
* ONetwork
*======================================================================================*/
ONetwork* ONetwork::_instance = 0;
ONetwork::ONetwork()
{
qDebug( "ONetwork::ONetwork()" );
synchronize();
}
void ONetwork::synchronize()
{
// gather available interfaces by inspecting /proc/net/dev
// we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices
_interfaces.clear();
QString str;
QFile f( "/proc/net/dev" );
@@ -704,49 +705,49 @@ void OWlanNGMonitoringInterface::setChannel( int )
/*======================================================================================
* OHostAPMonitoringInterface
*======================================================================================*/
OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface )
:OMonitoringInterface( iface )
{
iface->setMonitoring( this );
}
OHostAPMonitoringInterface::~OHostAPMonitoringInterface()
{
}
void OHostAPMonitoringInterface::setEnabled( bool b )
{
// IW_MODE_MONITOR was introduced in Wireless Extensions Version 15
// Wireless Extensions < Version 15 need iwpriv commandos for monitoring
#if WIRELESS_EXT > 14
_if->_iwr.u.mode = IW_MODE_MONITOR;
_if->wioctl( SIOCSIWMODE );
#else
- int* args = (int*) &_if._iwr.u.name;
+ int* args = (int*) &_if->_iwr.u.name;
args[0] = 2;
args[1] = 0;
_if->wioctl( SIOCDEVPRIVATE );
#endif
OMonitoringInterface::setEnabled( b );
}
QString OHostAPMonitoringInterface::name() const
{
return "hostap";
}
/*======================================================================================
* OOrinocoNetworkInterface
*======================================================================================*/
OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface )
:OMonitoringInterface( iface )
{
iface->setMonitoring( this );
}
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index 936ac85..56da5f4 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -27,52 +27,60 @@
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef ONETWORK_H
#define ONETWORK_H
/* QT */
#include <qdict.h>
#include <qmap.h>
#include <qobject.h>
#include <qhostaddress.h>
/* OPIE */
#include <opie2/onetutils.h>
// ML: Yeah, I hate to include kernel headers, but it's necessary here
// ML: Recent RedHat and MandrakePatches to the Kernel and WE broke something
// ML: #include <net/if.h> e.g. conflicts with #include <linux/wireless.h>
+
+#ifndef IFNAMSIZ
#define IFNAMSIZ 16
+#endif
+
#include <linux/wireless.h>
#include <net/if.h>
+#ifndef SIOCIWFIRSTPRIV
+#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE
+#endif
+
class ONetworkInterface;
class OWirelessNetworkInterface;
class OChannelHopper;
class OMonitoringInterface;
typedef struct ifreq ifreqstruct;
typedef struct iwreq iwreqstruct;
typedef struct iw_event iweventstruct;
typedef struct iw_freq iwfreqstruct;
typedef struct iw_priv_args iwprivargsstruct;
typedef struct iw_range iwrangestruct;
/*======================================================================================
* ONetwork
*======================================================================================*/
class ONetwork : public QObject
{
Q_OBJECT
public:
typedef QDict<ONetworkInterface> InterfaceMap;
typedef QDictIterator<ONetworkInterface> InterfaceIterator;