From 7a7683d435cfbb4fa2d6ed99fd4a94d388402aec Mon Sep 17 00:00:00 2001 From: mickeyl Date: Mon, 01 Dec 2003 22:44:38 +0000 Subject: slowly start to refactor & cleanup libopie2 before merging it with libopie1 --- (limited to 'libopie2/opienet/omanufacturerdb.cpp') 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,20 +1,38 @@ -/********************************************************************** -** 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 + =. + .=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_,=:_.      -`: 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 + /* QT */ #include #include @@ -26,7 +44,7 @@ OManufacturerDB* OManufacturerDB::instance() { if ( !OManufacturerDB::_instance ) { - qDebug( "OManufacturerDB::instance(): creating OManufacturerDB..." ); + odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl; _instance = new OManufacturerDB(); } return _instance; @@ -36,15 +54,15 @@ OManufacturerDB* OManufacturerDB::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; } } @@ -52,11 +70,11 @@ OManufacturerDB::OManufacturerDB() 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; @@ -81,18 +99,13 @@ OManufacturerDB::OManufacturerDB() { 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 ); - } } -- cgit v0.9.0.2