summaryrefslogtreecommitdiff
authordeller <deller>2005-04-05 21:10:11 (UTC)
committer deller <deller>2005-04-05 21:10:11 (UTC)
commitf0000ae8e62df9606160ab683ae163ddc40c32c4 (patch) (unidiff)
tree642a8b7927c7ff77d196399d4498559e585a2487
parente9f44f94ac905e49ea5def24532ac2d3bf4ed053 (diff)
downloadopie-f0000ae8e62df9606160ab683ae163ddc40c32c4.zip
opie-f0000ae8e62df9606160ab683ae163ddc40c32c4.tar.gz
opie-f0000ae8e62df9606160ab683ae163ddc40c32c4.tar.bz2
crash-fix in odevice.cpp while scanning the distribution table (#1565)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog1
-rw-r--r--libopie2/opiecore/device/odevice.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b917c4f..01e5e40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,135 +1,136 @@
1 2005-??-??Opie 1.2.1 1 2005-??-??Opie 1.2.1
2 2
3 Fixed Bugs 3 Fixed Bugs
4 ---------- 4 ----------
5 * n.a.- scale O-Menu-Applets appropriately (mickeyl) 5 * n.a.- scale O-Menu-Applets appropriately (mickeyl)
6 * #1535- Missing line break and unnecessary location shown with Today-Calendar plugin (deller) 6 * #1535- Missing line break and unnecessary location shown with Today-Calendar plugin (deller)
7 * n.a.- always show volume and wireless applet popups inside visible screen (deller) 7 * n.a.- always show volume and wireless applet popups inside visible screen (deller)
8 * #1565- crash-fix in odevice.cpp while scanning the distribution table (deller)
8 9
9 2005-03-25Opie 1.2.0 10 2005-03-25Opie 1.2.0
10 11
11 Fixed Bugs 12 Fixed Bugs
12 ---------- 13 ----------
13 * #1613 - AdvancedFM - scale toolbar icons appropriately (drw) 14 * #1613 - AdvancedFM - scale toolbar icons appropriately (drw)
14 * #1620 - OFileSelector - show the button on press and not on press on hold (alwin) 15 * #1620 - OFileSelector - show the button on press and not on press on hold (alwin)
15 * #1473 - Opie-Eye - Same as #1620 but we lack a common FileSystem Button class (zecke) 16 * #1473 - Opie-Eye - Same as #1620 but we lack a common FileSystem Button class (zecke)
16 * n.a. - PackageManager - fix bug where messages show up multiple times in install dialog (drw) 17 * n.a. - PackageManager - fix bug where messages show up multiple times in install dialog (drw)
17 * n.a. - make qpeglobal.h include qglobal.h (zecke) 18 * n.a. - make qpeglobal.h include qglobal.h (zecke)
18 19
19 2005-03-20Opie 1.2.0-rc1 20 2005-03-20Opie 1.2.0-rc1
20 21
21 22
22 New Features 23 New Features
23 ------------ 24 ------------
24 * Launcher: Support a static background pixmap (mickeyl) 25 * Launcher: Support a static background pixmap (mickeyl)
25 * LauncherSettings: Choose whether to have a static background pixmap (mickeyl) 26 * LauncherSettings: Choose whether to have a static background pixmap (mickeyl)
26 * PackageManager supports the 'lists_dir' ipkg configuration option (drw) 27 * PackageManager supports the 'lists_dir' ipkg configuration option (drw)
27 * Added hi-res inline images for large resolution devices (drw) 28 * Added hi-res inline images for large resolution devices (drw)
28 * Improved launcher icons for consistency (ar) 29 * Improved launcher icons for consistency (ar)
29 * Datebook: Added plugin system to datebook so holidays and birthdays from contacts may displayed in datebook (alwin) 30 * Datebook: Added plugin system to datebook so holidays and birthdays from contacts may displayed in datebook (alwin)
30 31
31 Fixed Bugs 32 Fixed Bugs
32 ---------- 33 ----------
33 * #1236 - VCards contained empty home and work address entries causing Palms to crash (eilers) 34 * #1236 - VCards contained empty home and work address entries causing Palms to crash (eilers)
34 * #1412 - Launcher Settings - fixed default settings for background in Edit tab dialog (drw) 35 * #1412 - Launcher Settings - fixed default settings for background in Edit tab dialog (drw)
35 * #1472 - Opie textedit now check for unsaved changes on ESC key (ljp) 36 * #1472 - Opie textedit now check for unsaved changes on ESC key (ljp)
36 * #1474 - Implement GUI for Scrollbars on the Left in Appearance (zecke) 37 * #1474 - Implement GUI for Scrollbars on the Left in Appearance (zecke)
37 * #1482 - Fix double '/' in paths (zecke) 38 * #1482 - Fix double '/' in paths (zecke)
38 * #1536 - Autosave of custom locations in opie backup (ar) 39 * #1536 - Autosave of custom locations in opie backup (ar)
39 * #1539 - Fixed displaying too long path in the delete dialog in opie-eye (zecke) 40 * #1539 - Fixed displaying too long path in the delete dialog in opie-eye (zecke)
40 * #1540 - Implemented deletion of DocLnks in opie-eye (zecke) 41 * #1540 - Implemented deletion of DocLnks in opie-eye (zecke)
41 * #1542 - Fixed Todo crash when priority < 1 or > 5 (drw) 42 * #1542 - Fixed Todo crash when priority < 1 or > 5 (drw)
42 * #1550 - Browse for alarm sound start in QPEDIR/sounds/ (zecke) 43 * #1550 - Browse for alarm sound start in QPEDIR/sounds/ (zecke)
43 * #1554 - Fixed Opie-Console name in .desktop file (mickeyl) 44 * #1554 - Fixed Opie-Console name in .desktop file (mickeyl)
44 * #1556 - Start to look for sound files in /opt/QtPalmtop/sounds (zecke) 45 * #1556 - Start to look for sound files in /opt/QtPalmtop/sounds (zecke)
45 * #1558 - Fixed opie-login breaking opie startup (mickeyl) 46 * #1558 - Fixed opie-login breaking opie startup (mickeyl)
46 * #1560 - Fixed Opie-Console picking up the wrong shell (bluelightning) 47 * #1560 - Fixed Opie-Console picking up the wrong shell (bluelightning)
47 * #1570 - Confirmation needed befor Restore a backup and overwrite local data (ar) 48 * #1570 - Confirmation needed befor Restore a backup and overwrite local data (ar)
48 * #1591 - Addressbook sortorder changed by clicking on column 0 (eilers) 49 * #1591 - Addressbook sortorder changed by clicking on column 0 (eilers)
49 * #1599 - Security - change recommendation for opie-multiauth to opie-securityplugin (gints) 50 * #1599 - Security - change recommendation for opie-multiauth to opie-securityplugin (gints)
50 * #1604 - Checkbook crashed on startup (drw) 51 * #1604 - Checkbook crashed on startup (drw)
51 * #1608 - Addressbook crashed after search, which may caused by not initialzed member variable (eilers) 52 * #1608 - Addressbook crashed after search, which may caused by not initialzed member variable (eilers)
52 * #1608 - QueryByExampe-Datediff on SQL database did not worked properly (eilers) 53 * #1608 - QueryByExampe-Datediff on SQL database did not worked properly (eilers)
53 * n.a. - Netsystemtime - fixed UI to prevent error dialog from displaying when it shouldn't, get rid of some compiler warnings (drw) 54 * n.a. - Netsystemtime - fixed UI to prevent error dialog from displaying when it shouldn't, get rid of some compiler warnings (drw)
54 * n.a. - PackageManager - fixed where last package in status file was not shown as installed when it should be (drw) 55 * n.a. - PackageManager - fixed where last package in status file was not shown as installed when it should be (drw)
55 * n.a. - PackageManager - fixed bug where lists_dir was not being honored at startup (drw) 56 * n.a. - PackageManager - fixed bug where lists_dir was not being honored at startup (drw)
56 * n.a. - PackageManager - provided default value for lists_dir when none is entered in configuration dialog (drw) 57 * n.a. - PackageManager - provided default value for lists_dir when none is entered in configuration dialog (drw)
57 * n.a. - OTabWidget - fixed scroll buttons, fix display position of tabs (drw) 58 * n.a. - OTabWidget - fixed scroll buttons, fix display position of tabs (drw)
58 * n.a. - AddressBook - fixed sorting by 'File As' name (drw) 59 * n.a. - AddressBook - fixed sorting by 'File As' name (drw)
59 * n.a. - AddressBook - fixed category handling for 'All' and 'Unfiled' (eilers) 60 * n.a. - AddressBook - fixed category handling for 'All' and 'Unfiled' (eilers)
60 * n.a. - AddressBook - fixed letter picker record selection and sort records afterwards (drw) 61 * n.a. - AddressBook - fixed letter picker record selection and sort records afterwards (drw)
61 62
62 Internal 63 Internal
63 -------- 64 --------
64 * Worked around bug in Qt/Embedded 2.3.10: qt_version() returns 231 (mickeyl) 65 * Worked around bug in Qt/Embedded 2.3.10: qt_version() returns 231 (mickeyl)
65 * Killed the need for weak symbols in QtE (zecke) 66 * Killed the need for weak symbols in QtE (zecke)
66 * Added optional building libqpe without inline images (mickeyl) 67 * Added optional building libqpe without inline images (mickeyl)
67 * OColorButton - fixed so does not emit a colorSelected signal inside of resizeEvent (drw) 68 * OColorButton - fixed so does not emit a colorSelected signal inside of resizeEvent (drw)
68 69
69 2005-02-03Opie 1.1.9 70 2005-02-03Opie 1.1.9
70 71
71 New Features 72 New Features
72 ------------ 73 ------------
73 * Number of icon columns in Launcher is customizable through Launcher.conf (hrw,zecke,mickeyl) 74 * Number of icon columns in Launcher is customizable through Launcher.conf (hrw,zecke,mickeyl)
74 * Number of icon columns in Launcher is customizable through LauncherSettings (mickeyl) 75 * Number of icon columns in Launcher is customizable through LauncherSettings (mickeyl)
75 * Usability enhancements in OpieIRC (skyhusker) 76 * Usability enhancements in OpieIRC (skyhusker)
76 77
77 Fixed Bugs 78 Fixed Bugs
78 ---------- 79 ----------
79 * #1501 - Fixed bug in todo sql backend (eilers) 80 * #1501 - Fixed bug in todo sql backend (eilers)
80 * #1505 - Added more Swap sizes in memoryapplet (mickeyl) 81 * #1505 - Added more Swap sizes in memoryapplet (mickeyl)
81 * #1525 - Hopefully fixed double alarms and not removing alarms set with the Clock application (zecke) 82 * #1525 - Hopefully fixed double alarms and not removing alarms set with the Clock application (zecke)
82 * #1533 - Security Owner Dialog (shown in case of unsuccessfull authentiacation) wasn't able to display information in non latin1 encoding (zecke) 83 * #1533 - Security Owner Dialog (shown in case of unsuccessfull authentiacation) wasn't able to display information in non latin1 encoding (zecke)
83 * n.a. - Removed hard coded font sizes in a couple of inputmethods (mickeyl) 84 * n.a. - Removed hard coded font sizes in a couple of inputmethods (mickeyl)
84 * n.a. - Removed MediumDlg appearing prior to FirstUsage wizard (i.e. calibration) (mickeyl) 85 * n.a. - Removed MediumDlg appearing prior to FirstUsage wizard (i.e. calibration) (mickeyl)
85 * n.a. - Fixed numerous buglets in OpieIRC (skyhusker) 86 * n.a. - Fixed numerous buglets in OpieIRC (skyhusker)
86 87
87 Internal 88 Internal
88 -------- 89 --------
89 * Added the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers (mickeyl) 90 * Added the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers (mickeyl)
90 * You can now use the Opie build system in combination with a OpenEmbedded staging area which makes a nice cross development environment (mickeyl) 91 * You can now use the Opie build system in combination with a OpenEmbedded staging area which makes a nice cross development environment (mickeyl)
91 * Made Opie compilable with Qt/Embedded 2.3.10 (ar) 92 * Made Opie compilable with Qt/Embedded 2.3.10 (ar)
92 * Changed Launcher to get default orientation from ODevice w/ QWS_DISPLAY overriding (mickeyl) 93 * Changed Launcher to get default orientation from ODevice w/ QWS_DISPLAY overriding (mickeyl)
93 * Build tree cleanups (mickeyl) 94 * Build tree cleanups (mickeyl)
94 95
95 2004-11-26Opie 1.1.8 96 2004-11-26Opie 1.1.8
96 97
97 New Features 98 New Features
98 ------------ 99 ------------
99 * PackageManager supports installation of local ipkg files (drw) 100 * PackageManager supports installation of local ipkg files (drw)
100 * PackageManager supports linking of applications to root (drw) 101 * PackageManager supports linking of applications to root (drw)
101 * PackageManager supports src/gz feeds (drw,wimpie) 102 * PackageManager supports src/gz feeds (drw,wimpie)
102 * Added a syslog information tab to sysinfo (mickeyl) 103 * Added a syslog information tab to sysinfo (mickeyl)
103 * Added new, more consistent, PIM icons + a GIMP teplate (ar) 104 * Added new, more consistent, PIM icons + a GIMP teplate (ar)
104 105
105 Fixed Bugs 106 Fixed Bugs
106 ---------- 107 ----------
107 * #1017 - Tetrix doesn't display correctly for high resolution screens (drw) 108 * #1017 - Tetrix doesn't display correctly for high resolution screens (drw)
108 * #1269 - VCards were imported into personal area if it was activated (eilers) 109 * #1269 - VCards were imported into personal area if it was activated (eilers)
109 * #1464 - Packagemanager dont set active filter after install a package (drw) 110 * #1464 - Packagemanager dont set active filter after install a package (drw)
110 * #1479 - Improved VCard-Parser to import VCards created by Evolution 2 and Apple Addressbook (eilers) 111 * #1479 - Improved VCard-Parser to import VCards created by Evolution 2 and Apple Addressbook (eilers)
111 * #1493 - Fixed one column layout bug of the launcher (hrw) 112 * #1493 - Fixed one column layout bug of the launcher (hrw)
112 * n.a. - PackageManager - (Minor UI tweak) in filter dialog, when option is enabled, set focus to widget that corresponds to that option (drw) 113 * n.a. - PackageManager - (Minor UI tweak) in filter dialog, when option is enabled, set focus to widget that corresponds to that option (drw)
113 * n.a. - PackageManager - (Minor UI tweak) fix double entry in source feed configuration when adding a new feed (drw) 114 * n.a. - PackageManager - (Minor UI tweak) fix double entry in source feed configuration when adding a new feed (drw)
114 * n.a. - Battery Applet - fix sizing of battery info popup (drw,mickeyl) 115 * n.a. - Battery Applet - fix sizing of battery info popup (drw,mickeyl)
115 116
116 Internal 117 Internal
117 -------- 118 --------
118 * Moved libopie1 to unsupported (mickeyl) 119 * Moved libopie1 to unsupported (mickeyl)
119 * Implemented generic queryByExample() with incremental searching. A lot of internal changes of the Pim2-library (eilers) 120 * Implemented generic queryByExample() with incremental searching. A lot of internal changes of the Pim2-library (eilers)
120 * Added fast and full featured and incremental sorted() for SQL addressbook backend (eilers) 121 * Added fast and full featured and incremental sorted() for SQL addressbook backend (eilers)
121 122
122 2004-11-14Opie 1.1.7 123 2004-11-14Opie 1.1.7
123 124
124 New Features 125 New Features
125 ------------ 126 ------------
126 * libOpieDB now uses SQLite V3 instead V2. Remember to upgrade your database files! (eilers) 127 * libOpieDB now uses SQLite V3 instead V2. Remember to upgrade your database files! (eilers)
127 * Backup now uses the busy indicator when backing up and restore (ar) 128 * Backup now uses the busy indicator when backing up and restore (ar)
128 * OpiePlayer2 gained adding of Directories to the playlist (zecke) 129 * OpiePlayer2 gained adding of Directories to the playlist (zecke)
129 * OpiePlayer2 better error handling (zecke) 130 * OpiePlayer2 better error handling (zecke)
130 * OpiePlayer2 progress indication while streaming (zecke) 131 * OpiePlayer2 progress indication while streaming (zecke)
131 * OpiePlayer2 ported to use libxine 1.0.0-rc6a (brad,zecke) 132 * OpiePlayer2 ported to use libxine 1.0.0-rc6a (brad,zecke)
132 * Ported brightnessapplet from Qtopia 1.7 (mickeyl) 133 * Ported brightnessapplet from Qtopia 1.7 (mickeyl)
133 * Opie-Eye got a Digital Camera File Backend (alwin,zecke) 134 * Opie-Eye got a Digital Camera File Backend (alwin,zecke)
134 * Support for Tuxpad1 of Tradesquare.NL (mickeyl,zecke) 135 * Support for Tuxpad1 of Tradesquare.NL (mickeyl,zecke)
135 * Opie-Console use Custom Font and Size in a Profile (harlekin) 136 * Opie-Console use Custom Font and Size in a Profile (harlekin)
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index af77ed1..fcdbf45 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -66,257 +66,257 @@ namespace Opie {
66namespace Core { 66namespace Core {
67 67
68static const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; 68static const char* PATH_PROC_CPUINFO = "/proc/cpuinfo";
69 69
70 70
71/* STATIC and common implementation */ 71/* STATIC and common implementation */
72/* EXPORT */ ODistribution distributions[] = { 72/* EXPORT */ ODistribution distributions[] = {
73 { System_Familiar, "FamiliarLinux", "/etc/familiar-version" }, 73 { System_Familiar, "FamiliarLinux", "/etc/familiar-version" },
74 { System_OpenZaurus, "OpenZaurus", "/etc/oz_version" }, 74 { System_OpenZaurus, "OpenZaurus", "/etc/oz_version" },
75 { System_OpenEmbedded, "OpenEmbedded", "/etc/oe-version" }, 75 { System_OpenEmbedded, "OpenEmbedded", "/etc/oe-version" },
76 { System_Unknown, "Linux", "/etc/issue" }, 76 { System_Unknown, "Linux", "/etc/issue" },
77}; 77};
78 78
79 79
80/* EXPORT */ bool isQWS(){ 80/* EXPORT */ bool isQWS(){
81 return qApp ? ( qApp->type() == QApplication::GuiServer ) : false; 81 return qApp ? ( qApp->type() == QApplication::GuiServer ) : false;
82} 82}
83 83
84/* EXPORT */ QCString makeChannel ( const char *str ){ 84/* EXPORT */ QCString makeChannel ( const char *str ){
85 if ( str && !::strchr ( str, '/' )) 85 if ( str && !::strchr ( str, '/' ))
86 return QCString ( "QPE/Application/" ) + str; 86 return QCString ( "QPE/Application/" ) + str;
87 else 87 else
88 return str; 88 return str;
89} 89}
90 90
91 91
92 92
93/* Now the default implementation of ODevice */ 93/* Now the default implementation of ODevice */
94 94
95struct default_button default_buttons [] = { 95struct default_button default_buttons [] = {
96 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 96 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
97 "devicebuttons/z_calendar", 97 "devicebuttons/z_calendar",
98 "datebook", "nextView()", 98 "datebook", "nextView()",
99 "today", "raise()" }, 99 "today", "raise()" },
100 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 100 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
101 "devicebuttons/z_contact", 101 "devicebuttons/z_contact",
102 "addressbook", "raise()", 102 "addressbook", "raise()",
103 "addressbook", "beamBusinessCard()" }, 103 "addressbook", "beamBusinessCard()" },
104 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 104 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
105 "devicebuttons/z_home", 105 "devicebuttons/z_home",
106 "QPE/Launcher", "home()", 106 "QPE/Launcher", "home()",
107 "buttonsettings", "raise()" }, 107 "buttonsettings", "raise()" },
108 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 108 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
109 "devicebuttons/z_menu", 109 "devicebuttons/z_menu",
110 "QPE/TaskBar", "toggleMenu()", 110 "QPE/TaskBar", "toggleMenu()",
111 "QPE/TaskBar", "toggleStartMenu()" }, 111 "QPE/TaskBar", "toggleStartMenu()" },
112 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 112 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
113 "devicebuttons/z_mail", 113 "devicebuttons/z_mail",
114 "opiemail", "raise()", 114 "opiemail", "raise()",
115 "opiemail", "newMail()" }, 115 "opiemail", "newMail()" },
116}; 116};
117 117
118ODevice *ODevice::inst() 118ODevice *ODevice::inst()
119{ 119{
120 static ODevice *dev = 0; 120 static ODevice *dev = 0;
121 QString cpu_info; 121 QString cpu_info;
122 122
123 if ( !dev ) 123 if ( !dev )
124 { 124 {
125 QFile f( PATH_PROC_CPUINFO ); 125 QFile f( PATH_PROC_CPUINFO );
126 if ( f.open( IO_ReadOnly ) ) 126 if ( f.open( IO_ReadOnly ) )
127 { 127 {
128 QTextStream s( &f ); 128 QTextStream s( &f );
129 while ( !s.atEnd() ) 129 while ( !s.atEnd() )
130 { 130 {
131 QString line; 131 QString line;
132 line = s.readLine(); 132 line = s.readLine();
133 if ( line.startsWith( "Hardware" ) ) 133 if ( line.startsWith( "Hardware" ) )
134 { 134 {
135 qDebug( "ODevice() - found '%s'", (const char*) line ); 135 qDebug( "ODevice() - found '%s'", (const char*) line );
136 cpu_info = line; 136 cpu_info = line;
137 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); 137 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus();
138 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); 138 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ();
139 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); 139 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad();
140 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); 140 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada();
141 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); 141 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses();
142 else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle(); 142 else if ( line.contains( "Tradesquare.NL", false ) ) dev = new Internal::Beagle();
143 else qWarning( "ODevice() - unknown hardware - using default." ); 143 else qWarning( "ODevice() - unknown hardware - using default." );
144 break; 144 break;
145 } else if ( line.startsWith( "vendor_id" ) ) { 145 } else if ( line.startsWith( "vendor_id" ) ) {
146 qDebug( "ODevice() - found '%s'", (const char*) line ); 146 qDebug( "ODevice() - found '%s'", (const char*) line );
147 cpu_info = line; 147 cpu_info = line;
148 if( line.contains( "genuineintel", false ) ) { 148 if( line.contains( "genuineintel", false ) ) {
149 dev = new Internal::GenuineIntel(); 149 dev = new Internal::GenuineIntel();
150 break; 150 break;
151 } 151 }
152 } 152 }
153 } 153 }
154 } 154 }
155 else 155 else
156 { 156 {
157 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); 157 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO );
158 } 158 }
159 if ( !dev ) dev = new ODevice(); 159 if ( !dev ) dev = new ODevice();
160 dev->init(cpu_info); 160 dev->init(cpu_info);
161 } 161 }
162 return dev; 162 return dev;
163} 163}
164 164
165ODevice::ODevice() 165ODevice::ODevice()
166{ 166{
167 d = new ODeviceData; 167 d = new ODeviceData;
168 168
169 d->m_modelstr = "Unknown"; 169 d->m_modelstr = "Unknown";
170 d->m_model = Model_Unknown; 170 d->m_model = Model_Unknown;
171 d->m_vendorstr = "Unknown"; 171 d->m_vendorstr = "Unknown";
172 d->m_vendor = Vendor_Unknown; 172 d->m_vendor = Vendor_Unknown;
173 d->m_systemstr = "Unknown"; 173 d->m_systemstr = "Unknown";
174 d->m_system = System_Unknown; 174 d->m_system = System_Unknown;
175 d->m_sysverstr = "0.0"; 175 d->m_sysverstr = "0.0";
176 d->m_rotation = Rot0; 176 d->m_rotation = Rot0;
177 d->m_direction = CW; 177 d->m_direction = CW;
178 178
179 d->m_holdtime = 1000; // 1000ms 179 d->m_holdtime = 1000; // 1000ms
180 d->m_buttons = 0; 180 d->m_buttons = 0;
181 d->m_cpu_frequencies = new QStrList; 181 d->m_cpu_frequencies = new QStrList;
182 182
183 183
184 /* mixer */ 184 /* mixer */
185 d->m_sound = d->m_vol = d->m_mixer = -1; 185 d->m_sound = d->m_vol = d->m_mixer = -1;
186 186
187 /* System QCopChannel created */ 187 /* System QCopChannel created */
188 d->m_initializedButtonQcop = false; 188 d->m_initializedButtonQcop = false;
189 189
190 // New distribution detection code first checks for legacy distributions, 190 // New distribution detection code first checks for legacy distributions,
191 // identified by /etc/familiar-version or /etc/oz_version. 191 // identified by /etc/familiar-version or /etc/oz_version.
192 // Then check for OpenEmbedded and lastly, read /etc/issue 192 // Then check for OpenEmbedded and lastly, read /etc/issue
193 193
194 for ( unsigned int i = 0; i < sizeof distributions; ++i ) 194 for ( unsigned int i = 0; i < sizeof(distributions)/sizeof(ODistribution); ++i )
195 { 195 {
196 if ( QFile::exists( distributions[i].sysvfile ) ) 196 if ( QFile::exists( distributions[i].sysvfile ) )
197 { 197 {
198 d->m_systemstr = distributions[i].sysstr; 198 d->m_systemstr = distributions[i].sysstr;
199 d->m_system = distributions[i].system; 199 d->m_system = distributions[i].system;
200 d->m_sysverstr = "<Unknown>"; 200 d->m_sysverstr = "<Unknown>";
201 QFile f( distributions[i].sysvfile ); 201 QFile f( distributions[i].sysvfile );
202 if ( f.open( IO_ReadOnly ) ) 202 if ( f.open( IO_ReadOnly ) )
203 { 203 {
204 QTextStream ts( &f ); 204 QTextStream ts( &f );
205 d->m_sysverstr = ts.readLine().replace( QRegExp( "\\\\." ), "" ); 205 d->m_sysverstr = ts.readLine().replace( QRegExp( "\\\\." ), "" );
206 } 206 }
207 break; 207 break;
208 } 208 }
209 } 209 }
210} 210}
211 211
212void ODevice::systemMessage( const QCString &msg, const QByteArray & ) 212void ODevice::systemMessage( const QCString &msg, const QByteArray & )
213{ 213{
214 if ( msg == "deviceButtonMappingChanged()" ) { 214 if ( msg == "deviceButtonMappingChanged()" ) {
215 reloadButtonMapping(); 215 reloadButtonMapping();
216 } 216 }
217} 217}
218 218
219void ODevice::init(const QString&) 219void ODevice::init(const QString&)
220{ 220{
221} 221}
222 222
223/** 223/**
224* This method initialises the button mapping 224* This method initialises the button mapping
225*/ 225*/
226void ODevice::initButtons() 226void ODevice::initButtons()
227{ 227{
228 if ( d->m_buttons ) 228 if ( d->m_buttons )
229 return; 229 return;
230 230
231 qDebug ( "init Buttons" ); 231 qDebug ( "init Buttons" );
232 d->m_buttons = new QValueList <ODeviceButton>; 232 d->m_buttons = new QValueList <ODeviceButton>;
233 for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) { 233 for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) {
234 default_button *db = default_buttons + i; 234 default_button *db = default_buttons + i;
235 ODeviceButton b; 235 ODeviceButton b;
236 b. setKeycode ( db->code ); 236 b. setKeycode ( db->code );
237 b. setUserText ( QObject::tr ( "Button", db->utext )); 237 b. setUserText ( QObject::tr ( "Button", db->utext ));
238 b. setPixmap ( Resource::loadPixmap ( db->pix )); 238 b. setPixmap ( Resource::loadPixmap ( db->pix ));
239 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction )); 239 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction ));
240 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction )); 240 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction ));
241 d->m_buttons->append ( b ); 241 d->m_buttons->append ( b );
242 } 242 }
243 243
244 reloadButtonMapping(); 244 reloadButtonMapping();
245} 245}
246 246
247ODevice::~ODevice() 247ODevice::~ODevice()
248{ 248{
249// we leak m_devicebuttons and m_cpu_frequency 249// we leak m_devicebuttons and m_cpu_frequency
250// but it's a singleton and it is not so importantant 250// but it's a singleton and it is not so importantant
251// -zecke 251// -zecke
252 delete d; 252 delete d;
253} 253}
254 254
255/** 255/**
256* This method will try to suspend the device 256* This method will try to suspend the device
257* It only works if the user is the QWS Server and the apm application 257* It only works if the user is the QWS Server and the apm application
258* is installed. 258* is installed.
259* It tries to suspend and then waits some time cause some distributions 259* It tries to suspend and then waits some time cause some distributions
260* do have asynchronus apm implementations. 260* do have asynchronus apm implementations.
261* This method will either fail and return false or it'll suspend the 261* This method will either fail and return false or it'll suspend the
262* device and return once the device got woken up 262* device and return once the device got woken up
263* 263*
264* @return if the device got suspended 264* @return if the device got suspended
265*/ 265*/
266bool ODevice::suspend() 266bool ODevice::suspend()
267{ 267{
268 return false; // default implementation == unknown device or qvfb 268 return false; // default implementation == unknown device or qvfb
269} 269}
270 270
271/** 271/**
272* This sets the display on or off 272* This sets the display on or off
273*/ 273*/
274bool ODevice::setDisplayStatus( bool on ) 274bool ODevice::setDisplayStatus( bool on )
275{ 275{
276 qDebug( "ODevice::setDisplayStatus( %d ) - please override me.", on ); 276 qDebug( "ODevice::setDisplayStatus( %d ) - please override me.", on );
277 return false; // don't do anything for unknown models 277 return false; // don't do anything for unknown models
278} 278}
279 279
280/** 280/**
281* This sets the display brightness 281* This sets the display brightness
282* 282*
283* @param b The brightness to be set on a scale from 0 to 255 283* @param b The brightness to be set on a scale from 0 to 255
284* @return success or failure 284* @return success or failure
285*/ 285*/
286bool ODevice::setDisplayBrightness( int b ) 286bool ODevice::setDisplayBrightness( int b )
287{ 287{
288 qDebug( "ODevice::setDisplayBrightness( %d ) - please override me.", b ); 288 qDebug( "ODevice::setDisplayBrightness( %d ) - please override me.", b );
289 return false; 289 return false;
290} 290}
291 291
292/** 292/**
293 * 293 *
294 * @returns the number of steppings on the brightness slider 294 * @returns the number of steppings on the brightness slider
295 * in the Light-'n-Power settings. Values smaller than zero and bigger 295 * in the Light-'n-Power settings. Values smaller than zero and bigger
296 * than 255 do not make sense. 296 * than 255 do not make sense.
297 * 297 *
298 * \sa QSlider::setLineStep 298 * \sa QSlider::setLineStep
299 * \sa QSlider::setPageStep 299 * \sa QSlider::setPageStep
300 */ 300 */
301int ODevice::displayBrightnessResolution() const 301int ODevice::displayBrightnessResolution() const
302{ 302{
303 qDebug( "ODevice::displayBrightnessResolution() - please override me." ); 303 qDebug( "ODevice::displayBrightnessResolution() - please override me." );
304 return 16; 304 return 16;
305} 305}
306 306
307/** 307/**
308* This sets the display contrast 308* This sets the display contrast
309* @param p The contrast to be set on a scale from 0 to 255 309* @param p The contrast to be set on a scale from 0 to 255
310* @returns success or failure 310* @returns success or failure
311*/ 311*/
312bool ODevice::setDisplayContrast( int p ) 312bool ODevice::setDisplayContrast( int p )
313{ 313{
314 qDebug( "ODevice::setDisplayContrast( %d ) - please override me.", p ); 314 qDebug( "ODevice::setDisplayContrast( %d ) - please override me.", p );
315 return false; 315 return false;
316} 316}
317 317
318/** 318/**
319* @returns the maximum value for the contrast settings slider 319* @returns the maximum value for the contrast settings slider
320* or 0 if the device doesn't support setting of a contrast 320* or 0 if the device doesn't support setting of a contrast
321*/ 321*/
322int ODevice::displayContrastResolution() const 322int ODevice::displayContrastResolution() const