summaryrefslogtreecommitdiff
authorzecke <zecke>2004-08-23 23:15:06 (UTC)
committer zecke <zecke>2004-08-23 23:15:06 (UTC)
commit94611edc1942717faa15861adef25418e40ea626 (patch) (unidiff)
treeea45e973c948c50adb4ac813255b57193b919574
parentf8f1d4f340b591f21cd7c10259da1241ecf69dd9 (diff)
downloadopie-94611edc1942717faa15861adef25418e40ea626.zip
opie-94611edc1942717faa15861adef25418e40ea626.tar.gz
opie-94611edc1942717faa15861adef25418e40ea626.tar.bz2
Do not hardcode /opt/QtPalmtop but use QPEApplication::qpeDir
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/omanufacturerdb.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libopie2/opienet/omanufacturerdb.cpp b/libopie2/opienet/omanufacturerdb.cpp
index 3003e12..32bae0a 100644
--- a/libopie2/opienet/omanufacturerdb.cpp
+++ b/libopie2/opienet/omanufacturerdb.cpp
@@ -19,68 +19,71 @@
19++=   -.     .`     .: details. 19++=   -.     .`     .: details.
20 :     =  ...= . :.=- 20 :     =  ...= . :.=-
21 -.   .:....=;==+<; You should have received a copy of the GNU 21 -.   .:....=;==+<; You should have received a copy of the GNU
22  -_. . .   )=.  = Library General Public License along with 22  -_. . .   )=.  = Library General Public License along with
23    --        :-=` this library; see the file COPYING.LIB. 23    --        :-=` this library; see the file COPYING.LIB.
24 If not, write to the Free Software Foundation, 24 If not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330, 25 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27*/ 27*/
28 28
29#include "omanufacturerdb.h" 29#include "omanufacturerdb.h"
30 30
31#define OPIE_IMPROVE_GUI_LATENCY 1 31#define OPIE_IMPROVE_GUI_LATENCY 1
32 32
33/* OPIE */ 33/* OPIE */
34#include <opie2/odebug.h> 34#include <opie2/odebug.h>
35#include <qpe/qpeapplication.h>
35#ifdef OPIE_IMPROVE_GUI_LATENCY 36#ifdef OPIE_IMPROVE_GUI_LATENCY
36#include <qpe/global.h> 37#include <qpe/global.h>
37#endif 38#endif
38 39
40
41
39/* QT */ 42/* QT */
40#include <qapplication.h> 43#include <qapplication.h>
41#include <qfile.h> 44#include <qfile.h>
42#include <qtextstream.h> 45#include <qtextstream.h>
43 46
44using namespace Opie::Core; 47using namespace Opie::Core;
45namespace Opie { 48namespace Opie {
46namespace Net { 49namespace Net {
47 50
48OManufacturerDB* OManufacturerDB::_instance = 0; 51OManufacturerDB* OManufacturerDB::_instance = 0;
49 52
50OManufacturerDB* OManufacturerDB::instance() 53OManufacturerDB* OManufacturerDB::instance()
51{ 54{
52 if ( !OManufacturerDB::_instance ) 55 if ( !OManufacturerDB::_instance )
53 { 56 {
54 odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl; 57 odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl;
55 _instance = new OManufacturerDB(); 58 _instance = new OManufacturerDB();
56 } 59 }
57 return _instance; 60 return _instance;
58} 61}
59 62
60 63
61OManufacturerDB::OManufacturerDB() 64OManufacturerDB::OManufacturerDB()
62{ 65{
63 #ifdef OPIE_IMPROVE_GUI_LATENCY 66 #ifdef OPIE_IMPROVE_GUI_LATENCY
64 Global::statusMessage( "Reading Manufacturers..." ); 67 Global::statusMessage( "Reading Manufacturers..." );
65 #endif 68 #endif
66 QString filename( "/etc/manufacturers" ); 69 QString filename( "/etc/manufacturers" );
67 odebug << "OManufacturerDB: trying to read " << filename << oendl; 70 odebug << "OManufacturerDB: trying to read " << filename << oendl;
68 if ( !QFile::exists( filename ) ) 71 if ( !QFile::exists( filename ) )
69 { 72 {
70 filename = "/opt/QtPalmtop/etc/manufacturers"; 73 filename = QPEApplication::qpeDir()+"/etc/manufacturers";
71 odebug << "OManufacturerDB: trying to read " << filename << oendl; 74 odebug << "OManufacturerDB: trying to read " << filename << oendl;
72 if ( !QFile::exists( filename ) ) 75 if ( !QFile::exists( filename ) )
73 { 76 {
74 filename = "/usr/share/wellenreiter/manufacturers"; 77 filename = "/usr/share/wellenreiter/manufacturers";
75 odebug << "OManufacturerDB: trying to read " << filename << oendl; 78 odebug << "OManufacturerDB: trying to read " << filename << oendl;
76 } 79 }
77 } 80 }
78 81
79 QFile file( filename ); 82 QFile file( filename );
80 bool hasFile = file.open( IO_ReadOnly ); 83 bool hasFile = file.open( IO_ReadOnly );
81 if (!hasFile) 84 if (!hasFile)
82 { 85 {
83 owarn << "OManufacturerDB: no valid manufacturer list found." << oendl; 86 owarn << "OManufacturerDB: no valid manufacturer list found." << oendl;
84 } 87 }
85 else 88 else
86 { 89 {