summaryrefslogtreecommitdiff
path: root/libopie2/opienet/omanufacturerdb.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opienet/omanufacturerdb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/omanufacturerdb.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libopie2/opienet/omanufacturerdb.cpp b/libopie2/opienet/omanufacturerdb.cpp
index b93b752..209ec94 100644
--- a/libopie2/opienet/omanufacturerdb.cpp
+++ b/libopie2/opienet/omanufacturerdb.cpp
@@ -22,48 +22,52 @@
 -.   .:....=;==+<; 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"
#define OPIE_IMPROVE_GUI_LATENCY 1
/* OPIE */
#include <opie2/odebug.h>
#ifdef OPIE_IMPROVE_GUI_LATENCY
#include <qpe/global.h>
#endif
/* QT */
#include <qapplication.h>
#include <qfile.h>
#include <qtextstream.h>
+using namespace Opie::Core;
+namespace Opie {
+namespace Net {
+
OManufacturerDB* OManufacturerDB::_instance = 0;
OManufacturerDB* OManufacturerDB::instance()
{
if ( !OManufacturerDB::_instance )
{
odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl;
_instance = new OManufacturerDB();
}
return _instance;
}
OManufacturerDB::OManufacturerDB()
{
#ifdef OPIE_IMPROVE_GUI_LATENCY
Global::statusMessage( "Reading Manufacturers..." );
#endif
QString filename( "/etc/manufacturers" );
odebug << "OManufacturerDB: trying to read " << filename << oendl;
if ( !QFile::exists( filename ) )
{
filename = "/opt/QtPalmtop/etc/manufacturers";
odebug << "OManufacturerDB: trying to read " << filename << oendl;
@@ -112,24 +116,27 @@ OManufacturerDB::OManufacturerDB()
#ifdef OPIE_IMPROVE_GUI_LATENCY
Global::statusMessage( "Manufacturers Complete..." );
#endif
}
}
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;
}
+}
+}
+