author | zecke <zecke> | 2004-11-03 22:57:37 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-03 22:57:37 (UTC) |
commit | 07900eb7986f63e56072b1fb8fe5dbf846c8519d (patch) (side-by-side diff) | |
tree | fb1242d501314408de6328e43ced421a274f9c48 | |
parent | c85842bfd4b008eb6bd7527f0511f36dbf693ba5 (diff) | |
download | opie-07900eb7986f63e56072b1fb8fe5dbf846c8519d.zip opie-07900eb7986f63e56072b1fb8fe5dbf846c8519d.tar.gz opie-07900eb7986f63e56072b1fb8fe5dbf846c8519d.tar.bz2 |
-Make struct s_button (simpad button) really internal
-Make the s_button array static and invisible
-Use namespace { instead of 'using namespace...;'
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 27 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.h | 12 |
2 files changed, 23 insertions, 16 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 @@ -52,16 +52,28 @@ #include <sys/time.h> #include <unistd.h> #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif -using namespace Opie::Core; -using namespace Opie::Core::Internal; +namespace Opie { +namespace Core { +namespace Internal { +namespace { +struct s_button { + uint model; + Qt::Key code; + char *utext; + char *pix; + char *fpressedservice; + char *fpressedaction; + char *fheldservice; + char *fheldaction; +}; -struct s_button simpad_buttons [] = { +static struct s_button simpad_buttons [] = { { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), "devicebuttons/simpad_lower_up", "datebook", "nextView()", "today", "raise()" }, { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, @@ -110,12 +122,14 @@ struct s_button simpad_buttons [] = { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), "devicebuttons/simpad_upper_lower", "QPE/Launcher", "home()", "buttonsettings", "raise()" }, */ }; +} + void SIMpad::init(const QString&) { d->m_vendorstr = "SIEMENS"; d->m_vendor = Vendor_SIEMENS; @@ -146,13 +160,14 @@ void SIMpad::initButtons() { if ( d->m_buttons ) return; d->m_buttons = new QValueList <ODeviceButton>; - for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { + uint size = sizeof(simpad_buttons)/sizeof(s_button); + for ( uint i = 0; i < size; i++ ) { s_button *sb = simpad_buttons + i; ODeviceButton b; if (( sb->model & d->m_model ) == d->m_model ) { b. setKeycode ( sb->code ); b. setUserText ( QObject::tr ( "Button", sb->utext )); @@ -378,6 +393,10 @@ void SIMpad::updateAllWidgets() { wid->update(); ++it; } delete list; } + +} +} +} diff --git a/libopie2/opiecore/device/odevice_simpad.h b/libopie2/opiecore/device/odevice_simpad.h index c25b911..41b94d1 100644 --- a/libopie2/opiecore/device/odevice_simpad.h +++ b/libopie2/opiecore/device/odevice_simpad.h @@ -65,23 +65,11 @@ protected: int m_power_timer; OLedState m_leds [2]; private: static void updateAllWidgets(); }; - -struct s_button { - uint model; - Qt::Key code; - char *utext; - char *pix; - char *fpressedservice; - char *fpressedaction; - char *fheldservice; - char *fheldaction; -}; - } } } #endif |