summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/manufacturers.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/manufacturers.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/manufacturers.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/noncore/net/wellenreiter/gui/manufacturers.cpp b/noncore/net/wellenreiter/gui/manufacturers.cpp
deleted file mode 100644
index f9f8967..0000000
--- a/noncore/net/wellenreiter/gui/manufacturers.cpp
+++ b/dev/null
@@ -1,60 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3**
4** This file is part of Opie Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14**********************************************************************/
15
16#include "manufacturers.h"
17
18// Qt
19#include <qstring.h>
20#include <qfile.h>
21#include <qtextstream.h>
22
23ManufacturerDB::ManufacturerDB( const QString& filename )
24{
25 QFile file( filename );
26 bool hasFile = file.open( IO_ReadOnly );
27 if (!hasFile)
28 {
29 qDebug( "ManufacturerDB: D'oh! Manufacturer list '%s' not found!", (const char*) filename );
30 }
31 else
32 {
33 qDebug( "ManufacturerDB: reading manufacturer list from '%s'...", (const char*) filename );
34 QTextStream s( &file );
35 QString addr;
36 QString manu;
37
38 while (!s.atEnd())
39 {
40 s >> addr;
41 s.skipWhiteSpace();
42 manu = s.readLine();
43 #ifdef DEBUG
44 //qDebug( "ManufacturerDB: read pair %s, %s", (const char*) addr, (const char*) manu );
45 #endif
46 manufacturers.insert( addr, manu );
47
48 }
49 }
50
51}
52
53ManufacturerDB::~ManufacturerDB()
54{
55}
56
57const QString& ManufacturerDB::lookup( const QString& macaddr ) const
58{
59 return manufacturers[macaddr.upper().left(8)];
60}