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.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/libopie2/opienet/omanufacturerdb.cpp b/libopie2/opienet/omanufacturerdb.cpp
index 123aee8..3af3d4c 100644
--- a/libopie2/opienet/omanufacturerdb.cpp
+++ b/libopie2/opienet/omanufacturerdb.cpp
@@ -25,14 +25,12 @@
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>
#include <qpe/qpeapplication.h>
#ifdef OPIE_IMPROVE_GUI_LATENCY
#include <qpe/global.h>
#endif
@@ -60,15 +58,13 @@ OManufacturerDB* OManufacturerDB::instance()
return _instance;
}
OManufacturerDB::OManufacturerDB()
{
- #ifdef OPIE_IMPROVE_GUI_LATENCY
- Global::statusMessage( "Reading Manufacturers..." );
- #endif
+ if ( qApp ) Global::statusMessage( "Reading Manufacturers..." );
QString filename( "/etc/manufacturers" );
odebug << "OManufacturerDB: trying to read " << filename << oendl;
if ( !QFile::exists( filename ) )
{
filename = QPEApplication::qpeDir()+"etc/manufacturers";
odebug << "OManufacturerDB: trying to read " << filename << oendl;
@@ -89,37 +85,32 @@ OManufacturerDB::OManufacturerDB()
{
odebug << "OManufacturerDB: found manufacturer list in " << filename << oendl;
QTextStream s( &file );
QString addr;
QString manu;
QString extManu;
- #ifdef OPIE_IMPROVE_GUI_LATENCY
int counter = 0;
- #endif
+
while (!s.atEnd())
{
s >> addr;
s >> manu;
s >> extManu;
manufacturers.insert( addr, manu );
manufacturersExt.insert( addr, extManu );
// odebug << "OmanufacturerDB: parse '" << addr << "' as '" << manu << "' (" << extManu << ")" << oendl;
- #ifdef OPIE_IMPROVE_GUI_LATENCY
counter++;
if ( counter == 50 )
{
- qApp->processEvents();
+ if ( qApp ) qApp->processEvents();
counter = 0;
}
- #endif
}
odebug << "OManufacturerDB: manufacturer list completed." << oendl;
- #ifdef OPIE_IMPROVE_GUI_LATENCY
- Global::statusMessage( "Manufacturers Complete..." );
- #endif
+ if ( qApp ) Global::statusMessage( "Manufacturers Complete..." );
}
}
OManufacturerDB::~OManufacturerDB()
{