summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_simpad.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_simpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp
index ebf0cbb..9fde7f9 100644
--- a/libopie2/opiecore/device/odevice_simpad.cpp
+++ b/libopie2/opiecore/device/odevice_simpad.cpp
@@ -55,10 +55,22 @@
55#include <linux/soundcard.h> 55#include <linux/soundcard.h>
56#endif 56#endif
57 57
58using namespace Opie::Core; 58namespace Opie {
59using namespace Opie::Core::Internal; 59namespace Core {
60namespace Internal {
61namespace {
62struct s_button {
63 uint model;
64 Qt::Key code;
65 char *utext;
66 char *pix;
67 char *fpressedservice;
68 char *fpressedaction;
69 char *fheldservice;
70 char *fheldaction;
71};
60 72
61struct s_button simpad_buttons [] = { 73static struct s_button simpad_buttons [] = {
62 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 74 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
63 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), 75 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"),
64 "devicebuttons/simpad_lower_up", 76 "devicebuttons/simpad_lower_up",
@@ -113,6 +125,8 @@ struct s_button simpad_buttons [] = {
113 "buttonsettings", "raise()" }, 125 "buttonsettings", "raise()" },
114 */ 126 */
115}; 127};
128}
129
116 130
117void SIMpad::init(const QString&) 131void SIMpad::init(const QString&)
118{ 132{
@@ -149,7 +163,8 @@ void SIMpad::initButtons()
149 163
150 d->m_buttons = new QValueList <ODeviceButton>; 164 d->m_buttons = new QValueList <ODeviceButton>;
151 165
152 for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { 166 uint size = sizeof(simpad_buttons)/sizeof(s_button);
167 for ( uint i = 0; i < size; i++ ) {
153 s_button *sb = simpad_buttons + i; 168 s_button *sb = simpad_buttons + i;
154 ODeviceButton b; 169 ODeviceButton b;
155 170
@@ -381,3 +396,7 @@ void SIMpad::updateAllWidgets() {
381 396
382 delete list; 397 delete list;
383} 398}
399
400}
401}
402}