summaryrefslogtreecommitdiff
Unidiff
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
451 if ( (*s_autostartPath)[0] != '/' ) 451 if ( (*s_autostartPath)[0] != '/' )
452 s_autostartPath->prepend( QDir::homeDirPath() + "/" ); 452 s_autostartPath->prepend( QDir::homeDirPath() + "/" );
453 *s_autostartPath = QDir::cleanDirPath( *s_autostartPath ); 453 *s_autostartPath = QDir::cleanDirPath( *s_autostartPath );
454 if ( s_autostartPath->right(1) != "/") 454 if ( s_autostartPath->right(1) != "/")
455 *s_autostartPath += "/"; 455 *s_autostartPath += "/";
456*/ 456*/
457 // Document Path 457 // Document Path
458 *s_documentPath = QString::null; 458 *s_documentPath = QString::null;
459 *s_documentPath = config->readEntry( "Documents" , *s_documentPath); 459 *s_documentPath = config->readEntry( "Documents" , *s_documentPath);
460 if ( (*s_documentPath)[0] != '/' ) 460 if ( (*s_documentPath)[0] != '/' )
461 s_documentPath->prepend( QDir::homeDirPath() + "/" ); 461 s_documentPath->prepend( QDir::homeDirPath() + "/" );
462 *s_documentPath = QDir::cleanDirPath( *s_documentPath ); 462 *s_documentPath = QDir::cleanDirPath( *s_documentPath );
463 if ( s_documentPath->right(1) != "/") 463 if ( s_documentPath->right(1) != "/")
464 *s_documentPath += "/"; 464 *s_documentPath += "/";
465 465
466 //config->setDollarExpansion(dollarExpansion); 466 //config->setDollarExpansion(dollarExpansion);
467 467
468 // Make sure this app gets the notifications about those paths 468 // Make sure this app gets the notifications about those paths
469 //if (kapp) 469 //if (kapp)
470 //kapp->addKipcEventMask(KIPC::SettingsChanged); 470 //kapp->addKipcEventMask(KIPC::SettingsChanged);
471} 471}
472 472
473void OGlobalSettings::initColors() 473void OGlobalSettings::initColors()
474{ 474{
475 if ( not OpieHighlight ) OpieHighlight = new QColor( 156, 118, 32 ); 475 if ( !OpieHighlight ) OpieHighlight = new QColor( 156, 118, 32 );
476 if ( not OpieAlternate ) OpieAlternate = new QColor( 238, 246, 255 ); 476 if ( !OpieAlternate ) OpieAlternate = new QColor( 238, 246, 255 );
477 if ( not OpieGray ) OpieGray = new QColor( 220, 210, 215 ); 477 if ( !OpieGray ) OpieGray = new QColor( 220, 210, 215 );
478} 478}
479 479
480void OGlobalSettings::rereadFontSettings() 480void OGlobalSettings::rereadFontSettings()
481{ 481{
482 delete _generalFont; 482 delete _generalFont;
483 _generalFont = 0L; 483 _generalFont = 0L;
484 delete _fixedFont; 484 delete _fixedFont;
485 _fixedFont = 0L; 485 _fixedFont = 0L;
486 delete _menuFont; 486 delete _menuFont;
487 _menuFont = 0L; 487 _menuFont = 0L;
488 delete _toolBarFont; 488 delete _toolBarFont;
489 _toolBarFont = 0L; 489 _toolBarFont = 0L;
490 delete _windowTitleFont; 490 delete _windowTitleFont;
491 _windowTitleFont = 0L; 491 _windowTitleFont = 0L;
492 delete _taskbarFont; 492 delete _taskbarFont;
493 _taskbarFont = 0L; 493 _taskbarFont = 0L;
494} 494}
495 495
496void OGlobalSettings::rereadPathSettings() 496void OGlobalSettings::rereadPathSettings()
497{ 497{
498 qDebug( "OGlobalSettings::rereadPathSettings" ); 498 qDebug( "OGlobalSettings::rereadPathSettings" );
499 delete s_autostartPath; 499 delete s_autostartPath;
500 s_autostartPath = 0L; 500 s_autostartPath = 0L;
501 delete s_trashPath; 501 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 @@
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34/* OPIE */ 34/* OPIE */
35 35
36#include <opie2/onetwork.h> 36#include <opie2/onetwork.h>
37 37
38/* QT */ 38/* QT */
39 39
40#include <qfile.h> 40#include <qfile.h>
41#include <qtextstream.h> 41#include <qtextstream.h>
42 42
43/* UNIX */ 43/* UNIX */
44 44
45#include <arpa/inet.h> 45#include <arpa/inet.h>
46#include <cerrno> 46#include <cerrno>
47#include <cstring> 47#include <cstring>
48#include <cstdlib> 48#include <cstdlib>
49#include <math.h> 49#include <math.h>
50#include <sys/ioctl.h> 50#include <sys/ioctl.h>
51#include <sys/socket.h> 51#include <sys/socket.h>
52#include <sys/types.h> 52#include <sys/types.h>
53#include <unistd.h> 53#include <unistd.h>
54#include <linux/sockios.h>
54#include <linux/wireless.h> 55#include <linux/wireless.h>
55 56
56using namespace std; 57using namespace std;
57 58
58/*====================================================================================== 59/*======================================================================================
59 * ONetwork 60 * ONetwork
60 *======================================================================================*/ 61 *======================================================================================*/
61 62
62ONetwork* ONetwork::_instance = 0; 63ONetwork* ONetwork::_instance = 0;
63 64
64ONetwork::ONetwork() 65ONetwork::ONetwork()
65{ 66{
66 qDebug( "ONetwork::ONetwork()" ); 67 qDebug( "ONetwork::ONetwork()" );
67 synchronize(); 68 synchronize();
68} 69}
69 70
70void ONetwork::synchronize() 71void ONetwork::synchronize()
71{ 72{
72 // gather available interfaces by inspecting /proc/net/dev 73 // gather available interfaces by inspecting /proc/net/dev
73 // we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices 74 // we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices
74 75
75 _interfaces.clear(); 76 _interfaces.clear();
76 QString str; 77 QString str;
77 QFile f( "/proc/net/dev" ); 78 QFile f( "/proc/net/dev" );
@@ -704,49 +705,49 @@ void OWlanNGMonitoringInterface::setChannel( int )
704 705
705/*====================================================================================== 706/*======================================================================================
706 * OHostAPMonitoringInterface 707 * OHostAPMonitoringInterface
707 *======================================================================================*/ 708 *======================================================================================*/
708 709
709OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface ) 710OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface )
710 :OMonitoringInterface( iface ) 711 :OMonitoringInterface( iface )
711{ 712{
712 iface->setMonitoring( this ); 713 iface->setMonitoring( this );
713} 714}
714 715
715OHostAPMonitoringInterface::~OHostAPMonitoringInterface() 716OHostAPMonitoringInterface::~OHostAPMonitoringInterface()
716{ 717{
717} 718}
718 719
719void OHostAPMonitoringInterface::setEnabled( bool b ) 720void OHostAPMonitoringInterface::setEnabled( bool b )
720{ 721{
721 // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15 722 // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15
722 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring 723 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring
723 724
724 #if WIRELESS_EXT > 14 725 #if WIRELESS_EXT > 14
725 _if->_iwr.u.mode = IW_MODE_MONITOR; 726 _if->_iwr.u.mode = IW_MODE_MONITOR;
726 _if->wioctl( SIOCSIWMODE ); 727 _if->wioctl( SIOCSIWMODE );
727 #else 728 #else
728 int* args = (int*) &_if._iwr.u.name; 729 int* args = (int*) &_if->_iwr.u.name;
729 args[0] = 2; 730 args[0] = 2;
730 args[1] = 0; 731 args[1] = 0;
731 _if->wioctl( SIOCDEVPRIVATE ); 732 _if->wioctl( SIOCDEVPRIVATE );
732 #endif 733 #endif
733 734
734 OMonitoringInterface::setEnabled( b ); 735 OMonitoringInterface::setEnabled( b );
735} 736}
736 737
737 738
738QString OHostAPMonitoringInterface::name() const 739QString OHostAPMonitoringInterface::name() const
739{ 740{
740 return "hostap"; 741 return "hostap";
741} 742}
742 743
743 744
744/*====================================================================================== 745/*======================================================================================
745 * OOrinocoNetworkInterface 746 * OOrinocoNetworkInterface
746 *======================================================================================*/ 747 *======================================================================================*/
747 748
748OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface ) 749OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface )
749 :OMonitoringInterface( iface ) 750 :OMonitoringInterface( iface )
750{ 751{
751 iface->setMonitoring( this ); 752 iface->setMonitoring( this );
752} 753}
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 @@
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34#ifndef ONETWORK_H 34#ifndef ONETWORK_H
35#define ONETWORK_H 35#define ONETWORK_H
36 36
37/* QT */ 37/* QT */
38 38
39#include <qdict.h> 39#include <qdict.h>
40#include <qmap.h> 40#include <qmap.h>
41#include <qobject.h> 41#include <qobject.h>
42#include <qhostaddress.h> 42#include <qhostaddress.h>
43 43
44/* OPIE */ 44/* OPIE */
45 45
46#include <opie2/onetutils.h> 46#include <opie2/onetutils.h>
47 47
48// ML: Yeah, I hate to include kernel headers, but it's necessary here 48// ML: Yeah, I hate to include kernel headers, but it's necessary here
49// ML: Recent RedHat and MandrakePatches to the Kernel and WE broke something 49// ML: Recent RedHat and MandrakePatches to the Kernel and WE broke something
50// ML: #include <net/if.h> e.g. conflicts with #include <linux/wireless.h> 50// ML: #include <net/if.h> e.g. conflicts with #include <linux/wireless.h>
51
52#ifndef IFNAMSIZ
51#define IFNAMSIZ 16 53#define IFNAMSIZ 16
54#endif
55
52#include <linux/wireless.h> 56#include <linux/wireless.h>
53#include <net/if.h> 57#include <net/if.h>
54 58
59#ifndef SIOCIWFIRSTPRIV
60#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE
61#endif
62
55class ONetworkInterface; 63class ONetworkInterface;
56class OWirelessNetworkInterface; 64class OWirelessNetworkInterface;
57class OChannelHopper; 65class OChannelHopper;
58class OMonitoringInterface; 66class OMonitoringInterface;
59 67
60typedef struct ifreq ifreqstruct; 68typedef struct ifreq ifreqstruct;
61typedef struct iwreq iwreqstruct; 69typedef struct iwreq iwreqstruct;
62typedef struct iw_event iweventstruct; 70typedef struct iw_event iweventstruct;
63typedef struct iw_freq iwfreqstruct; 71typedef struct iw_freq iwfreqstruct;
64typedef struct iw_priv_args iwprivargsstruct; 72typedef struct iw_priv_args iwprivargsstruct;
65typedef struct iw_range iwrangestruct; 73typedef struct iw_range iwrangestruct;
66 74
67/*====================================================================================== 75/*======================================================================================
68 * ONetwork 76 * ONetwork
69 *======================================================================================*/ 77 *======================================================================================*/
70 78
71class ONetwork : public QObject 79class ONetwork : public QObject
72{ 80{
73 Q_OBJECT 81 Q_OBJECT
74 82
75 public: 83 public:
76 typedef QDict<ONetworkInterface> InterfaceMap; 84 typedef QDict<ONetworkInterface> InterfaceMap;
77 typedef QDictIterator<ONetworkInterface> InterfaceIterator; 85 typedef QDictIterator<ONetworkInterface> InterfaceIterator;
78 86