author | mickeyl <mickeyl> | 2003-12-01 22:44:38 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-12-01 22:44:38 (UTC) |
commit | 7a7683d435cfbb4fa2d6ed99fd4a94d388402aec (patch) (side-by-side diff) | |
tree | 1a34de131d935f34dd2622e3606ba664a7783e24 /libopie2 | |
parent | a4a47fca8badeca2b1aae51b39295ccdc8782c4f (diff) | |
download | opie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.zip opie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.tar.gz opie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.tar.bz2 |
slowly start to refactor & cleanup libopie2 before merging it with libopie1
36 files changed, 158 insertions, 111 deletions
diff --git a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp index 74886fa..e8bf04f 100644 --- a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp +++ b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp @@ -63,70 +63,72 @@ public: connect( info, SIGNAL( clicked() ), this, SLOT( emitInfoOutput() ) ); QPushButton* warn = new QPushButton( "Emit a Warning Output!", vbox ); connect( warn, SIGNAL( clicked() ), this, SLOT( emitWarningOutput() ) ); QPushButton* error = new QPushButton( "Emit an Error Output!", vbox ); connect( error, SIGNAL( clicked() ), this, SLOT( emitErrorOutput() ) ); QPushButton* fatal = new QPushButton( "Emit a Fatal Output!", vbox ); connect( fatal, SIGNAL( clicked() ), this, SLOT( emitFatalOutput() ) ); QPushButton* tb = new QPushButton( "Emit a Fatal Backtrace!", vbox ); connect( tb, SIGNAL( clicked() ), this, SLOT( emitTBOutput() ) ); info->show(); warn->show(); error->show(); fatal->show(); tb->show(); g->show(); hbox->show(); e->show(); vbox->show(); showMainWidget( vbox ); } public slots: void chooseMethod(int method) { m = method; qDebug( "choosing method: %d", method ); OConfig* g = OGlobal::config(); g->setGroup( "General" ); g->writeEntry( "debugMode", m ); e->setText( OGlobalSettings::debugOutput() ); + g->write(); } void updateDebugOutput() { OConfig* g = OGlobal::config(); g->setGroup( "General" ); g->writeEntry( "debugOutput"+QString::number(OGlobalSettings::debugMode()), e->text() ); + g->write(); } void emitInfoOutput() { odebug << "This is a debug message" << oendl; } void emitWarningOutput() { owarn << "This is a warning message" << oendl; } void emitErrorOutput() { oerr << "This is an errror message" << oendl; } void emitFatalOutput() { ofatal << "This is a fatal message" << oendl; } void emitTBOutput() { ofatal << "This is a fatal message + backtrace\n" + odBacktrace(); // odBacktrace includes \n } private: QButtonGroup* g; int m; QLineEdit* e; }; int main( int argc, char** argv ) { DemoApp* app = new DemoApp( argc, argv ); app->exec(); diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp index c49daa0..eb2e8e8 100644 --- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp +++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp @@ -2,170 +2,184 @@ #include <qsocketnotifier.h> #include <qstring.h> #include <opie2/onetwork.h> #include <qapplication.h> #include <opie2/opcap.h> #include <cerrno> #include <cstdio> #include <cstdlib> #include <cstring> //======================== Station help class =============================== class Station { public: Station( QString t, int c, bool w ) : type(t), channel(c), wep(w), beacons(1) {}; ~Station() {}; QString type; int channel; bool wep; int beacons; }; QDict<Station> stations; //======================== Application class =============================== class Wellenreiter : public QApplication { Q_OBJECT public: - Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ) + Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ), channel( 1 ) { ONetwork* net = ONetwork::instance(); if ( argc < 3 ) { printf( "Usage: ./%s <interface> <driver> <interval>\n", argv[0] ); printf( "\n" ); printf( "Valid wireless interfaces (detected) are:\n" ); ONetwork::InterfaceIterator it = net->iterator(); while ( it.current() ) { if ( it.current()->isWireless() ) { printf( " - '%s' (MAC=%s) (IPv4=%s)\n", (const char*) it.current()->name(), (const char*) it.current()->macAddress().toString(), (const char*) it.current()->ipV4Address() ); } ++it; } exit( -1 ); } - printf( "****************************************************\n" ); - printf( "* Wellenreiter mini edition 1.0 (C) 2003 M-M-M *\n" ); - printf( "****************************************************\n" ); + printf( "*******************************************************************\n" ); + printf( "* Wellenreiter mini edition 1.0.0 (C) 2003 Michael 'Mickey' Lauer *\n" ); + printf( "*******************************************************************\n" ); printf( "\n\n" ); QString interface( argv[1] ); QString driver( argv[2] ); printf( "Trying to use '%s' as %s-controlled device...\n", (const char*) interface, (const char*) driver ); // sanity checks before downcasting ONetworkInterface* iface = net->interface( interface ); if ( !iface ) { printf( "Interface '%s' doesn't exist. Exiting.\n", (const char*) interface ); exit( -1 ); } if ( !iface->isWireless() ) { printf( "Interface '%s' doesn't support wireless extensions. Exiting.\n", (const char*) interface ); exit( -1 ); } // downcast should be safe now wiface = (OWirelessNetworkInterface*) iface; printf( "Using wireless interface '%s' for scanning (current SSID is '%s')...\n", (const char*) interface, (const char*) wiface->SSID() ); // ifconfig +promisc the interface to receive all packets if ( !wiface->promiscuousMode() ) { printf( "Interface status is not promisc... switching to promisc... " ); wiface->setPromiscuousMode( true ); if ( !wiface->promiscuousMode() ) { printf( "failed (%s). Exiting.\n", strerror( errno ) ); exit( -1 ); } else { printf( "ok.\n" ); } } else printf( "Interface status is already promisc - good.\n" ); // connect a monitoring strategy to the interface if ( driver == "orinoco" ) new OOrinocoMonitoringInterface( wiface, false ); else + if ( driver == "hostap" ) + new OHostAPMonitoringInterface( wiface, false ); + else + if ( driver == "wlan-ng" ) + new OWlanNGMonitoringInterface( wiface, false ); + else { printf( "Unknown driver. Exiting\n" ); exit( -1 ); } // enable monitoring mode printf( "Enabling monitor mode...\n" ); - //wiface->setMonitorMode( true ); + wiface->setMode( "monitor" ); // open a packet capturer cap = new OPacketCapturer(); cap->open( interface ); if ( !cap->isOpen() ) { printf( "Unable to open libpcap (%s). Exiting.\n", strerror( errno ) ); exit( -1 ); } // set capturer to non-blocking mode cap->setBlocking( false ); // start channel hopper //wiface->setChannelHopping( 1000 ); // connect connect( cap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); + // timer + startTimer( 1000 ); } ~Wellenreiter() {}; public slots: + virtual void timerEvent(QTimerEvent* e) + { + wiface->setChannel( channel++ ); + if ( channel == 14 ) channel = 1; + } + void receivePacket(OPacket* p) { if (!p) { printf( "(empty packet received)\n" ); return; } OWaveLanManagementPacket* beacon = (OWaveLanManagementPacket*) p->child( "802.11 Management" ); if ( beacon ) { OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); QString essid = ssid ? ssid->ID() : "<unknown>"; if ( stations.find( essid ) ) stations[essid]->beacons++; else { printf( "found new network @ channel %d, SSID = '%s'\n", wiface->channel(), (const char*) essid ); stations.insert( essid, new Station( "unknown", wiface->channel(), ((OWaveLanPacket*) beacon->parent())->usesWep() ) ); } return; } OWaveLanDataPacket* data = (OWaveLanDataPacket*) p->child( "802.11 Data" ); if ( data ) { OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); if ( wlan->fromDS() && !wlan->toDS() ) { printf( "FromDS: '%s' -> '%s' via '%s'\n", @@ -174,44 +188,45 @@ public slots: (const char*) wlan->macAddress2().toString(true) ); } else if ( !wlan->fromDS() && wlan->toDS() ) { printf( "ToDS: '%s' -> '%s' via '%s'\n", (const char*) wlan->macAddress2().toString(true), (const char*) wlan->macAddress3().toString(true), (const char*) wlan->macAddress1().toString(true) ); } else if ( wlan->fromDS() && wlan->toDS() ) { printf( "WSD(bridge): '%s' -> '%s' via '%s' and '%s'\n", (const char*) wlan->macAddress4().toString(true), (const char*) wlan->macAddress3().toString(true), (const char*) wlan->macAddress1().toString(true), (const char*) wlan->macAddress2().toString(true) ); } else { printf( "IBSS(AdHoc): '%s' -> '%s' (Cell: '%s')'\n", (const char*) wlan->macAddress2().toString(true), (const char*) wlan->macAddress1().toString(true), (const char*) wlan->macAddress3().toString(true) ); } return; } } private: OPacketCapturer* cap; OWirelessNetworkInterface* wiface; + int channel; }; int main( int argc, char** argv ) { Wellenreiter w( argc, argv ); w.exec(); return 0; } #include "miniwellenreiter.moc" diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro index 7ce535c..b2c5c14 100644 --- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro +++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp index 06b8b19..4763316 100644 --- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp @@ -81,62 +81,63 @@ int main( int argc, char** argv ) station->dump(); } } else { qDebug( "DEMO: Warning! Scan didn't work!" ); } /* // first some wrong calls to check if this is working iface->setPrivate( "seppel", 10 ); iface->setPrivate( "monitor", 0 ); // now the real deal iface->setPrivate( "monitor", 2, 2, 3 ); // trying to set hw address to 12:34:56:AB:CD:EF /* OMacAddress addr = OMacAddress::fromString( "12:34:56:AB:CD:EF" ); iface->setUp( false ); iface->setMacAddress( addr ); iface->setUp( true ); qDebug( "DEMO: MAC Address now is '%s'", (const char*) iface->macAddress().toString() ); */ // monitor test - /* + qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); iface->setMode( "monitor" ); qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); - sleep( 1 ); */ + sleep( 1 ); - iface->setMode( "master" ); + iface->setChannel( 1 ); + iface->setMode( "managed" ); //sleep( 1 ); qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); /*iface->setMode( "adhoc" ); sleep( 1 ); qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); iface->setMode( "managed" ); sleep( 1 ); qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); iface->setMode( "master" ); sleep( 1 ); qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );*/ } ++it; } return 0; } diff --git a/libopie2/libopie2.control b/libopie2/libopie2.control index 6e11cbf..f54efd8 100644 --- a/libopie2/libopie2.control +++ b/libopie2/libopie2.control @@ -1,11 +1,11 @@ Package: libopie2 Files: Priority: optional Section: opie/system Maintainer: Opie Team <opie@handhelds.org> Architecture: arm -Version: 1.8.1-$SUB_VERSION.2 -Depends: libopiecore2 (1.8.1), libopiedb2 (1.8.1), libopiemm2 (1.8.1), libopienet2 (1.8.1), libopiepim2 (1.8.1), libopieui2 (1.8.1) +Version: 1.8.2-$SUB_VERSION.2 +Depends: libopiecore2 (1.8.2), libopiedb2 (1.8.2), libopiemm2 (1.8.2), libopienet2 (1.8.2), libopiepim2 (1.8.2), libopieui2 (1.8.2) Provides: libopie2 Description: Opie library 2.0 diff --git a/libopie2/opiecore/libopiecore2.control b/libopie2/opiecore/libopiecore2.control index 7dec1b9..956d24f 100644 --- a/libopie2/opiecore/libopiecore2.control +++ b/libopie2/opiecore/libopiecore2.control @@ -1,11 +1,11 @@ Package: libopiecore2 Files: $OPIEDIR/lib/libopiecore2.so.* Priority: optional Section: opie/system Maintainer: Opie Team <opie@handhelds.org> Architecture: arm -Version: 1.8.1-$SUB_VERSION.2 +Version: 1.8.2-$SUB_VERSION.2 Depends: libqpe1 Provides: libopiecore2 Description: Opie library 2.0 CORE diff --git a/libopie2/opiecore/oconfig.cpp b/libopie2/opiecore/oconfig.cpp index dc4d0b3..fb5eabb 100644 --- a/libopie2/opiecore/oconfig.cpp +++ b/libopie2/opiecore/oconfig.cpp @@ -10,70 +10,72 @@ .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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. */ /* QT */ #include <qfont.h> #include <qcolor.h> /* OPIE */ #include <opie2/oconfig.h> OConfig::OConfig( const QString &name, Domain domain ) - :OpieConfig( name, domain ) + :Config( name, domain ) { + qDebug( "OConfig::OConfig()" ); } OConfig::~OConfig() { + qDebug( "OConfig::~OConfig()" ); } QColor OConfig::readColorEntry( const QString& key, const QColor* pDefault ) const { QColor aRetColor; int nRed = 0, nGreen = 0, nBlue = 0; QString aValue = readEntry( key ); if( !aValue.isEmpty() ) { if ( aValue.at(0) == '#' ) { aRetColor.setNamedColor(aValue); } else { bool bOK; // find first part (red) int nIndex = aValue.find( ',' ); if( nIndex == -1 ) { // return a sensible default -- Bernd if( pDefault ) aRetColor = *pDefault; return aRetColor; } nRed = aValue.left( nIndex ).toInt( &bOK ); // find second part (green) diff --git a/libopie2/opiecore/oconfig.h b/libopie2/opiecore/oconfig.h index 75aa170..444d280 100644 --- a/libopie2/opiecore/oconfig.h +++ b/libopie2/opiecore/oconfig.h @@ -6,93 +6,93 @@ =. (C) 1997 Matthias Kalle Dalheimer <kalle@kde.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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 OCONFIG_H #define OCONFIG_H //FIXME: Implement for X11 or reuse libqpe/Config there also? //FIXME: Or rather use QSettings also for libqpe? -#include "opieconfig.h" +#include <qpe/config.h> class QColor; class QFont; /** * A Configuration class based on the Qtopia @ref Config class * featuring additional handling of color and font entries */ -class OConfig : public OpieConfig +class OConfig : public Config { public: /** * Constructs a OConfig object with a @a name. */ OConfig( const QString &name, Domain domain = User ); /** * Destructs the OConfig object. * * Writes back any dirty configuration entries, and destroys * dynamically created objects. */ virtual ~OConfig(); /** * @returns the name of the current group. * The current group is used for searching keys and accessing entries. */ - const QString& group() { return OpieConfig::group(); }; + const QString& group() { return git.key(); }; /** * @returns a @ref QColor entry or a @a default value if the key is not found. */ QColor readColorEntry( const QString& key, const QColor* pDefault ) const; /** * @returns a @ref QFont value or a @a default value if the key is not found. */ QFont readFontEntry( const QString& key, const QFont* pDefault ) const; }; /** * @brief Helper class for easier use of OConfig groups. * * Careful programmers always set the group of a * @ref OConfig object to the group they want to read from * and set it back to the old one of afterwards. This is usually * written as: * <pre> * * QString oldgroup config()->group(); * config()->setGroup( "TheGroupThatIWant" ); * ... * config()->writeEntry( "Blah", "Blubb" ); * * config()->setGroup( oldgroup ); * </pre> * * In order to facilitate this task, you can use * OConfigGroupSaver. Simply construct such an object ON THE STACK * when you want to switch to a new group. Then, when the object goes * out of scope, the group will automatically be restored. If you * want to use several different groups within a function or method, diff --git a/libopie2/opiecore/odebug.cpp b/libopie2/opiecore/odebug.cpp index b2a37bc..4505ce7 100644 --- a/libopie2/opiecore/odebug.cpp +++ b/libopie2/opiecore/odebug.cpp @@ -1,38 +1,37 @@ /* This file is part of the Opie Project (C) 2003 Michael 'Mickey' Lauer (mickey@tm.informatik.uni-frankfurt.de) - Inspired by the KDE debug classes, which are - (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) (C) 2002 Holger Freyther (freyther@kde.org) + (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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. */ // Include this header without OPIE_NO_DEBUG defined to avoid having the oDebugInfo // functions inlined to noops (which would then conflict with their definition here). #include <opie2/odebug.h> #ifdef OPIE_NO_DEBUG diff --git a/libopie2/opiecore/oglobal.cpp b/libopie2/opiecore/oglobal.cpp index f6071be..ae2fcb6 100644 --- a/libopie2/opiecore/oglobal.cpp +++ b/libopie2/opiecore/oglobal.cpp @@ -1,36 +1,43 @@ /* This file is part of the Opie Project Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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. */ #include <opie2/oglobal.h> +OConfig* OGlobal::_config = 0; + OConfig* OGlobal::config() { - return globalconfig; + if ( !OGlobal::_config ) + { + qDebug( "OGlobal::creating global configuration instance." ); + OGlobal::_config = new OConfig( "global" ); + } + return OGlobal::_config; } diff --git a/libopie2/opiecore/oglobal.h b/libopie2/opiecore/oglobal.h index 23cedde..2dc4f9e 100644 --- a/libopie2/opiecore/oglobal.h +++ b/libopie2/opiecore/oglobal.h @@ -1,49 +1,49 @@ /* This file is part of the Opie Project - - Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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 OGLOBAL_H #define OGLOBAL_H -#include <qpe/global.h> #include <opie2/oconfig.h> -static OConfig *globalconfig = new OConfig( "global" ); - -//FIXME: Is it wise or even necessary to inherit OGlobal from Global? +//FIXME Is it wise or even necessary to inherit OGlobal from Global? // once we totally skip libqpe it should ideally swallow Global -zecke +// You're right. I deleted global as the base class. -mickeyl -class OGlobal : public Global +class OGlobal { public: - // do we want to put that into OApplication as in KApplication -zecke + //FIXME Do we want to put that into OApplication as in KApplication? -zecke + // We already have a per-application config in OApplication + // ( accessed through oApp->config() ), but this one is the global one! -mickeyl static OConfig* config(); + static OConfig* _config; }; #endif // OGLOBAL_H diff --git a/libopie2/opiecore/oglobalsettings.cpp b/libopie2/opiecore/oglobalsettings.cpp index 1799529..66adbd0 100644 --- a/libopie2/opiecore/oglobalsettings.cpp +++ b/libopie2/opiecore/oglobalsettings.cpp @@ -9,64 +9,65 @@ .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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. */ /* OPIE */ #include <opie2/oglobalsettings.h> #include <opie2/oconfig.h> #include <opie2/oglobal.h> /* QT */ +#include <qobject.h> #include <qdir.h> #include <qpixmap.h> #include <qfontinfo.h> /* UNIX */ #include <stdlib.h> QString* OGlobalSettings::s_desktopPath = 0; QString* OGlobalSettings::s_autostartPath = 0; QString* OGlobalSettings::s_trashPath = 0; QString* OGlobalSettings::s_documentPath = 0; QFont *OGlobalSettings::_generalFont = 0; QFont *OGlobalSettings::_fixedFont = 0; QFont *OGlobalSettings::_toolBarFont = 0; QFont *OGlobalSettings::_menuFont = 0; QFont *OGlobalSettings::_windowTitleFont = 0; QFont *OGlobalSettings::_taskbarFont = 0; QColor *OGlobalSettings::OpieGray = 0; QColor *OGlobalSettings::OpieHighlight = 0; QColor *OGlobalSettings::OpieAlternate = 0; OGlobalSettings::OMouseSettings *OGlobalSettings::s_mouseSettings = 0; //FIXME: Add manipulators to the accessors int OGlobalSettings::dndEventDelay() { OConfig *c = OGlobal::config(); OConfigGroupSaver cgs( c, "General" ); return c->readNumEntry("DndDelay", 2); diff --git a/libopie2/opiecore/opiecore.pro b/libopie2/opiecore/opiecore.pro index fe5800e..5d630ea 100644 --- a/libopie2/opiecore/opiecore.pro +++ b/libopie2/opiecore/opiecore.pro @@ -1,43 +1,43 @@ TEMPLATE = lib CONFIG += qt warn_on debug DESTDIR = $(OPIEDIR)/lib HEADERS = oapplication.h \ opieapplication.h \ oconfig.h \ opieconfig.h \ ocompletionbase.h \ ocompletion.h \ odebug.h \ oglobal.h \ oglobalsettings.h \ osortablevaluelist.h SOURCES = oapplication.cpp \ opieapplication.cpp \ oconfig.cpp \ opieconfig.cpp \ ocompletionbase.cpp \ ocompletion.cpp \ odebug.cpp \ oglobal.cpp \ oglobalsettings.cpp INTERFACES = TARGET = opiecore2 -VERSION = 1.8.1 +VERSION = 1.8.2 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include MOC_DIR = moc OBJECTS_DIR = obj !contains( platform, x11 ) { LIBS = -lqpe include ( $(OPIEDIR)/include.pro ) } contains( platform, x11 ) { LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib } diff --git a/libopie2/opiedb/libopiedb2.control b/libopie2/opiedb/libopiedb2.control index 3fe3820..5500dc8 100644 --- a/libopie2/opiedb/libopiedb2.control +++ b/libopie2/opiedb/libopiedb2.control @@ -1,11 +1,11 @@ Package: libopiedb2 Files: $OPIEDIR/lib/libopiedb2.so* Priority: optional Section: opie/system Maintainer: Opie Team <opie@handhelds.org> Architecture: arm -Version: 1.8.1-$SUB_VERSION.2 -Depends: libqpe1, libopiecore2 (1.8.1) +Version: 1.8.2-$SUB_VERSION.2 +Depends: libqpe1, libopiecore2 (1.8.2) Provides: libopiedb2 Description: Opie library 2.0 DB diff --git a/libopie2/opiedb/opiedb.pro b/libopie2/opiedb/opiedb.pro index 6a4e8f1..d869e6f 100644 --- a/libopie2/opiedb/opiedb.pro +++ b/libopie2/opiedb/opiedb.pro @@ -1,41 +1,41 @@ TEMPLATE = lib #CONFIG += qt warn_on debug CONFIG += qt warn_on release DESTDIR = $(OPIEDIR)/lib HEADERS = osqlbackend.h \ osqldriver.h \ osqlerror.h \ osqlmanager.h \ osqlquery.h \ osqlresult.h \ osqltable.h \ osqlbackendmanager.h \ osqlitedriver.h SOURCES = osqlbackend.cpp \ osqldriver.cpp \ osqlerror.cpp \ osqlmanager.cpp \ osqlquery.cpp \ osqlresult.cpp \ osqltable.cpp \ osqlbackendmanager.cpp \ osqlitedriver.cpp INTERFACES = TARGET = opiedb2 -VERSION = 1.8.1 +VERSION = 1.8.2 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include MOC_DIR = moc OBJECTS_DIR = obj LIBS += -lsqlite -lqpe !contains( platform, x11 ) { include ( $(OPIEDIR)/include.pro ) } contains( platform, x11 ) { LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib } diff --git a/libopie2/opiemm/libopiemm2.control b/libopie2/opiemm/libopiemm2.control index 7fbadef..f528969 100644 --- a/libopie2/opiemm/libopiemm2.control +++ b/libopie2/opiemm/libopiemm2.control @@ -1,11 +1,11 @@ Package: libopiemm2 Files: $OPIEDIR/lib/libopiemm2.so.* Priority: optional Section: opie/system Maintainer: Opie Team <opie@handhelds.org> Architecture: arm -Version: 1.8.1-$SUB_VERSION.2 -Depends: libqpe1, libopiecore2 (1.8.1) +Version: 1.8.2-$SUB_VERSION.2 +Depends: libqpe1, libopiecore2 (1.8.2) Provides: libopiemm2 Description: Opie library 2.0 MM diff --git a/libopie2/opiemm/opiemm.pro b/libopie2/opiemm/opiemm.pro index d3ce8f7..d5c8238 100644 --- a/libopie2/opiemm/opiemm.pro +++ b/libopie2/opiemm/opiemm.pro @@ -1,22 +1,22 @@ TEMPLATE = lib CONFIG += qt warn_on debug DESTDIR = $(OPIEDIR)/lib HEADERS = osoundsystem.h SOURCES = osoundsystem.cpp INTERFACES = TARGET = opiemm2 -VERSION = 1.8.1 +VERSION = 1.8.2 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += MOC_DIR = moc OBJECTS_DIR = obj !contains( platform, x11 ) { include ( $(OPIEDIR)/include.pro ) } contains( platform, x11 ) { LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib } diff --git a/libopie2/opienet/dhcp.h b/libopie2/opienet/dhcp.h index 3f2f775..368e375 100644 --- a/libopie2/opienet/dhcp.h +++ b/libopie2/opienet/dhcp.h @@ -169,32 +169,33 @@ struct dhcp_packet { continuing to work. */ #define DHO_AUTHENTICATE 210 #define DHO_END 255 /* DHCP message types. */ #define DHCPDISCOVER 1 #define DHCPOFFER 2 #define DHCPREQUEST 3 #define DHCPDECLINE 4 #define DHCPACK 5 #define DHCPNAK 6 #define DHCPRELEASE 7 #define DHCPINFORM 8 /* Relay Agent Information option subtypes: */ #define RAI_CIRCUIT_ID 1 #define RAI_REMOTE_ID 2 #define RAI_AGENT_ID 3 /* FQDN suboptions: */ #define FQDN_NO_CLIENT_UPDATE 1 #define FQDN_SERVER_UPDATE 2 #define FQDN_ENCODED 3 #define FQDN_RCODE1 4 #define FQDN_RCODE2 5 #define FQDN_HOSTNAME 6 #define FQDN_DOMAINNAME 7 #define FQDN_FQDN 8 #define FQDN_SUBOPTION_COUNT 8 #endif
\ No newline at end of file + diff --git a/libopie2/opienet/libopienet2.control b/libopie2/opienet/libopienet2.control index 65d8464..8eb0704 100644 --- a/libopie2/opienet/libopienet2.control +++ b/libopie2/opienet/libopienet2.control @@ -1,11 +1,11 @@ Package: libopienet2 Files: $OPIEDIR/lib/libopienet2.so.* $OPIEDIR/etc/manufacturers Priority: optional Section: opie/system Maintainer: Opie Team <opie@handhelds.org> Architecture: arm -Version: 1.8.1-$SUB_VERSION.2 -Depends: libqpe1, libopiecore2 (1.8.1) +Version: 1.8.2-$SUB_VERSION.2 +Depends: libopiecore2 (1.8.2) Provides: libopienet2 Description: Opie library 2.0 NET diff --git a/libopie2/opienet/odebugmapper.cpp b/libopie2/opienet/odebugmapper.cpp index d62b3ba..7e4ab2b 100644 --- a/libopie2/opienet/odebugmapper.cpp +++ b/libopie2/opienet/odebugmapper.cpp @@ -1,42 +1,44 @@ /* * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> */ +#include <opie2/odebug.h> + #include "odebugmapper.h" DebugMapper::DebugMapper() { - qDebug( "DebugMapper::DebugMapper()" ); + odebug << "DebugMapper::DebugMapper()" << oendl; _map.insert( 0x8902, new QString("SIOCSPGRP") ); _map.insert( 0x8904, new QString("SIOCGPGRP") ); _map.insert( 0x8905, new QString("SIOCATMARK") ); _map.insert( 0x8906, new QString("SIOCGSTAMP") ); _map.insert( 0x890B, new QString("SIOCADDRT") ); _map.insert( 0x890C, new QString("SIOCDELRT") ); _map.insert( 0x890D, new QString("SIOCRTMSG") ); _map.insert( 0x8910, new QString("SIOCGIFNAME") ); _map.insert( 0x8911, new QString("SIOCSIFLINK") ); _map.insert( 0x8912, new QString("SIOCGIFCONF") ); _map.insert( 0x8913, new QString("SIOCGIFFLAGS") ); _map.insert( 0x8914, new QString("SIOCSIFFLAGS") ); _map.insert( 0x8915, new QString("SIOCGIFADDR") ); _map.insert( 0x8916, new QString("SIOCSIFADDR") ); _map.insert( 0x8917, new QString("SIOCGIFDSTADDR") ); _map.insert( 0x8918, new QString("SIOCSIFDSTADDR") ); _map.insert( 0x8919, new QString("SIOCGIFBRDADDR") ); _map.insert( 0x891a, new QString("SIOCSIFBRDADDR") ); _map.insert( 0x891b, new QString("SIOCGIFNETMASK") ); _map.insert( 0x891c, new QString("SIOCSIFNETMASK") ); _map.insert( 0x891d, new QString("SIOCGIFMETRIC") ); _map.insert( 0x891e, new QString("SIOCSIFMETRIC") ); _map.insert( 0x891f, new QString("SIOCGIFMEM") ); _map.insert( 0x8920, new QString("SIOCSIFMEM") ); _map.insert( 0x8921, new QString("SIOCGIFMTU") ); _map.insert( 0x8922, new QString("SIOCSIFMTU") ); _map.insert( 0x8923, new QString("SIOCSIFNAME") ); _map.insert( 0x8924, new QString("SIOCSIFHWADDR") ); _map.insert( 0x8925, new QString("SIOCGIFENCAP") ); _map.insert( 0x8926, new QString("SIOCSIFENCAP") ); @@ -162,52 +164,52 @@ DebugMapper::DebugMapper() _map.insert( 0x8945, new QString("SIOCSIFDIVERT") ); _map.insert( 0x8946, new QString("SIOCETHTOOL") ); _map.insert( 0x8947, new QString("SIOCGMIIPHY") ); _map.insert( 0x8948, new QString("SIOCGMIIREG") ); _map.insert( 0x8949, new QString("SIOCSMIIREG") ); _map.insert( 0x894A, new QString("SIOCWANDEV") ); _map.insert( 0x8953, new QString("SIOCDARP") ); _map.insert( 0x8954, new QString("SIOCGARP") ); _map.insert( 0x8955, new QString("SIOCSARP") ); _map.insert( 0x8960, new QString("SIOCDRARP") ); _map.insert( 0x8961, new QString("SIOCGRARP") ); _map.insert( 0x8962, new QString("SIOCSRARP") ); _map.insert( 0x8970, new QString("SIOCGIFMAP") ); _map.insert( 0x8971, new QString("SIOCSIFMAP") ); _map.insert( 0x8980, new QString("SIOCADDDLCI") ); _map.insert( 0x8981, new QString("SIOCDELDLCI") ); _map.insert( 0x8982, new QString("SIOCGIFVLAN") ); _map.insert( 0x8983, new QString("SIOCSIFVLAN") ); _map.insert( 0x8990, new QString("SIOCBONDENSLAVE") ); _map.insert( 0x8991, new QString("SIOCBONDRELEASE") ); _map.insert( 0x8992, new QString("SIOCBONDSETHWADDR") ); _map.insert( 0x8993, new QString("SIOCBONDSLAVEINFOQUERY") ); _map.insert( 0x8994, new QString("SIOCBONDINFOQUERY") ); _map.insert( 0x8995, new QString("SIOCBONDCHANGEACTIVE") ); _map.insert( 0x89F0, new QString("SIOCDEVPRIVATE") ); _map.insert( 0x89E0, new QString("SIOCPROTOPRIVATE") ); }; DebugMapper::~DebugMapper() { - qDebug( "DebugMapper::~DebugMapper()" ); + odebug << "DebugMapper::~DebugMapper()" << oendl; } const QString& DebugMapper::map( int value ) const { QString* result = _map[ value ]; if ( !result ) { - qDebug( "DebugMapper::map() - value not found." ); + owarn << "DebugMapper::map() - value " << value << " is not found." << oendl; return QString::null; } else { return *result; } } diff --git a/libopie2/opienet/omanufacturerdb.cpp b/libopie2/opienet/omanufacturerdb.cpp index c3c213c..bcce11f 100644 --- a/libopie2/opienet/omanufacturerdb.cpp +++ b/libopie2/opienet/omanufacturerdb.cpp @@ -1,118 +1,131 @@ -/********************************************************************** -** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. -** -** This file is part of Opie Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -**********************************************************************/ +/* + This file is part of the Opie Project + (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` 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. + +*/ #include "omanufacturerdb.h" +/* OPIE CORE */ +#include <opie2/odebug.h> + /* QT */ #include <qstring.h> #include <qfile.h> #include <qtextstream.h> OManufacturerDB* OManufacturerDB::_instance = 0; OManufacturerDB* OManufacturerDB::instance() { if ( !OManufacturerDB::_instance ) { - qDebug( "OManufacturerDB::instance(): creating OManufacturerDB..." ); + odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl; _instance = new OManufacturerDB(); } return _instance; } OManufacturerDB::OManufacturerDB() { QString filename( "/etc/manufacturers" ); - qDebug( "OManufacturerDB: trying to read '%s'...", (const char*) filename ); + odebug << "OManufacturerDB: trying to read " << filename << oendl; if ( !QFile::exists( filename ) ) { filename = "/opt/QtPalmtop/etc/manufacturers"; - qDebug( "OManufacturerDB: trying to read '%s'...", (const char*) filename ); + odebug << "OManufacturerDB: trying to read " << filename << oendl; if ( !QFile::exists( filename ) ) { filename = "/usr/share/wellenreiter/manufacturers"; - qDebug( "OManufacturerDB: trying to read '%s'...", (const char*) filename ); + odebug << "OManufacturerDB: trying to read " << filename << oendl; } } QFile file( filename ); bool hasFile = file.open( IO_ReadOnly ); if (!hasFile) { - qWarning( "OManufacturerDB: no valid manufacturer list found.", (const char*) filename ); + owarn << "OManufacturerDB: no valid manufacturer list found." << oendl; } else { - qDebug( "OManufacturerDB: found manufacturer list in '%s'...", (const char*) filename ); + odebug << "OManufacturerDB: found manufacturer list in " << filename << oendl; QTextStream s( &file ); QString addr; QString manu; QString extManu; while (!s.atEnd()) { s >> addr; if ( !addr ) // read nothing!? { continue; } else if ( addr[0] == '#' ) { continue; } s.skipWhiteSpace(); s >> manu; s.skipWhiteSpace(); s >> extManu; if ( extManu[0] == '#' ) // we have an extended manufacturer { s.skipWhiteSpace(); extManu = s.readLine(); - #ifdef DEBUG - qDebug( "OManufacturerDB: read '%s' as extended manufacturer string", (const char*) extManu ); - #endif + odebug << "OManufacturerDB: read " << extManu << " as extended manufacturer string" << oendl; manufacturersExt.insert( addr, extManu ); } else s.readLine(); - #ifdef DEBUG - qDebug( "ManufacturerDB: read tuple %s, %s", (const char*) addr, (const char*) manu ); - #endif + odebug << "OManufacturerDB: read tuple " << addr << ", " << manu << oendl; manufacturers.insert( addr, manu ); - } } } OManufacturerDB::~OManufacturerDB() { } const QString& OManufacturerDB::lookup( const QString& macaddr ) const { return manufacturers[macaddr.upper().left(8)]; } const QString& OManufacturerDB::lookupExt( const QString& macaddr ) const { QMap<QString,QString>::ConstIterator it = manufacturersExt.find( macaddr.upper().left(8) ); return it == manufacturersExt.end() ? lookup( macaddr ) : *it; } diff --git a/libopie2/opienet/omanufacturerdb.h b/libopie2/opienet/omanufacturerdb.h index 651f624..c2712e5 100644 --- a/libopie2/opienet/omanufacturerdb.h +++ b/libopie2/opienet/omanufacturerdb.h @@ -1,46 +1,61 @@ -/********************************************************************** -** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. -** -** This file is part of Opie Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -**********************************************************************/ +/* + This file is part of the Opie Project + (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` 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 OMANUFACTURERDB_H #define OMANUFACTURERDB_H #include <qmap.h> /** * @brief A Ethernet card vendor database. * * This class encapsulates the lookup of Ethernet vendor given a * certain Mac Address. Only the first three bytes define the vendor. */ class OManufacturerDB { public: /** * @returns the one-and-only @ref OManufacturerDB instance. */ static OManufacturerDB* instance(); /** * @returns the short manufacturer string given a @a macaddr. */ const QString& lookup( const QString& macaddr ) const; /** * @returns the enhanced manufacturer string given a @a macaddr. */ const QString& lookupExt( const QString& macaddr ) const; protected: OManufacturerDB(); virtual ~OManufacturerDB(); diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp index e3eb327..48cfa43 100644 --- a/libopie2/opienet/onetutils.cpp +++ b/libopie2/opienet/onetutils.cpp @@ -1,36 +1,36 @@ /* This file is part of the Opie Project - (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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. */ #include <opie2/onetutils.h> #include <opie2/onetwork.h> #include <opie2/omanufacturerdb.h> #include <net/if.h> diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index 95c813f..6a9280f 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp @@ -1,38 +1,35 @@ /* This file is part of the Opie Project - Copyright (C) 2003 by the Wellenreiter team: - Martin J. Muench <mjm@remote-exploit.org> - Max Moser <mmo@remote-exploit.org - Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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. */ /* OPIE */ #include <opie2/onetwork.h> #include <opie2/ostation.h> @@ -921,64 +918,65 @@ OStationList* OWirelessNetworkInterface::scanNetwork() } case SIOCGIWMODE: { qDebug( "SIOCGIWMODE" ); stations->last()->type = modeToString( we->u.mode ); break; } case SIOCGIWFREQ: { qDebug( "SIOCGIWFREQ" ); stations->last()->channel = _channels[ static_cast<int>(double( we->u.freq.m ) * pow( 10.0, we->u.freq.e ) / 1000000) ]; break; } case SIOCGIWESSID: { qDebug( "SIOCGIWESSID" ); stations->last()->ssid = we->u.essid.pointer; break; } case SIOCGIWSENS: qDebug( "SIOCGIWSENS" ); break; case SIOCGIWENCODE: qDebug( "SIOCGIWENCODE" ); break; case IWEVTXDROP: qDebug( "IWEVTXDROP" ); break; /* Packet dropped to excessive retry */ case IWEVQUAL: qDebug( "IWEVQUAL" ); break; /* Quality part of statistics (scan) */ case IWEVCUSTOM: qDebug( "IWEVCUSTOM" ); break; /* Driver specific ascii string */ case IWEVREGISTERED: qDebug( "IWEVREGISTERED" ); break; /* Discovered a new node (AP mode) */ case IWEVEXPIRED: qDebug( "IWEVEXPIRED" ); break; /* Expired a node (AP mode) */ default: qDebug( "unhandled event" ); } offset += we->len; we = (struct iw_event*) &buffer[offset]; } + return stations; return stations; } else { qDebug( " - no results (timeout) :(" ); return stations; } } bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const { #ifndef NODEBUG int result = ::ioctl( _sfd, call, &iwreq ); if ( result == -1 ) qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) debugmapper->map( call ), call, result, strerror( errno ) ); else qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) debugmapper->map( call ), call ); return ( result != -1 ); #else return ::ioctl( _sfd, call, &iwreq ) != -1; #endif } bool OWirelessNetworkInterface::wioctl( int call ) const { strcpy( _iwr.ifr_name, name() ); return wioctl( call, _iwr ); } diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index eb6c86e..bc9e299 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h @@ -1,38 +1,35 @@ /* This file is part of the Opie Project - Copyright (C) 2003 by the Wellenreiter team: - Martin J. Muench <mjm@remote-exploit.org> - Max Moser <mmo@remote-exploit.org - Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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 #include "wireless.h" diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index 6331b2d..635224c 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp @@ -1,38 +1,35 @@ /* This file is part of the Opie Project - Copyright (C) 2003 by the Wellenreiter team: - Martin J. Muench <mjm@remote-exploit.org> - Max Moser <mmo@remote-exploit.org - Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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. */ /* OPIE */ #include <opie2/opcap.h> /* QT */ #include <qapplication.h> // don't use oapplication here (will decrease reusability in other projects) diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h index 54b256b..497fd6b 100644 --- a/libopie2/opienet/opcap.h +++ b/libopie2/opienet/opcap.h @@ -1,38 +1,35 @@ /* This file is part of the Opie Project - Copyright (C) 2003 by the Wellenreiter team: - Martin J. Muench <mjm@remote-exploit.org> - Max Moser <mmo@remote-exploit.org - Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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 OPCAP_H #define OPCAP_H /* LINUX */ extern "C" // work around a bpf/pcap conflict in recent headers diff --git a/libopie2/opienet/opienet.pro b/libopie2/opienet/opienet.pro index 386c2db..2027481 100644 --- a/libopie2/opienet/opienet.pro +++ b/libopie2/opienet/opienet.pro @@ -1,34 +1,34 @@ TEMPLATE = lib CONFIG += qt warn_on debug DESTDIR = $(OPIEDIR)/lib HEADERS = 802_11_user.h \ dhcp.h \ udp_ports.h \ wireless.h \ odebugmapper.h \ omanufacturerdb.h \ onetutils.h \ onetwork.h \ opcap.h \ ostation.h SOURCES = odebugmapper.cpp \ omanufacturerdb.cpp \ onetutils.cpp \ onetwork.cpp \ opcap.cpp \ ostation.cpp INTERFACES = TARGET = opienet2 -VERSION = 1.8.1 +VERSION = 1.8.2 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lpcap !contains( platform, x11 ) { include ( $(OPIEDIR)/include.pro ) } contains( platform, x11 ) { LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib } diff --git a/libopie2/opienet/ostation.cpp b/libopie2/opienet/ostation.cpp index ba1e4f6..c363f0c 100644 --- a/libopie2/opienet/ostation.cpp +++ b/libopie2/opienet/ostation.cpp @@ -1,36 +1,35 @@ /* This file is part of the Opie Project - - (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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. */ #include <opie2/ostation.h> /*====================================================================================== * OStation *======================================================================================*/ diff --git a/libopie2/opienet/ostation.h b/libopie2/opienet/ostation.h index a6956c9..1e7366d 100644 --- a/libopie2/opienet/ostation.h +++ b/libopie2/opienet/ostation.h @@ -1,36 +1,35 @@ /* This file is part of the Opie Project - - (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` 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 OSTATION_H #define OSTATION_H #include <opie2/onetutils.h> diff --git a/libopie2/opienet/udp_ports.h b/libopie2/opienet/udp_ports.h index 5e92497..3fb1c85 100644 --- a/libopie2/opienet/udp_ports.h +++ b/libopie2/opienet/udp_ports.h @@ -1,37 +1,37 @@ /* * This file has been generated by doing * find . -name "*"|xargs grep -h '#define UDP_PORT' > udp_ports.h * in the root directory of Ethereal 0.9.15. Cudos to the Ethereal Team. - * -- Michael 'Mickey' Lauer <mickeyl@handhelds.org> + * -- Michael 'Mickey' Lauer <mickey@Vanille.de> */ #define UDP_PORT_AODV 654 #define UDP_PORT_LENGTH 2 #define UDP_PORT_OFFSET PARAMETER_VALUE_OFFSET #define UDP_PORT_RAS1 1718 #define UDP_PORT_RAS2 1719 #define UDP_PORT_CPHA 8116 #define UDP_PORT_DDTP 1052 #define UDP_PORT_CUPS 631 #define UDP_PORT_DLSW 2067 #define UDP_PORT_ISAKMP 500 #define UDP_PORT_L2TP 1701 #define UDP_PORT_IAPP 2313 #define UDP_PORT_HSRP 1985 #define UDP_PORT_SSDP 1900 #define UDP_PORT_TACACS 49 #define UDP_PORT_CLDAP 389 #define UDP_PORT_VINES 573 #define UDP_PORT_NBNS 137 #define UDP_PORT_NBDGM 138 #define UDP_PORT_XYPLEX 173 #define UDP_PORT_PIM_RP_DISC 496 #define UDP_PORT_SLIMP3_V1 1069 #define UDP_PORT_SLIMP3_V2 3483 #define UDP_PORT_RMCP 623 #define UDP_PORT_RMCP_SECURE 664 #define UDP_PORT_SYSLOG 514 #define UDP_PORT_SNMP 161 #define UDP_PORT_SNMP_TRAP 162 #define UDP_PORT_TFTP 69 #define UDP_PORT_TIME 37 diff --git a/libopie2/opiepim/libopiepim2.control b/libopie2/opiepim/libopiepim2.control index 5cfa453..ac8e13c 100644 --- a/libopie2/opiepim/libopiepim2.control +++ b/libopie2/opiepim/libopiepim2.control @@ -1,11 +1,11 @@ Package: libopiepim2 Files: $OPIEDIR/lib/libopiepim2.so.* Priority: optional Section: opie/system Maintainer: Opie Team <opie@handhelds.org> Architecture: arm -Version: 1.8.1-$SUB_VERSION.2 -Depends: libqpe1, libopiecore2 (1.8.1) +Version: 1.8.2-$SUB_VERSION.2 +Depends: libqpe1, libopiecore2 (1.8.2) Provides: libopiepim2 Description: Opie library 2.0 PIM diff --git a/libopie2/opiepim/opiepim.pro b/libopie2/opiepim/opiepim.pro index cc6ee90..3972c3f 100644 --- a/libopie2/opiepim/opiepim.pro +++ b/libopie2/opiepim/opiepim.pro @@ -1,24 +1,24 @@ TEMPLATE = lib CONFIG += qt warn_on debug DESTDIR = $(OPIEDIR)/lib HEADERS = SOURCES = INTERFACES = TARGET = opiepim2 -VERSION = 1.8.1 +VERSION = 1.8.2 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include MOC_DIR = moc OBJECTS_DIR = obj !contains( platform, x11 ) { include ( $(OPIEDIR)/include.pro ) } contains( platform, x11 ) { LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib } diff --git a/libopie2/opieui/libopieui2.control b/libopie2/opieui/libopieui2.control index 6900fd6..71e6358 100644 --- a/libopie2/opieui/libopieui2.control +++ b/libopie2/opieui/libopieui2.control @@ -1,11 +1,11 @@ Package: libopieui2 Files: $OPIEDIR/lib/libopieui2.so.* Priority: optional Section: opie/system Maintainer: Opie Team <opie@handhelds.org> Architecture: arm -Version: 1.8.1-$SUB_VERSION.2 -Depends: libqpe1, libopiecore2 (1.8.1) +Version: 1.8.2-$SUB_VERSION.2 +Depends: libqpe1, libopiecore2 (1.8.2) Provides: libopieui2 Description: Opie library 2.0 UI diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro index 68a5c5f..4c15181 100644 --- a/libopie2/opieui/opieui.pro +++ b/libopie2/opieui/opieui.pro @@ -17,51 +17,51 @@ HEADERS = ocompletionbox.h \ odialog.h \ omenubar.h \ opiemenubar.h \ omessagebox.h \ oresource.h \ otoolbar.h \ oseparator.h # otaskbarapplet.h SOURCES = ocompletionbox.cpp \ ocombobox.cpp \ oeditlistbox.cpp \ olineedit.cpp \ olistview.cpp \ oimageeffect.cpp \ opixmapeffect.cpp \ opopupmenu.cpp \ opixmapprovider.cpp \ oselector.cpp \ oversatileview.cpp \ oversatileviewitem.cpp \ #ojanuswidget.cpp \ odialog.cpp \ omenubar.cpp \ opiemenubar.cpp \ oresource.cpp \ otoolbar.cpp \ oseparator.cpp #\ # otaskbarapplet.cpp INTERFACES = TARGET = opieui2 -VERSION = 1.8.1 +VERSION = 1.8.2 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lopiecore2 MOC_DIR = moc OBJECTS_DIR = obj !contains( platform, x11 ) { include ( $(OPIEDIR)/include.pro ) HEADERS += otaskbarapplet.h SOURCES += otaskbarapplet.cpp } contains( platform, x11 ) { LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib message( Warning: NO otaskbarapplet ATM ) } diff --git a/libopie2/tools/regen.py b/libopie2/tools/regen.py index 9ad5352..3779896 100755 --- a/libopie2/tools/regen.py +++ b/libopie2/tools/regen.py @@ -21,74 +21,76 @@ except: print >>tablehfile,""" /* * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> */ #ifndef DEBUGMAPPER_H #define DEBUGMAPPER_H #include <qstring.h> #include <qintdict.h> typedef QIntDict<QString> IntStringMap; class DebugMapper { public: DebugMapper(); ~DebugMapper(); const QString& map( int value ) const; private: IntStringMap _map; }; #endif """ print >>tablecfile,""" /* * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> */ +#include <opie2/odebug.h> + #include "%s" DebugMapper::DebugMapper() { - qDebug( "DebugMapper::DebugMapper()" ); + odebug << "DebugMapper::DebugMapper()" << oendl; """ % (tablehfile.name) for line in result: l = line.split() if not l[0].startswith( "#define" ) or not l[2].startswith( "0x" ): print >>sys.stderr, "can't parse line: %s" % l continue print >>tablecfile, " _map.insert( %s, new QString(\"%s\") );" % ( l[2], l[1] ) print >>tablecfile,""" }; DebugMapper::~DebugMapper() { - qDebug( "DebugMapper::~DebugMapper()" ); + odebug << "DebugMapper::~DebugMapper()" << oendl; } const QString& DebugMapper::map( int value ) const { QString* result = _map[ value ]; if ( !result ) { - qDebug( "DebugMapper::map() - value not found." ); + owarn << "DebugMapper::map() - value " << value << " is not found." << oendl; return QString::null; } else { return *result; } } """ |