summaryrefslogtreecommitdiff
authorzecke <zecke>2004-08-20 21:59:48 (UTC)
committer zecke <zecke>2004-08-20 21:59:48 (UTC)
commite67b6a8748af0856d77eeb46048d36e58314793e (patch) (unidiff)
tree284808173f9574c3c466eb8c65865bd7aed6de2d
parentda08f45abfb5e74c390d12736d3db9e8050068a2 (diff)
downloadopie-e67b6a8748af0856d77eeb46048d36e58314793e.zip
opie-e67b6a8748af0856d77eeb46048d36e58314793e.tar.gz
opie-e67b6a8748af0856d77eeb46048d36e58314793e.tar.bz2
back out unintentional change. Use an unknown ODevice instead
of Internal::Zaurus
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 835586e..b58f9eb 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -102,97 +102,97 @@ struct default_button default_buttons [] = {
102 "devicebuttons/z_home", 102 "devicebuttons/z_home",
103 "QPE/Launcher", "home()", 103 "QPE/Launcher", "home()",
104 "buttonsettings", "raise()" }, 104 "buttonsettings", "raise()" },
105 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 105 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
106 "devicebuttons/z_menu", 106 "devicebuttons/z_menu",
107 "QPE/TaskBar", "toggleMenu()", 107 "QPE/TaskBar", "toggleMenu()",
108 "QPE/TaskBar", "toggleStartMenu()" }, 108 "QPE/TaskBar", "toggleStartMenu()" },
109 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 109 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
110 "devicebuttons/z_mail", 110 "devicebuttons/z_mail",
111 "opiemail", "raise()", 111 "opiemail", "raise()",
112 "opiemail", "newMail()" }, 112 "opiemail", "newMail()" },
113}; 113};
114 114
115ODevice *ODevice::inst() 115ODevice *ODevice::inst()
116{ 116{
117 static ODevice *dev = 0; 117 static ODevice *dev = 0;
118 118
119 // rewrite this to only use /proc/cpuinfo or so 119 // rewrite this to only use /proc/cpuinfo or so
120 QString cpu_info; 120 QString cpu_info;
121 121
122 if ( !dev ) 122 if ( !dev )
123 { 123 {
124 QFile f( PATH_PROC_CPUINFO ); 124 QFile f( PATH_PROC_CPUINFO );
125 if ( f.open( IO_ReadOnly ) ) 125 if ( f.open( IO_ReadOnly ) )
126 { 126 {
127 QTextStream s( &f ); 127 QTextStream s( &f );
128 while ( !s.atEnd() ) 128 while ( !s.atEnd() )
129 { 129 {
130 QString line; 130 QString line;
131 line = s.readLine(); 131 line = s.readLine();
132 if ( line.startsWith( "Hardware" ) ) 132 if ( line.startsWith( "Hardware" ) )
133 { 133 {
134 qDebug( "ODevice() - found '%s'", (const char*) line ); 134 qDebug( "ODevice() - found '%s'", (const char*) line );
135 cpu_info = line; 135 cpu_info = line;
136 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); 136 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus();
137 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); 137 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ();
138 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); 138 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad();
139 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); 139 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada();
140 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); 140 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses();
141 else qWarning( "ODevice() - unknown hardware - using default." ); 141 else qWarning( "ODevice() - unknown hardware - using default." );
142 break; 142 break;
143 } 143 }
144 } 144 }
145 } 145 }
146 else 146 else
147 { 147 {
148 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); 148 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO );
149 } 149 }
150 if ( !dev ) dev = new Internal::Zaurus(); 150 if ( !dev ) dev = new ODevice();
151 dev->init(cpu_info); 151 dev->init(cpu_info);
152 } 152 }
153 return dev; 153 return dev;
154} 154}
155 155
156ODevice::ODevice() 156ODevice::ODevice()
157{ 157{
158 d = new ODeviceData; 158 d = new ODeviceData;
159 159
160 d->m_modelstr = "Unknown"; 160 d->m_modelstr = "Unknown";
161 d->m_model = Model_Unknown; 161 d->m_model = Model_Unknown;
162 d->m_vendorstr = "Unknown"; 162 d->m_vendorstr = "Unknown";
163 d->m_vendor = Vendor_Unknown; 163 d->m_vendor = Vendor_Unknown;
164 d->m_systemstr = "Unknown"; 164 d->m_systemstr = "Unknown";
165 d->m_system = System_Unknown; 165 d->m_system = System_Unknown;
166 d->m_sysverstr = "0.0"; 166 d->m_sysverstr = "0.0";
167 d->m_rotation = Rot0; 167 d->m_rotation = Rot0;
168 d->m_direction = CW; 168 d->m_direction = CW;
169 169
170 d->m_holdtime = 1000; // 1000ms 170 d->m_holdtime = 1000; // 1000ms
171 d->m_buttons = 0; 171 d->m_buttons = 0;
172 d->m_cpu_frequencies = new QStrList; 172 d->m_cpu_frequencies = new QStrList;
173 173
174 // New distribution detection code first checks for legacy distributions, 174 // New distribution detection code first checks for legacy distributions,
175 // identified by /etc/familiar-version or /etc/oz_version. 175 // identified by /etc/familiar-version or /etc/oz_version.
176 // Then check for OpenEmbedded and lastly, read /etc/issue 176 // Then check for OpenEmbedded and lastly, read /etc/issue
177 177
178 for ( unsigned int i = 0; i < sizeof distributions; ++i ) 178 for ( unsigned int i = 0; i < sizeof distributions; ++i )
179 { 179 {
180 if ( QFile::exists( distributions[i].sysvfile ) ) 180 if ( QFile::exists( distributions[i].sysvfile ) )
181 { 181 {
182 d->m_systemstr = distributions[i].sysstr; 182 d->m_systemstr = distributions[i].sysstr;
183 d->m_system = distributions[i].system; 183 d->m_system = distributions[i].system;
184 d->m_sysverstr = "<Unknown>"; 184 d->m_sysverstr = "<Unknown>";
185 QFile f( distributions[i].sysvfile ); 185 QFile f( distributions[i].sysvfile );
186 if ( f.open( IO_ReadOnly ) ) 186 if ( f.open( IO_ReadOnly ) )
187 { 187 {
188 QTextStream ts( &f ); 188 QTextStream ts( &f );
189 d->m_sysverstr = ts.readLine(); 189 d->m_sysverstr = ts.readLine();
190 } 190 }
191 break; 191 break;
192 } 192 }
193 } 193 }
194} 194}
195 195
196void ODevice::systemMessage( const QCString &msg, const QByteArray & ) 196void ODevice::systemMessage( const QCString &msg, const QByteArray & )
197{ 197{
198 if ( msg == "deviceButtonMappingChanged()" ) { 198 if ( msg == "deviceButtonMappingChanged()" ) {