author | eilers <eilers> | 2004-03-31 15:11:38 (UTC) |
---|---|---|
committer | eilers <eilers> | 2004-03-31 15:11:38 (UTC) |
commit | 10ed731c865d41955bf2aeb721cad592cd56b545 (patch) (unidiff) | |
tree | 2c05853293b3e0a1020a51bb84a804e0074e2c2b /libopie2 | |
parent | 0a56adea03683be6066622bbbbae1f0b8c73db12 (diff) | |
download | opie-10ed731c865d41955bf2aeb721cad592cd56b545.zip opie-10ed731c865d41955bf2aeb721cad592cd56b545.tar.gz opie-10ed731c865d41955bf2aeb721cad592cd56b545.tar.bz2 |
Fixed small bug, causes some crashes at startup: qDebug("... %s"); is bad.. ;)
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index f3e2cfb..1ad0327 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp | |||
@@ -48,97 +48,97 @@ _;:, .> :=|. This program is free software; you can | |||
48 | 48 | ||
49 | /* STD */ | 49 | /* STD */ |
50 | #include <fcntl.h> | 50 | #include <fcntl.h> |
51 | #include <math.h> | 51 | #include <math.h> |
52 | #include <stdlib.h> | 52 | #include <stdlib.h> |
53 | #include <signal.h> | 53 | #include <signal.h> |
54 | #include <sys/ioctl.h> | 54 | #include <sys/ioctl.h> |
55 | #include <sys/time.h> | 55 | #include <sys/time.h> |
56 | #include <unistd.h> | 56 | #include <unistd.h> |
57 | #ifndef QT_NO_SOUND | 57 | #ifndef QT_NO_SOUND |
58 | #include <linux/soundcard.h> | 58 | #include <linux/soundcard.h> |
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; | 61 | const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; |
62 | 62 | ||
63 | using namespace Opie::Core; | 63 | using namespace Opie::Core; |
64 | 64 | ||
65 | ODevice *ODevice::inst() | 65 | ODevice *ODevice::inst() |
66 | { | 66 | { |
67 | static ODevice *dev = 0; | 67 | static ODevice *dev = 0; |
68 | 68 | ||
69 | // rewrite this to only use /proc/cpuinfo or so | 69 | // rewrite this to only use /proc/cpuinfo or so |
70 | 70 | ||
71 | if ( !dev ) | 71 | if ( !dev ) |
72 | { | 72 | { |
73 | QFile f( PATH_PROC_CPUINFO ); | 73 | QFile f( PATH_PROC_CPUINFO ); |
74 | if ( f.open( IO_ReadOnly ) ) | 74 | if ( f.open( IO_ReadOnly ) ) |
75 | { | 75 | { |
76 | QTextStream s( &f ); | 76 | QTextStream s( &f ); |
77 | while ( !s.atEnd() ) | 77 | while ( !s.atEnd() ) |
78 | { | 78 | { |
79 | QString line; | 79 | QString line; |
80 | line = s.readLine(); | 80 | line = s.readLine(); |
81 | if ( line.startsWith( "Hardware" ) ) | 81 | if ( line.startsWith( "Hardware" ) ) |
82 | { | 82 | { |
83 | qDebug( "ODevice() - found '%s'", (const char*) line ); | 83 | qDebug( "ODevice() - found '%s'", (const char*) line ); |
84 | if ( line.contains( "sharp", false ) ) dev = new Private::Zaurus(); | 84 | if ( line.contains( "sharp", false ) ) dev = new Private::Zaurus(); |
85 | else if ( line.contains( "ipaq", false ) ) dev = new Private::iPAQ(); | 85 | else if ( line.contains( "ipaq", false ) ) dev = new Private::iPAQ(); |
86 | else if ( line.contains( "simpad", false ) ) dev = new Private::SIMpad(); | 86 | else if ( line.contains( "simpad", false ) ) dev = new Private::SIMpad(); |
87 | else if ( line.contains( "jornada", false ) ) dev = new Private::Jornada(); | 87 | else if ( line.contains( "jornada", false ) ) dev = new Private::Jornada(); |
88 | else if ( line.contains( "ramses", false ) ) dev = new Private::Ramses(); | 88 | else if ( line.contains( "ramses", false ) ) dev = new Private::Ramses(); |
89 | else qWarning( "ODevice() - unknown hardware - using default." ); | 89 | else qWarning( "ODevice() - unknown hardware - using default." ); |
90 | break; | 90 | break; |
91 | } | 91 | } |
92 | } | 92 | } |
93 | } | 93 | } |
94 | else | 94 | else |
95 | { | 95 | { |
96 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default." ); | 96 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); |
97 | } | 97 | } |
98 | if ( !dev ) dev = new ODevice(); | 98 | if ( !dev ) dev = new ODevice(); |
99 | dev->init(); | 99 | dev->init(); |
100 | } | 100 | } |
101 | return dev; | 101 | return dev; |
102 | } | 102 | } |
103 | 103 | ||
104 | ODevice::ODevice() | 104 | ODevice::ODevice() |
105 | { | 105 | { |
106 | d = new ODeviceData; | 106 | d = new ODeviceData; |
107 | 107 | ||
108 | d->m_modelstr = "Unknown"; | 108 | d->m_modelstr = "Unknown"; |
109 | d->m_model = Model_Unknown; | 109 | d->m_model = Model_Unknown; |
110 | d->m_vendorstr = "Unknown"; | 110 | d->m_vendorstr = "Unknown"; |
111 | d->m_vendor = Vendor_Unknown; | 111 | d->m_vendor = Vendor_Unknown; |
112 | d->m_systemstr = "Unknown"; | 112 | d->m_systemstr = "Unknown"; |
113 | d->m_system = System_Unknown; | 113 | d->m_system = System_Unknown; |
114 | d->m_sysverstr = "0.0"; | 114 | d->m_sysverstr = "0.0"; |
115 | d->m_rotation = Rot0; | 115 | d->m_rotation = Rot0; |
116 | d->m_direction = CW; | 116 | d->m_direction = CW; |
117 | 117 | ||
118 | d->m_holdtime = 1000; // 1000ms | 118 | d->m_holdtime = 1000; // 1000ms |
119 | d->m_buttons = 0; | 119 | d->m_buttons = 0; |
120 | d->m_cpu_frequencies = new QStrList; | 120 | d->m_cpu_frequencies = new QStrList; |
121 | } | 121 | } |
122 | 122 | ||
123 | void ODevice::systemMessage ( const QCString &msg, const QByteArray & ) | 123 | void ODevice::systemMessage ( const QCString &msg, const QByteArray & ) |
124 | { | 124 | { |
125 | if ( msg == "deviceButtonMappingChanged()" ) { | 125 | if ( msg == "deviceButtonMappingChanged()" ) { |
126 | reloadButtonMapping(); | 126 | reloadButtonMapping(); |
127 | } | 127 | } |
128 | } | 128 | } |
129 | 129 | ||
130 | void ODevice::init() | 130 | void ODevice::init() |
131 | { | 131 | { |
132 | } | 132 | } |
133 | 133 | ||
134 | /** | 134 | /** |
135 | * This method initialises the button mapping | 135 | * This method initialises the button mapping |
136 | */ | 136 | */ |
137 | void ODevice::initButtons() | 137 | void ODevice::initButtons() |
138 | { | 138 | { |
139 | if ( d->m_buttons ) | 139 | if ( d->m_buttons ) |
140 | return; | 140 | return; |
141 | 141 | ||
142 | qDebug ( "init Buttons" ); | 142 | qDebug ( "init Buttons" ); |
143 | d->m_buttons = new QValueList <ODeviceButton>; | 143 | d->m_buttons = new QValueList <ODeviceButton>; |
144 | 144 | ||